{"openapi":"3.1.0","info":{"title":"API Vixpi","version":"1","description":"API pública da Vixpi para consultar e operar a sua conta: serviços, VPS, hospedagem, faturas, créditos e tickets. Autentique com uma chave pessoal `vxp_...` ou com OAuth 2.1. Cada operação indica o escopo que exige. A versão vai na URL (`/api/v1`)."},"externalDocs":{"description":"Portal de desenvolvedores","url":"https://developers.vixpi.host"},"servers":[{"url":"https://api.vixpi.host/api/v1","description":"Produção"}],"tags":[{"name":"Conta"},{"name":"Serviços"},{"name":"VPS"},{"name":"Hospedagem"},{"name":"Hospedagem: deploy"},{"name":"Hospedagem: domínios"},{"name":"Hospedagem: backups"},{"name":"Hospedagem: arquivos"},{"name":"Faturas"},{"name":"Créditos"},{"name":"Pedidos"},{"name":"Tickets"},{"name":"Catálogo"},{"name":"Localização"},{"name":"Afiliados"},{"name":"Contato"},{"name":"Notificações"},{"name":"OAuth"},{"name":"Webhooks recebidos"},{"name":"Documentação"}],"paths":{"/openapi.json":{"get":{"summary":"Esta especificação OpenAPI","tags":["Documentação"],"operationId":"getOpenapiJson","security":[],"responses":{"200":{"description":"Sucesso"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/me":{"get":{"summary":"Dados da conta autenticada","tags":["Conta"],"operationId":"getMe","description":"Escopo: `account:read`","security":[{"oauth2":["account:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/catalog/categories":{"get":{"summary":"Lista as categorias de produto","tags":["Catálogo"],"parameters":[{"name":"parentCategoryId","in":"query","required":false,"schema":{"type":"string"}}],"operationId":"getCatalogCategories","security":[],"responses":{"200":{"description":"Sucesso"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/catalog/products":{"get":{"summary":"Lista os produtos ativos","description":"Filtre por `categoryId` e pagine com `page` e `pageSize`.","tags":["Catálogo"],"parameters":[{"name":"categoryId","in":"query","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"string"}},{"name":"pageSize","in":"query","required":false,"schema":{"type":"string"}}],"operationId":"getCatalogProducts","security":[],"responses":{"200":{"description":"Sucesso"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/catalog/products/{slug}":{"get":{"summary":"Detalha um produto pelo slug","description":"Devolve o produto com seus planos e opções configuráveis.","tags":["Catálogo"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getCatalogProductsBySlug","security":[],"responses":{"200":{"description":"Sucesso"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/catalog/vps-apps":{"get":{"summary":"Lista os apps instaláveis numa VPS","tags":["Catálogo"],"operationId":"getCatalogVpsApps","security":[],"responses":{"200":{"description":"Sucesso"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/catalog/plans/{planId}/os-templates":{"get":{"summary":"Lista os sistemas operacionais de um plano de VPS","tags":["Catálogo"],"parameters":[{"name":"planId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getCatalogPlansByPlanIdOsTemplates","security":[],"responses":{"200":{"description":"Sucesso"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/contact":{"post":{"summary":"Envia uma mensagem pelo formulário de contato","description":"Para quem ainda não tem conta. Cliente abre ticket em `POST /tickets`.","tags":["Contato"],"responses":{"201":{"description":"Criado"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","email","subject","message"],"properties":{"name":{"minLength":2,"maxLength":255,"type":"string"},"email":{"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]{2,}$","maxLength":255,"type":"string"},"phone":{"maxLength":40,"type":"string"},"subject":{"minLength":1,"maxLength":255,"type":"string"},"message":{"minLength":1,"maxLength":10000,"type":"string"}}}}}},"operationId":"postContact","security":[]}},"/oauth/authorization-request":{"post":{"summary":"Descreve um pedido de autorização OAuth","description":"Usada pelas telas de login e consentimento da Vixpi. Só aceita a query assinada que o `/oauth2/authorize` gera; não serve para integrações.","tags":["OAuth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["oauthQuery"],"properties":{"oauthQuery":{"minLength":1,"maxLength":8192,"type":"string"}}}}}},"operationId":"postOauthAuthorizationRequest","security":[],"responses":{"200":{"description":"Sucesso"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/orders":{"get":{"summary":"Lista os pedidos da conta","tags":["Pedidos"],"operationId":"getOrders","description":"Escopo: `billing:read`","security":[{"oauth2":["billing:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/invoices/{id}/pay/credit":{"post":{"summary":"Paga a fatura com o saldo de créditos","description":"Quita a fatura inteira; não há pagamento parcial. Saldo insuficiente responde 402 `INSUFFICIENT_CREDIT`.\n\nEscopo: `billing:write`","tags":["Faturas"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postInvoicesByIdPayCredit","security":[{"oauth2":["billing:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/invoices":{"get":{"summary":"Lista as faturas da conta","tags":["Faturas"],"operationId":"getInvoices","description":"Escopo: `billing:read`","security":[{"oauth2":["billing:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/invoices/{id}":{"get":{"summary":"Detalha uma fatura","tags":["Faturas"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getInvoicesById","description":"Escopo: `billing:read`","security":[{"oauth2":["billing:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/invoices/{id}/pdf":{"get":{"summary":"Baixa a fatura em PDF","tags":["Faturas"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getInvoicesByIdPdf","description":"Escopo: `billing:read`","security":[{"oauth2":["billing:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/invoices/{id}/status":{"get":{"summary":"Consulta só o estado da fatura","description":"Leitura leve, pensada para acompanhar o pagamento por Pix. Tem limite próprio de consultas por usuário.\n\nEscopo: `billing:read`","tags":["Faturas"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getInvoicesByIdStatus","security":[{"oauth2":["billing:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/credits":{"get":{"summary":"Saldo e histórico de créditos","tags":["Créditos"],"operationId":"getCredits","description":"Escopo: `billing:read`","security":[{"oauth2":["billing:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/profile":{"get":{"summary":"Lê o perfil de cobrança","description":"CPF/CNPJ, telefone e endereço. A resposta indica o que ainda falta para pagar com Pix ou cartão.\n\nEscopo: `account:read`","tags":["Conta"],"operationId":"getProfile","security":[{"oauth2":["account:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"put":{"summary":"Atualiza o perfil de cobrança","tags":["Conta"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"country":{"maxLength":2,"type":["string","null"]},"document":{"maxLength":32,"type":["string","null"]},"phone":{"maxLength":32,"type":["string","null"]},"addressLine1":{"maxLength":255,"type":["string","null"]},"addressNumber":{"maxLength":32,"type":["string","null"]},"addressLine2":{"maxLength":255,"type":["string","null"]},"addressDistrict":{"maxLength":255,"type":["string","null"]},"city":{"maxLength":255,"type":["string","null"]},"state":{"maxLength":32,"type":["string","null"]},"zipCode":{"maxLength":32,"type":["string","null"]}}}}}},"operationId":"putProfile","description":"Escopo: `account:write`","security":[{"oauth2":["account:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/profile/notifications":{"get":{"summary":"Lê as preferências de notificação","tags":["Conta"],"operationId":"getProfileNotifications","description":"Escopo: `account:read`","security":[{"oauth2":["account:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"put":{"summary":"Atualiza as preferências de notificação","tags":["Conta"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["changes"],"properties":{"changes":{"minItems":1,"maxItems":16,"type":"array","items":{"type":"object","required":["category","channel","enabled"],"properties":{"category":{"maxLength":40,"type":"string"},"channel":{"maxLength":40,"type":"string"},"enabled":{"type":"boolean"}}}}}}}}},"operationId":"putProfileNotifications","description":"Escopo: `account:write`","security":[{"oauth2":["account:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/notifications/unsubscribe":{"post":{"summary":"Cancela o recebimento de e-mails por link assinado","description":"Recebe o `token` do link de descadastro. Responde 204 mesmo para conta inexistente.","tags":["Notificações"],"responses":{"204":{"description":"Sem conteúdo"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"parameters":[{"name":"token","in":"query","required":true,"schema":{"minLength":1,"maxLength":1024,"type":"string"}}],"operationId":"postNotificationsUnsubscribe","security":[]}},"/geo/countries":{"get":{"summary":"Lista os países","tags":["Localização"],"operationId":"getGeoCountries","security":[],"responses":{"200":{"description":"Sucesso"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/geo/br/states":{"get":{"summary":"Lista os estados brasileiros","tags":["Localização"],"operationId":"getGeoBrStates","security":[],"responses":{"200":{"description":"Sucesso"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/geo/br/states/{uf}/cities":{"get":{"summary":"Lista as cidades de um estado","tags":["Localização"],"parameters":[{"name":"uf","in":"path","required":true,"schema":{"minLength":2,"maxLength":2,"type":"string"}}],"operationId":"getGeoBrStatesByUfCities","security":[],"responses":{"200":{"description":"Sucesso"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/services/{id}/upgrades/targets":{"get":{"summary":"Lista os planos para onde o serviço pode migrar","tags":["Serviços"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getServicesByIdUpgradesTargets","description":"Escopo: `services:read`","security":[{"oauth2":["services:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/services/{id}/upgrades":{"post":{"summary":"Pede a troca de plano do serviço","description":"Responde 204 quando o plano pedido é o atual.\n\nEscopo: `services:write`","tags":["Serviços"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["targetProductId","targetPlanId"],"properties":{"targetProductId":{"type":"string"},"targetPlanId":{"type":"string"},"configSelections":{"type":"array","items":{"type":"object","required":["optionId","itemId"],"properties":{"optionId":{"type":"string"},"itemId":{"type":"string"}}}}}}}}},"operationId":"postServicesByIdUpgrades","security":[{"oauth2":["services:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/services/{id}/upgrades/{upgradeId}":{"delete":{"summary":"Cancela um upgrade pendente","tags":["Serviços"],"responses":{"204":{"description":"Sem conteúdo"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"upgradeId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"deleteServicesByIdUpgradesByUpgradeId","description":"Escopo: `services:write`","security":[{"oauth2":["services:write"]},{"apiKey":[]}]}},"/services/{id}/cancel":{"get":{"summary":"Consulta o cancelamento em aberto","description":"Devolve `null` quando não há cancelamento agendado.\n\nEscopo: `services:read`","tags":["Serviços"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getServicesByIdCancel","security":[{"oauth2":["services:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"summary":"Pede o cancelamento do serviço","description":"No fim do ciclo (`end_of_billing_period`) ou na hora (`immediate`), sem reembolso automático.\n\nEscopo: `services:write`","tags":["Serviços"],"responses":{"201":{"description":"Criado"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["immediate","end_of_billing_period"]},"reason":{"minLength":3,"maxLength":500,"type":"string"}}}}}},"operationId":"postServicesByIdCancel","security":[{"oauth2":["services:write"]},{"apiKey":[]}]},"delete":{"summary":"Desfaz um cancelamento agendado","tags":["Serviços"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"deleteServicesByIdCancel","description":"Escopo: `services:write`","security":[{"oauth2":["services:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/services/{id}/vps":{"get":{"summary":"Lista as VPS do serviço com o estado ao vivo","tags":["VPS"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getServicesByIdVps","description":"Escopo: `vps:read`","security":[{"oauth2":["vps:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/services/{id}/vps/apps":{"get":{"summary":"Lista os apps instalados na VPS","description":"Inclui as credenciais do app quando a instalação termina.\n\nEscopo: `vps:read`","tags":["VPS"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getServicesByIdVpsApps","security":[{"oauth2":["vps:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/services/{id}/vps/{serverId}/traffic":{"get":{"summary":"Consumo de tráfego da VPS por mês","tags":["VPS"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"serverId","in":"path","required":true,"schema":{"anyOf":[{"format":"numeric","default":0,"type":"string"},{"type":"number"}]}}],"operationId":"getServicesByIdVpsByServerIdTraffic","description":"Escopo: `vps:read`","security":[{"oauth2":["vps:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/services/{id}/vps/{serverId}/templates":{"get":{"summary":"Lista os sistemas para reinstalar a VPS","tags":["VPS"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"serverId","in":"path","required":true,"schema":{"anyOf":[{"format":"numeric","default":0,"type":"string"},{"type":"number"}]}}],"operationId":"getServicesByIdVpsByServerIdTemplates","description":"Escopo: `vps:read`","security":[{"oauth2":["vps:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/services/{id}/vps/{serverId}/firewall":{"get":{"summary":"Estado do firewall da VPS","tags":["VPS"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"serverId","in":"path","required":true,"schema":{"anyOf":[{"format":"numeric","default":0,"type":"string"},{"type":"number"}]}}],"operationId":"getServicesByIdVpsByServerIdFirewall","description":"Escopo: `vps:read`","security":[{"oauth2":["vps:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"put":{"summary":"Liga ou desliga o firewall da VPS","tags":["VPS"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"serverId","in":"path","required":true,"schema":{"anyOf":[{"format":"numeric","default":0,"type":"string"},{"type":"number"}]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["enabled"],"properties":{"enabled":{"type":"boolean"}}}}}},"operationId":"putServicesByIdVpsByServerIdFirewall","description":"Escopo: `vps:write`","security":[{"oauth2":["vps:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/services/{id}/vps/{serverId}/backups":{"get":{"summary":"Lista os backups da VPS","tags":["VPS"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"serverId","in":"path","required":true,"schema":{"anyOf":[{"format":"numeric","default":0,"type":"string"},{"type":"number"}]}}],"operationId":"getServicesByIdVpsByServerIdBackups","description":"Escopo: `vps:read`","security":[{"oauth2":["vps:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/services/{id}/vps/{serverId}/vnc":{"get":{"summary":"Dados de acesso ao console VNC","description":"Exige `vps:write` mesmo sendo leitura: o console dá acesso à máquina.\n\nEscopo: `vps:write`","tags":["VPS"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"serverId","in":"path","required":true,"schema":{"anyOf":[{"format":"numeric","default":0,"type":"string"},{"type":"number"}]}}],"operationId":"getServicesByIdVpsByServerIdVnc","security":[{"oauth2":["vps:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"put":{"summary":"Liga ou desliga o console VNC","tags":["VPS"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"serverId","in":"path","required":true,"schema":{"anyOf":[{"format":"numeric","default":0,"type":"string"},{"type":"number"}]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["enabled"],"properties":{"enabled":{"type":"boolean"}}}}}},"operationId":"putServicesByIdVpsByServerIdVnc","description":"Escopo: `vps:write`","security":[{"oauth2":["vps:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/services/{id}/vps/{serverId}/metrics":{"get":{"summary":"Métricas históricas da VPS","description":"CPU, memória, disco e rede no período de `range`.\n\nEscopo: `vps:read`","tags":["VPS"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"serverId","in":"path","required":true,"schema":{"anyOf":[{"format":"numeric","default":0,"type":"string"},{"type":"number"}]}},{"name":"range","in":"query","required":false,"schema":{"type":"string","enum":["24h","7d","30d"]}}],"operationId":"getServicesByIdVpsByServerIdMetrics","security":[{"oauth2":["vps:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/services/{id}/vps/{serverId}/power":{"post":{"summary":"Liga, desliga ou reinicia a VPS","tags":["VPS"],"responses":{"202":{"description":"Aceito para processamento"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"serverId","in":"path","required":true,"schema":{"anyOf":[{"format":"numeric","default":0,"type":"string"},{"type":"number"}]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["boot","shutdown","restart","poweroff"]}}}}}},"operationId":"postServicesByIdVpsByServerIdPower","description":"Escopo: `vps:write`","security":[{"oauth2":["vps:write"]},{"apiKey":[]}]}},"/services/{id}/vps/{serverId}/password/reset":{"post":{"summary":"Redefine a senha root da VPS","description":"A nova senha vem na resposta e não é repetida.\n\nEscopo: `vps:write`","tags":["VPS"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"serverId","in":"path","required":true,"schema":{"anyOf":[{"format":"numeric","default":0,"type":"string"},{"type":"number"}]}}],"operationId":"postServicesByIdVpsByServerIdPasswordReset","security":[{"oauth2":["vps:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/services/{id}/vps/{serverId}/rebuild":{"post":{"summary":"Reinstala a VPS","description":"Apaga todos os dados da VPS. O corpo exige `confirmName`, o nome atual da VPS, como confirmação.\n\nEscopo: `vps:write`","tags":["VPS"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"serverId","in":"path","required":true,"schema":{"anyOf":[{"format":"numeric","default":0,"type":"string"},{"type":"number"}]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["osTemplateId","confirmName"],"properties":{"osTemplateId":{"minimum":1,"type":"number"},"confirmName":{"minLength":1,"maxLength":255,"type":"string"},"app":{"type":"object","required":["id","inputs"],"properties":{"id":{"minLength":1,"maxLength":64,"type":"string"},"inputs":{"type":"object","patternProperties":{"^(.*)$":{"maxLength":255,"type":"string"}}}}}}}}}},"operationId":"postServicesByIdVpsByServerIdRebuild","security":[{"oauth2":["vps:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/services/{id}/vps/{serverId}/name":{"patch":{"summary":"Renomeia a VPS","tags":["VPS"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"serverId","in":"path","required":true,"schema":{"anyOf":[{"format":"numeric","default":0,"type":"string"},{"type":"number"}]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9 ._-]*$","type":"string"}}}}}},"operationId":"patchServicesByIdVpsByServerIdName","description":"Escopo: `vps:write`","security":[{"oauth2":["vps:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/services":{"get":{"summary":"Lista os serviços da conta","tags":["Serviços"],"operationId":"getServices","description":"Escopo: `services:read`","security":[{"oauth2":["services:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/services/{id}/suspend":{"post":{"summary":"Suspende um serviço","tags":["Serviços"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postServicesByIdSuspend","description":"Escopo: `services:write`","security":[{"oauth2":["services:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/services/{id}/unsuspend":{"post":{"summary":"Reativa um serviço suspenso","tags":["Serviços"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postServicesByIdUnsuspend","description":"Escopo: `services:write`","security":[{"oauth2":["services:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/services/{id}/terminate":{"post":{"summary":"Encerra um serviço","description":"Exige a permissão de encerramento, que só a equipe da Vixpi tem. Cliente comum recebe 403; para cancelar o próprio serviço use `POST /services/{id}/cancel`.\n\nEscopo: `services:write`","tags":["Serviços"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postServicesByIdTerminate","security":[{"oauth2":["services:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/tickets":{"post":{"summary":"Abre um ticket","tags":["Tickets"],"responses":{"201":{"description":"Criado"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["subject","message"],"properties":{"subject":{"minLength":1,"maxLength":255,"type":"string"},"message":{"minLength":1,"maxLength":10000,"type":"string"},"department":{"type":"string","enum":["suporte","financeiro","comercial","abuso"]},"priority":{"type":"string","enum":["low","medium","high"]}}}}}},"operationId":"postTickets","description":"Escopo: `tickets:write`","security":[{"oauth2":["tickets:write"]},{"apiKey":[]}]},"get":{"summary":"Lista os tickets da conta","description":"Filtre pelo estado com `status`.\n\nEscopo: `tickets:read`","tags":["Tickets"],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","answered","customer_reply","closed"]}}],"operationId":"getTickets","security":[{"oauth2":["tickets:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/tickets/{id}":{"get":{"summary":"Detalha um ticket com as respostas","tags":["Tickets"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getTicketsById","description":"Escopo: `tickets:read`","security":[{"oauth2":["tickets:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/tickets/{id}/reply":{"post":{"summary":"Responde a um ticket","tags":["Tickets"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"minLength":1,"maxLength":10000,"type":"string"}}}}}},"operationId":"postTicketsByIdReply","description":"Escopo: `tickets:write`","security":[{"oauth2":["tickets:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/tickets/{id}/close":{"post":{"summary":"Fecha um ticket","tags":["Tickets"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postTicketsByIdClose","description":"Escopo: `tickets:write`","security":[{"oauth2":["tickets:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/tickets/{id}/reopen":{"post":{"summary":"Reabre um ticket","tags":["Tickets"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postTicketsByIdReopen","description":"Escopo: `tickets:write`","security":[{"oauth2":["tickets:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/affiliates/click":{"post":{"summary":"Registra um clique de afiliado","tags":["Afiliados"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["affiliateCode","cookieId"],"properties":{"affiliateCode":{"minLength":1,"type":"string"},"cookieId":{"minLength":1,"type":"string"},"referrerUrl":{"type":"string"},"landingUrl":{"type":"string"}}}}}},"operationId":"postAffiliatesClick","security":[],"responses":{"200":{"description":"Sucesso"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/affiliates/me":{"get":{"summary":"Dados do programa de afiliados da conta","description":"Responde 404 se a conta não é afiliada.\n\nEscopo: `account:read`","tags":["Afiliados"],"operationId":"getAffiliatesMe","security":[{"oauth2":["account:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/webhooks/pagarme":{"post":{"summary":"Recebe notificações do Pagar.me","description":"Uso exclusivo do Pagar.me, autenticado por HTTP Basic. Não é para integrações de clientes: os webhooks que a Vixpi envia a você são configurados no painel.","tags":["Webhooks recebidos"],"requestBody":{"content":{"text/plain":{"schema":{"type":"string"}}},"required":true},"operationId":"postWebhooksPagarme","security":[],"responses":{"200":{"description":"Sucesso"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/webhooks/vps-apps":{"post":{"summary":"Recebe o fim da instalação de um app na VPS","description":"Chamada pelo script de instalação dentro da VPS, com token de uso único. Não é para integrações de clientes.","tags":["Webhooks recebidos"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token","status"],"properties":{"token":{"pattern":"^[0-9a-f]{64}$","type":"string"},"status":{"type":"string","enum":["ready","failed"]},"message":{"maxLength":2000,"type":["string","null"]},"credentials":{"type":["object","null"],"patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}}}}}}},"operationId":"postWebhooksVpsApps","security":[],"responses":{"200":{"description":"Sucesso"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/components":{"get":{"summary":"Lista os componentes do projeto","tags":["Hospedagem"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdComponents","description":"Escopo: `hosting:read`","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"summary":"Cria um componente","tags":["Hospedagem"],"responses":{"201":{"description":"Criado"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postHostingByServiceIdComponents","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/components/{componentId}":{"delete":{"summary":"Remove um componente","tags":["Hospedagem"],"responses":{"204":{"description":"Sem conteúdo"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"componentId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"deleteHostingByServiceIdComponentsByComponentId","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]},"patch":{"summary":"Altera um componente","tags":["Hospedagem"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"componentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"memoryMb":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"cpuMilli":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"desiredState":{"type":"string","enum":["running","stopped"]},"runtime":{"type":["string","null"]},"runtimeVersion":{"type":["string","null"]},"port":{"anyOf":[{"minimum":1,"maximum":65535,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":65535,"type":"integer"}]},{"type":"null"}]},"command":{"type":["string","null"]},"schedule":{"type":["string","null"]}}}}}},"operationId":"patchHostingByServiceIdComponentsByComponentId","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/components/allocation":{"put":{"summary":"Redistribui os recursos entre os componentes","description":"Responde 202 com `operationId` quando há mudança no servidor e 204 quando nada muda.\n\nEscopo: `hosting:write`","tags":["Hospedagem"],"responses":{"202":{"description":"Aceito para processamento"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"putHostingByServiceIdComponentsAllocation","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/runtimes":{"get":{"summary":"Lista os runtimes disponíveis","tags":["Hospedagem"],"operationId":"getHostingRuntimes","description":"Escopo: `hosting:read`","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/account":{"get":{"summary":"Dados da conta de hospedagem","description":"Estado, limites, host técnico e nome curto.\n\nEscopo: `hosting:read`","tags":["Hospedagem"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdAccount","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/account/mode":{"put":{"summary":"Troca o modo da conta (`mounted` ou `built`)","tags":["Hospedagem"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["mode"],"properties":{"mode":{"type":"string","enum":["mounted","built"]}}}}}},"operationId":"putHostingByServiceIdAccountMode","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/operations/{operationId}":{"get":{"summary":"Consulta uma operação assíncrona","description":"Várias ações respondem 202 com um `operationId`; acompanhe o resultado aqui.\n\nEscopo: `hosting:read`","tags":["Hospedagem"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"operationId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdOperationsByOperationId","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/backups":{"get":{"summary":"Lista os backups da hospedagem","tags":["Hospedagem: backups"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdBackups","description":"Escopo: `hosting:read`","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"summary":"Cria um backup","tags":["Hospedagem: backups"],"responses":{"201":{"description":"Criado"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postHostingByServiceIdBackups","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/backups/{backupId}/download":{"get":{"summary":"Gera o link de download de um backup","description":"Exige `hosting:write`: o backup contém segredos do site, como `.env` e dump do banco. O link tem validade curta (`expiresIn`).\n\nEscopo: `hosting:write`","tags":["Hospedagem: backups"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"backupId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdBackupsByBackupIdDownload","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/backups/{backupId}/restore":{"post":{"summary":"Restaura um backup","description":"Operação assíncrona: responde 202 com o `operationId`.\n\nEscopo: `hosting:write`","tags":["Hospedagem: backups"],"responses":{"202":{"description":"Aceito para processamento"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"backupId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postHostingByServiceIdBackupsByBackupIdRestore","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/domains":{"get":{"summary":"Lista os domínios do projeto","tags":["Hospedagem: domínios"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdDomains","description":"Escopo: `hosting:read`","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"summary":"Adiciona um domínio","tags":["Hospedagem: domínios"],"responses":{"201":{"description":"Criado"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postHostingByServiceIdDomains","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/domains/{domainId}":{"patch":{"summary":"Altera um domínio","tags":["Hospedagem: domínios"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"domainId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"patchHostingByServiceIdDomainsByDomainId","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"delete":{"summary":"Remove um domínio","tags":["Hospedagem: domínios"],"responses":{"204":{"description":"Sem conteúdo"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"domainId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"deleteHostingByServiceIdDomainsByDomainId","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/git":{"get":{"summary":"Lê a fonte Git configurada","description":"Devolve a chave pública de deploy, nunca a privada.\n\nEscopo: `hosting:read`","tags":["Hospedagem: deploy"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdGit","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"summary":"Configura a fonte Git","description":"Gera a chave de deploy e o webhook. O `webhookSecret` aparece só na criação.\n\nEscopo: `hosting:write`","tags":["Hospedagem: deploy"],"responses":{"201":{"description":"Criado"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postHostingByServiceIdGit","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/git/webhook-secret":{"post":{"summary":"Gera um novo segredo de webhook","description":"O segredo novo aparece só nesta resposta; o anterior deixa de valer.\n\nEscopo: `hosting:write`","tags":["Hospedagem: deploy"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postHostingByServiceIdGitWebhookSecret","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/env":{"get":{"summary":"Lê as variáveis de ambiente","description":"Exige `hosting:write`: os valores são segredos do cliente.\n\nEscopo: `hosting:write`","tags":["Hospedagem"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdEnv","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"put":{"summary":"Substitui as variáveis de ambiente de um escopo","description":"Escopo `project` ou `component`. Responde 202 com `operationId`; o servidor aplica em seguida.\n\nEscopo: `hosting:write`","tags":["Hospedagem"],"responses":{"202":{"description":"Aceito para processamento"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["scope","vars"],"properties":{"scope":{"const":"project","type":"string"},"vars":{"type":"array","items":{"type":"object","required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}}}},{"type":"object","required":["scope","componentId","vars"],"properties":{"scope":{"const":"component","type":"string"},"componentId":{"minLength":1,"type":"string"},"vars":{"type":"array","items":{"type":"object","required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}}}}]}}}},"operationId":"putHostingByServiceIdEnv","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/hooks/{webhookId}":{"post":{"summary":"Recebe o webhook de push do GitHub ou GitLab","description":"Valida a assinatura do provedor, filtra pela branch configurada e enfileira o deploy. A URL e o segredo vêm de `POST /hosting/{serviceId}/git`.","tags":["Hospedagem: deploy"],"responses":{"202":{"description":"Aceito para processamento"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"parameters":[{"name":"webhookId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postHostingHooksByWebhookId","security":[]}},"/hosting/{serviceId}/deploy-tokens":{"post":{"summary":"Cria um token de deploy","description":"O valor do token (`vxdt_...`) aparece só nesta resposta.\n\nEscopo: `hosting:write`","tags":["Hospedagem: deploy"],"responses":{"201":{"description":"Criado"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postHostingByServiceIdDeployTokens","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]},"get":{"summary":"Lista os tokens de deploy","tags":["Hospedagem: deploy"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdDeployTokens","description":"Escopo: `hosting:read`","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/deploy-tokens/{tokenId}":{"delete":{"summary":"Revoga um token de deploy","tags":["Hospedagem: deploy"],"responses":{"204":{"description":"Sem conteúdo"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"tokenId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"deleteHostingByServiceIdDeployTokensByTokenId","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/sftp":{"get":{"summary":"Estado do acesso SFTP","tags":["Hospedagem"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdSftp","description":"Escopo: `hosting:read`","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"put":{"summary":"Ativa o SFTP ou atualiza as chaves","tags":["Hospedagem"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["publicKeys"],"properties":{"publicKeys":{"type":"array","items":{"type":"string"}}}}}}},"operationId":"putHostingByServiceIdSftp","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"delete":{"summary":"Desativa o SFTP","tags":["Hospedagem"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"deleteHostingByServiceIdSftp","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/sftp/password":{"post":{"summary":"Troca a senha do SFTP","description":"A senha nunca é guardada nem devolvida em texto puro.\n\nEscopo: `hosting:write`","tags":["Hospedagem"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["password"],"properties":{"password":{"minLength":8,"maxLength":128,"type":"string"}}}}}},"operationId":"postHostingByServiceIdSftpPassword","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/deploy":{"post":{"summary":"Dispara um deploy com token de deploy","description":"Autentica com um token de deploy `vxdt_...` no header `Authorization: Bearer`, não com OAuth nem chave `vxp_`. Feita para pipelines de CI.","tags":["Hospedagem: deploy"],"responses":{"202":{"description":"Aceito para processamento"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"operationId":"postHostingDeploy","security":[]}},"/hosting/{serviceId}/deployments":{"get":{"summary":"Lista os deploys","tags":["Hospedagem: deploy"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdDeployments","description":"Escopo: `hosting:read`","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"summary":"Dispara um deploy da fonte Git configurada","tags":["Hospedagem: deploy"],"responses":{"202":{"description":"Aceito para processamento"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postHostingByServiceIdDeployments","description":"Escopo: `hosting:deploy`","security":[{"oauth2":["hosting:deploy"]},{"apiKey":[]}]}},"/hosting/{serviceId}/deployments/{deploymentId}":{"get":{"summary":"Detalha um deploy","tags":["Hospedagem: deploy"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"deploymentId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdDeploymentsByDeploymentId","description":"Escopo: `hosting:read`","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/deployments/{deploymentId}/rollback":{"post":{"summary":"Volta para um deploy anterior","tags":["Hospedagem: deploy"],"responses":{"202":{"description":"Aceito para processamento"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"deploymentId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postHostingByServiceIdDeploymentsByDeploymentIdRollback","description":"Escopo: `hosting:deploy`","security":[{"oauth2":["hosting:deploy"]},{"apiKey":[]}]}},"/hosting/{serviceId}/deployments/{deploymentId}/cancel":{"post":{"summary":"Cancela um deploy em andamento","description":"Responde 200 quando cancelou na hora e 202 quando o cancelamento ainda está em curso.\n\nEscopo: `hosting:deploy`","tags":["Hospedagem: deploy"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"deploymentId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postHostingByServiceIdDeploymentsByDeploymentIdCancel","security":[{"oauth2":["hosting:deploy"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/files":{"get":{"summary":"Lista um diretório","description":"Informe o caminho em `path`.\n\nEscopo: `hosting:read`","tags":["Hospedagem: arquivos"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdFiles","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/files/stat":{"get":{"summary":"Metadados de um arquivo","tags":["Hospedagem: arquivos"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdFilesStat","description":"Escopo: `hosting:read`","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/files/read":{"get":{"summary":"Lê o conteúdo de um arquivo","description":"Exige `hosting:write`: arquivos do site podem conter segredos.\n\nEscopo: `hosting:write`","tags":["Hospedagem: arquivos"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdFilesRead","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/files/download":{"get":{"summary":"Baixa um arquivo","description":"Resposta binária (`application/octet-stream`). Exige `hosting:write`.\n\nEscopo: `hosting:write`","tags":["Hospedagem: arquivos"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdFilesDownload","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/files/upload/status":{"get":{"summary":"Quanto de um upload já foi gravado","description":"Use `uploadId` para retomar um upload interrompido a partir do `offset`.\n\nEscopo: `hosting:read`","tags":["Hospedagem: arquivos"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdFilesUploadStatus","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/files/write":{"put":{"summary":"Grava um arquivo","description":"Confere o `mtime` para evitar sobrescrever uma alteração mais nova.\n\nEscopo: `hosting:write`","tags":["Hospedagem: arquivos"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["path","content"],"properties":{"path":{"minLength":1,"type":"string"},"content":{"type":"string"},"encoding":{"type":"string","enum":["utf-8","base64"]},"expectedMtimeMs":{"type":["number","null"]}}}}}},"operationId":"putHostingByServiceIdFilesWrite","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/files/mkdir":{"post":{"summary":"Cria um diretório","tags":["Hospedagem: arquivos"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["path"],"properties":{"path":{"minLength":1,"type":"string"}}}}}},"operationId":"postHostingByServiceIdFilesMkdir","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/files/rename":{"post":{"summary":"Renomeia ou move um arquivo","tags":["Hospedagem: arquivos"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["source","dest"],"properties":{"source":{"minLength":1,"type":"string"},"dest":{"minLength":1,"type":"string"}}}}}},"operationId":"postHostingByServiceIdFilesRename","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/files/copy":{"post":{"summary":"Copia um arquivo ou diretório","tags":["Hospedagem: arquivos"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["source","dest"],"properties":{"source":{"minLength":1,"type":"string"},"dest":{"minLength":1,"type":"string"}}}}}},"operationId":"postHostingByServiceIdFilesCopy","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/files/delete":{"post":{"summary":"Apaga um arquivo ou diretório","tags":["Hospedagem: arquivos"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["path"],"properties":{"path":{"minLength":1,"type":"string"},"recursive":{"type":"boolean"}}}}}},"operationId":"postHostingByServiceIdFilesDelete","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/files/chmod":{"post":{"summary":"Altera as permissões de um arquivo","tags":["Hospedagem: arquivos"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["path","mode"],"properties":{"path":{"minLength":1,"type":"string"},"mode":{"pattern":"^[0-7]{3,4}$","type":"string"}}}}}},"operationId":"postHostingByServiceIdFilesChmod","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/files/extract":{"post":{"summary":"Descompacta um arquivo","tags":["Hospedagem: arquivos"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["archivePath","destPath"],"properties":{"archivePath":{"minLength":1,"type":"string"},"destPath":{"minLength":1,"type":"string"}}}}}},"operationId":"postHostingByServiceIdFilesExtract","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/files/compress":{"post":{"summary":"Compacta arquivos","tags":["Hospedagem: arquivos"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["paths","destPath","format"],"properties":{"paths":{"minItems":1,"type":"array","items":{"minLength":1,"type":"string"}},"destPath":{"minLength":1,"type":"string"},"format":{"type":"string","enum":["zip","tar.gz","tar.zst"]}}}}}},"operationId":"postHostingByServiceIdFilesCompress","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/files/upload":{"post":{"summary":"Envia um arquivo","description":"Corpo binário em fluxo. Com `uploadId`, `offset` e `total` o envio pode ser retomado.\n\nEscopo: `hosting:write`","tags":["Hospedagem: arquivos"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postHostingByServiceIdFilesUpload","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/metrics":{"get":{"summary":"Métricas de CPU e memória por componente","description":"Séries por minuto no período de `range`: `1h`, `6h`, `24h` (padrão) ou `7d`.\n\nEscopo: `hosting:read`","tags":["Hospedagem"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdMetrics","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/access-logs/domains":{"get":{"summary":"Lista os domínios com log de acesso","tags":["Hospedagem"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdAccessLogsDomains","description":"Escopo: `hosting:read`","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/access-logs/stream":{"get":{"summary":"Acompanha o log de acesso HTTP ao vivo","description":"Resposta em fluxo de texto (`text/plain`) que fica aberta.\n\nEscopo: `hosting:read`","tags":["Hospedagem"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdAccessLogsStream","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/deployments/{deploymentId}/log/stream":{"get":{"summary":"Acompanha o log de build ao vivo","description":"Resposta em fluxo de texto (`text/plain`) que fica aberta até o deploy terminar.\n\nEscopo: `hosting:read`","tags":["Hospedagem: deploy"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"deploymentId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdDeploymentsByDeploymentIdLogStream","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/hosting/{serviceId}/deployments/{deploymentId}/log":{"get":{"summary":"Baixa o log de build de um deploy","description":"Texto simples (`text/plain`).\n\nEscopo: `hosting:read`","tags":["Hospedagem: deploy"],"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"deploymentId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdDeploymentsByDeploymentIdLog","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}],"responses":{"200":{"description":"Sucesso"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}}},"components":{"schemas":{"Error":{"type":"object","description":"Formato de todo erro da API.","required":["error","code","message"],"properties":{"error":{"type":"string","description":"Igual a `code`; mantido por compatibilidade."},"code":{"type":"string","description":"Código estável para tratar no seu código."},"message":{"type":"string","description":"Texto em português para mostrar a uma pessoa."},"details":{"description":"Detalhes extras, quando existirem (ex.: campos inválidos)."}}}},"responses":{"Unauthorized":{"description":"Token ausente, inválido, expirado ou revogado.","headers":{"WWW-Authenticate":{"description":"Desafio RFC 6750, ex.: `Bearer error=\"invalid_token\"`.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INVALID_TOKEN","code":"INVALID_TOKEN","message":"Token inválido."}}}},"Forbidden":{"description":"O token não tem o escopo exigido, ou a conta não pode fazer a ação.","headers":{"WWW-Authenticate":{"description":"Em `INSUFFICIENT_SCOPE`, lista o escopo que faltou em `scope`.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INSUFFICIENT_SCOPE","code":"INSUFFICIENT_SCOPE","message":"O token não tem o escopo necessário."}}}},"NotFound":{"description":"O recurso não existe ou não pertence à sua conta.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"NOT_FOUND","code":"NOT_FOUND","message":"Recurso não encontrado."}}}},"TooManyRequests":{"description":"Limite de requisições excedido (por token, 60 por minuto).","headers":{"Retry-After":{"description":"Segundos até poder tentar de novo.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"RATE_LIMITED","code":"RATE_LIMITED","message":"Limite de requisições excedido."}}}}},"securitySchemes":{"oauth2":{"type":"oauth2","description":"OAuth 2.1 com `authorization_code` e PKCE (`S256` obrigatório). Informe também `resource` com a URL da API no pedido de autorização. Os endpoints também estão no discovery do emissor.","flows":{"authorizationCode":{"authorizationUrl":"https://auth.vixpi.host/oauth2/authorize","tokenUrl":"https://auth.vixpi.host/oauth2/token","refreshUrl":"https://auth.vixpi.host/oauth2/token","scopes":{"openid":"Saber quem você é","profile":"Ver seu nome","email":"Ver seu endereço de e-mail","offline_access":"Continuar com acesso quando você não estiver usando","account:read":"Ver seu perfil, endereço e dados da empresa","account:write":"Alterar seu perfil, endereço e dados da empresa","services:read":"Ver seus serviços","services:write":"Fazer upgrade e cancelar seus serviços","billing:read":"Ver suas faturas e seu saldo de crédito","billing:write":"Pagar faturas com seu saldo de crédito","tickets:read":"Ver seus tickets de suporte","tickets:write":"Abrir e responder tickets de suporte","hosting:read":"Ver suas hospedagens","hosting:write":"Alterar suas hospedagens","hosting:deploy":"Publicar novas versões dos seus sites","vps:read":"Ver suas VPS","vps:write":"Ligar, desligar e reinstalar suas VPS","domains:read":"Ver seus domínios e DNS","domains:write":"Alterar seus domínios e DNS","email:read":"Ver seus domínios e caixas de e-mail","email:write":"Criar, alterar e apagar caixas de e-mail","marketing:read":"Ver suas campanhas de e-mail marketing","marketing:write":"Criar e enviar campanhas de e-mail marketing"}}}},"apiKey":{"type":"http","scheme":"bearer","description":"Chave pessoal `vxp_...`, criada em Painel > Desenvolvedor > Chaves. Vale os escopos escolhidos na criação. Envie em `Authorization: Bearer vxp_...`."}}}}