{"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, domínios e tickets. Autentique com uma chave pessoal `vxp_...` ou com OAuth 2.1. Cada operação indica o escopo que exige.\n\n**Limite de uso.** Cada token pode fazer 60 requisições por minuto; sem token, o limite é de 600 requisições por minuto por IP. Toda resposta contada traz `RateLimit-Limit`, `RateLimit-Remaining` e `RateLimit-Reset` (segundos até a janela virar); com token, os valores são os do token. Acima do limite a API responde `429` com `Retry-After`.\n\n**Erros.** Todo erro vem em JSON com `error`, `code` e `message` (`application/json`). Parâmetro ou corpo fora do esquema: `422 VALIDATION_ERROR`, com a lista de campos em `details`. Falha inesperada: `500 INTERNAL_SERVER_ERROR`.\n\n**Idempotência.** As escritas marcadas com o parâmetro `Idempotency-Key` aceitam uma chave única (um UUID serve) para repetir a chamada com segurança: a repetição devolve a mesma resposta, com `Idempotent-Replayed: true`, por 24 horas.\n\n**Versões e descontinuação.** A versão vai na URL (`/api/v1`). Mudança incompatível só sai numa versão nova; dentro da v1 só entram acréscimos. Antes de sair do ar, uma operação passa a responder com o cabeçalho `Deprecation` (RFC 9745), com `Sunset` (RFC 8594) trazendo a data da remoção e com `Link: <https://vixpi.host/developers/changelog>; rel=\"deprecation\"`. Toda descontinuação também é anunciada no changelog: https://vixpi.host/developers/changelog.","termsOfService":"https://vixpi.host/termos","contact":{"name":"Vixpi","url":"https://vixpi.host/contato","email":"contato@vixpi.host"}},"externalDocs":{"description":"Documentação para desenvolvedores","url":"https://vixpi.host/developers"},"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: endpoints"},{"name":"Hospedagem: backups"},{"name":"Hospedagem: arquivos"},{"name":"Domínios"},{"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"},{"name":"Ajuda"},{"name":"Analytics"},{"name":"Auth"},{"name":"Campanhas"},{"name":"E-mail"},{"name":"Hospedagem: apps"},{"name":"Hospedagem: bancos"},{"name":"Marketing"},{"name":"SEO"}],"paths":{"/openapi.json":{"get":{"summary":"Esta especificação OpenAPI","description":"Pública, sem autenticação. Devolve este documento OpenAPI 3.1 com todas as operações que um token pode chamar, seus escopos e os esquemas de resposta.","tags":["Documentação"],"operationId":"getOpenapiJson","security":[],"responses":{"200":{"description":"Sucesso"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}}}},"/me":{"get":{"summary":"Dados da conta autenticada","description":"Devolve o usuário dono do token: id, nome, e-mail e situação da conta.\n\nEscopo: `account:read`","tags":["Conta"],"responses":{"200":{"description":"Usuário autenticado.","content":{"application/json":{"schema":{"type":"object","required":["user"],"properties":{"user":{"additionalProperties":true,"type":"object","required":["id","name","email","emailVerified","createdAt","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"email":{"format":"email","type":"string"},"emailVerified":{"type":"boolean"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"twoFactorEnabled":{"type":"boolean"},"active":{"description":"`false` quando a conta está bloqueada.","type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"getMe","security":[{"oauth2":["account:read"]},{"apiKey":[]}]}},"/catalog/categories":{"get":{"summary":"Lista as categorias de produto","description":"Pública, sem autenticação. Devolve as categorias da vitrine; filtre as subcategorias com `parentCategoryId`.","tags":["Catálogo"],"responses":{"200":{"description":"Categorias.","content":{"application/json":{"schema":{"type":"object","required":["categories"],"properties":{"categories":{"type":"array","items":{"type":"object","required":["id","name","slug","parentCategoryId","active","createdAt","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"parentCategoryId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"active":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}}}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"parentCategoryId","in":"query","required":false,"schema":{"type":"string"}}],"operationId":"getCatalogCategories","security":[]}},"/catalog/products":{"get":{"summary":"Lista os produtos ativos","description":"Pública, sem autenticação. Devolve os produtos ativos com o menor preço de cada um, paginados. Filtre por `categoryId` e pagine com `page` e `pageSize`.","tags":["Catálogo"],"responses":{"200":{"description":"Página de produtos.","content":{"application/json":{"schema":{"type":"object","required":["items","total","page","pageSize","totalPages"],"properties":{"items":{"type":"array","items":{"type":"object","required":["id","categoryId","name","slug","description","active","availability","moduleName","minPriceCents"],"properties":{"id":{"format":"uuid","type":"string"},"categoryId":{"format":"uuid","type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"active":{"type":"boolean"},"availability":{"enum":["available","coming_soon","out_of_stock"],"description":"`coming_soon` e `out_of_stock` aparecem, mas não podem ser comprados.","type":"string"},"moduleName":{"type":"string"},"minPriceCents":{"anyOf":[{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},{"type":"null"}]}}}},"total":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"page":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"pageSize":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"totalPages":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":[]}},"/catalog/products/{slug}":{"get":{"summary":"Detalha um produto pelo slug","description":"Pública, sem autenticação. Devolve o produto com seus planos, preços por ciclo e opções configuráveis.","tags":["Catálogo"],"responses":{"200":{"description":"Produto com planos e preços.","content":{"application/json":{"schema":{"type":"object","required":["product","plans","configOptions"],"properties":{"product":{"type":"object","required":["id","categoryId","name","slug","description","active","availability","moduleName","createdAt","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"categoryId":{"format":"uuid","type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"active":{"type":"boolean"},"availability":{"enum":["available","coming_soon","out_of_stock"],"type":"string"},"moduleName":{"enum":["virtfusion","hosting","mailcow","mail","domain_registrar","none"],"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}},"plans":{"type":"array","items":{"type":"object","required":["plan","prices"],"properties":{"plan":{"type":"object","required":["id","productId","name","slug","specs","hostingLimits","active","createdAt","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"productId":{"format":"uuid","type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"specs":{"description":"Especificações do plano (RAM, vCPU, disco...), por chave.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"hostingLimits":{"anyOf":[{"additionalProperties":true,"type":"object","required":["memoryMb","cpuMilli","diskMb","maxApps","maxDatabases","redis","maxDomains","maxWorkers","buildMinutesPerMonth","backupRetentionDays","egressSmtp"],"properties":{"memoryMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"cpuMilli":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"diskMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"maxApps":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"maxDatabases":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"redis":{"type":"boolean"},"maxDomains":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"maxWorkers":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"buildMinutesPerMonth":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"backupRetentionDays":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"egressSmtp":{"type":"boolean"},"kind":{"enum":["site","database","bot"],"type":"string"},"trialDays":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"trialEngines":{"type":"array","items":{"type":"string"}},"extraRuntimes":{"type":"array","items":{"type":"string"}}}},{"type":"null"}]},"active":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}},"prices":{"type":"array","items":{"type":"object","required":["id","planId","currency","amount","setupFee","renewalPrice","billingCycle","createdAt","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"planId":{"format":"uuid","type":"string"},"currency":{"type":"object","required":["code"],"properties":{"code":{"type":"string"}}},"amount":{"description":"Valor monetário.","type":"object","required":["amountCents","currency"],"properties":{"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"currency":{"description":"Moeda ISO 4217, ex.: `BRL`.","type":"string"}}},"setupFee":{"description":"Valor monetário.","type":"object","required":["amountCents","currency"],"properties":{"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"currency":{"description":"Moeda ISO 4217, ex.: `BRL`.","type":"string"}}},"renewalPrice":{"description":"Valor monetário.","type":"object","required":["amountCents","currency"],"properties":{"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"currency":{"description":"Moeda ISO 4217, ex.: `BRL`.","type":"string"}}},"billingCycle":{"enum":["monthly","quarterly","semi_annually","annually","biennially","triennially"],"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}}}},"configOptions":{"type":"array","items":{"type":"object","required":["id","name","type","required","moduleKey","items"],"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"type":{"enum":["dropdown","radio","checkbox"],"type":"string"},"required":{"type":"boolean"},"moduleKey":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","required":["id","name","slug","moduleValue","prices"],"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"moduleValue":{"anyOf":[{"type":"string"},{"type":"null"}]},"prices":{"type":"array","items":{"type":"object","required":["currency","billingCycle","priceCents","setupFeeCents"],"properties":{"currency":{"type":"string"},"billingCycle":{"enum":["monthly","quarterly","semi_annually","annually","biennially","triennially"],"type":"string"},"priceCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"setupFeeCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"}}}}}}}}}}}}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getCatalogProductsBySlug","security":[]}},"/catalog/vps-apps":{"get":{"summary":"Lista os apps instaláveis numa VPS","description":"Pública, sem autenticação. Devolve os apps que a Vixpi instala numa VPS nova, com recursos mínimos, sistemas compatíveis e os campos que o pedido precisa informar.","tags":["Catálogo"],"responses":{"200":{"description":"Apps instaláveis.","content":{"application/json":{"schema":{"type":"object","required":["apps"],"properties":{"apps":{"type":"array","items":{"type":"object","required":["id","name","description","icon","category","minResources","compatibleOs","exclusive","estimatedInstallSeconds","inputs"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"icon":{"type":"string"},"category":{"type":"string"},"minResources":{"type":"object","required":["ramMb","diskGb","cpu"],"properties":{"ramMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"diskGb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"cpu":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},"compatibleOs":{"type":"array","items":{"type":"string"}},"exclusive":{"type":"boolean"},"estimatedInstallSeconds":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"inputs":{"type":"array","items":{"type":"object","required":["key","label","placeholder","help","kind"],"properties":{"key":{"type":"string"},"label":{"type":"string"},"placeholder":{"type":"string"},"help":{"type":"string"},"kind":{"enum":["domain","email","username"],"type":"string"}}}}}}}}}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"getCatalogVpsApps","security":[]}},"/catalog/plans/{planId}/os-templates":{"get":{"summary":"Lista os sistemas operacionais de um plano de VPS","description":"Pública, sem autenticação. Devolve os sistemas operacionais disponíveis para o plano, agrupados por distribuição. Plano inexistente ou que não é de VPS devolve `groups` vazio.","tags":["Catálogo"],"responses":{"200":{"description":"Sistemas por distribuição.","content":{"application/json":{"schema":{"type":"object","required":["groups"],"properties":{"groups":{"type":"array","items":{"type":"object","required":["name","icon","templates"],"properties":{"name":{"type":"string"},"icon":{"type":"string"},"templates":{"type":"array","items":{"type":"object","required":["id","name","version","variant","icon","type","label"],"properties":{"id":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"name":{"type":"string"},"version":{"type":"string"},"variant":{"type":"string"},"icon":{"type":"string"},"type":{"type":"string"},"label":{"type":"string"}}}}}}}}}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"planId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getCatalogPlansByPlanIdOsTemplates","security":[]}},"/catalog/plans/{planId}/regions":{"get":{"summary":"Lista as regiões de um plano e se há estoque em cada uma","description":"Pública, sem autenticação. Região sem nó com capacidade para o plano sai com `available: false` (CONTRACTS §11.11).","tags":["Catálogo"],"responses":{"200":{"description":"Estoque por região.","content":{"application/json":{"schema":{"type":"object","required":["regions"],"properties":{"regions":{"type":"array","items":{"type":"object","required":["region","itemId","available"],"properties":{"region":{"type":"string"},"itemId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"available":{"type":"boolean"}}}}}}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"planId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"operationId":"getCatalogPlansByPlanIdRegions","security":[]}},"/token":{"get":{"summary":"Quem é o chamador do token","description":"Devolve a conta, o tipo de credencial (`oauth` ou `api_key`), o app (`clientId`), os escopos e quando o token vence. Aceita qualquer token válido. Nome e e-mail só vêm com o escopo `account:read`.\n\nEscopo: nenhum (qualquer token válido)","tags":["Conta"],"responses":{"200":{"description":"Credencial do chamador.","content":{"application/json":{"schema":{"type":"object","required":["via","clientId","scopes","expiresAt","user"],"properties":{"via":{"enum":["session","oauth","api_key"],"description":"Como a chamada se autenticou.","type":"string"},"clientId":{"anyOf":[{"description":"App OAuth; `null` para chave pessoal e sessão.","type":"string"},{"type":"null"}]},"scopes":{"anyOf":[{"description":"Escopos do token, em ordem; `null` na sessão do painel.","type":"array","items":{"type":"string"}},{"type":"null"}]},"expiresAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"user":{"type":"object","required":["id","name","email"],"properties":{"id":{"format":"uuid","type":"string"},"name":{"anyOf":[{"description":"Só com o escopo `account:read`.","type":"string"},{"type":"null"}]},"email":{"anyOf":[{"description":"Só com o escopo `account:read`.","type":"string"},{"type":"null"}]}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"getToken","security":[{"oauth2":[]},{"apiKey":[]}]}},"/domains":{"get":{"summary":"Lista os domínios da conta","description":"Domínios registrados ou transferidos para a Vixpi, do que vence primeiro ao último. Traz situação, renovação automática e vencimento.\n\nEscopo: `domains:read`","tags":["Domínios"],"responses":{"200":{"description":"Domínios da conta.","content":{"application/json":{"schema":{"type":"object","required":["domains"],"properties":{"domains":{"type":"array","items":{"type":"object","required":["id","domainName","status","autoRenew","serviceId","registeredAt","expiresAt"],"properties":{"id":{"format":"uuid","type":"string"},"domainName":{"type":"string"},"status":{"enum":["pending_registration","active","expired","pending_transfer","transferred_away","cancelled"],"type":"string"},"autoRenew":{"type":"boolean"},"serviceId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"registeredAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"getDomains","security":[{"oauth2":["domains:read"]},{"apiKey":[]}]}},"/domains/nameservers":{"get":{"summary":"Servidores de nome dos domínios da conta","description":"Consulta agora, em DNS público, os servidores de nome (NS) de até 50 domínios separados por vírgula. Só responde domínios da conta; os outros são omitidos. `status`: `ok`, `none` (o domínio não publica NS) ou `unknown` (o DNS não respondeu).\n\nEscopo: `domains:read`","tags":["Domínios"],"responses":{"200":{"description":"NS de cada domínio da conta.","content":{"application/json":{"schema":{"type":"object","required":["nameservers"],"properties":{"nameservers":{"type":"array","items":{"type":"object","required":["domain","status","nameservers"],"properties":{"domain":{"type":"string"},"status":{"enum":["ok","none","unknown"],"type":"string"},"nameservers":{"description":"Minúsculos, sem ponto final, em ordem.","type":"array","items":{"type":"string"}}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"names","in":"query","required":true,"schema":{"maxLength":4000,"type":"string"}}],"operationId":"getDomainsNameservers","security":[{"oauth2":["domains:read"]},{"apiKey":[]}]}},"/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":"Mensagem recebida.","content":{"application/json":{"schema":{"type":"object","required":["id","status"],"properties":{"id":{"format":"uuid","type":"string"},"status":{"enum":["new","read","replied","archived"],"type":"string"}}}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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"],"responses":{"200":{"description":"App e escopos pedidos.","content":{"application/json":{"schema":{"type":"object","required":["client","scopes","redirectHost"],"properties":{"client":{"type":"object","required":["clientId","name","uri","icon","tos","policy","ownerKind","verified"],"properties":{"clientId":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"uri":{"anyOf":[{"type":"string"},{"type":"null"}]},"icon":{"anyOf":[{"type":"string"},{"type":"null"}]},"tos":{"anyOf":[{"type":"string"},{"type":"null"}]},"policy":{"anyOf":[{"type":"string"},{"type":"null"}]},"ownerKind":{"enum":["first_party","partner","customer"],"type":"string"},"verified":{"type":"boolean"}}},"scopes":{"type":"array","items":{"type":"object","required":["scope","label","sensitive"],"properties":{"scope":{"type":"string"},"label":{"description":"Rótulo em pt-BR.","type":"string"},"sensitive":{"type":"boolean"}}}},"redirectHost":{"anyOf":[{"type":"string"},{"type":"null"}]},"staffAccess":{"const":true,"type":"boolean"}}}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["oauthQuery"],"properties":{"oauthQuery":{"minLength":1,"maxLength":8192,"type":"string"}}}}}},"operationId":"postOauthAuthorizationRequest","security":[]}},"/orders":{"get":{"summary":"Lista os pedidos da conta","tags":["Pedidos"],"responses":{"200":{"description":"Pedidos com os itens.","content":{"application/json":{"schema":{"type":"object","required":["orders"],"properties":{"orders":{"type":"array","items":{"type":"object","required":["id","userId","status","items","invoiceId","couponId","discount","checkoutKey","createdAt","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"userId":{"format":"uuid","type":"string"},"status":{"enum":["pending","processing","completed","cancelled"],"type":"string"},"items":{"type":"array","items":{"additionalProperties":true,"type":"object","required":["id","orderId","productId","planId","description","unitPriceSnapshot","setupFee","quantity","billingCycle","options","domain","vps","trialDays","createdAt"],"properties":{"id":{"format":"uuid","type":"string"},"orderId":{"format":"uuid","type":"string"},"productId":{"format":"uuid","type":"string"},"planId":{"format":"uuid","type":"string"},"description":{"type":"string"},"unitPriceSnapshot":{"description":"Valor monetário.","type":"object","required":["amountCents","currency"],"properties":{"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"currency":{"description":"Moeda ISO 4217, ex.: `BRL`.","type":"string"}}},"setupFee":{"description":"Valor monetário.","type":"object","required":["amountCents","currency"],"properties":{"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"currency":{"description":"Moeda ISO 4217, ex.: `BRL`.","type":"string"}}},"quantity":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"billingCycle":{"type":"string"},"options":{"type":"array","items":{"type":"object","required":["optionId","itemId","optionName","itemName","priceCents","setupFeeCents","moduleKey","moduleValue"],"properties":{"optionId":{"format":"uuid","type":"string"},"itemId":{"format":"uuid","type":"string"},"optionName":{"type":"string"},"itemName":{"type":"string"},"priceCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"setupFeeCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"moduleKey":{"anyOf":[{"type":"string"},{"type":"null"}]},"moduleValue":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"domain":{"anyOf":[{"type":"string"},{"type":"null"}]},"vps":{"anyOf":[{"additionalProperties":true,"type":"object","required":["osTemplateId","osLabel","hostname","serverName","app"],"properties":{"osTemplateId":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"osLabel":{"anyOf":[{"type":"string"},{"type":"null"}]},"hostname":{"anyOf":[{"type":"string"},{"type":"null"}]},"serverName":{"anyOf":[{"type":"string"},{"type":"null"}]},"app":{"anyOf":[{"type":"object","required":["id","inputs"],"properties":{"id":{"type":"string"},"inputs":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}},{"type":"null"}]}}},{"type":"null"}]},"trialDays":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"}}}},"invoiceId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"couponId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"discount":{"anyOf":[{"description":"Valor monetário.","type":"object","required":["amountCents","currency"],"properties":{"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"currency":{"description":"Moeda ISO 4217, ex.: `BRL`.","type":"string"}}},{"type":"null"}]},"checkoutKey":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"getOrders","description":"Escopo: `billing:read`","security":[{"oauth2":["billing:read"]},{"apiKey":[]}]}},"/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"],"responses":{"200":{"description":"Fatura paga, transação e saldo restante.","content":{"application/json":{"schema":{"type":"object","required":["invoice","transaction","debitedCents","balanceCents"],"properties":{"invoice":{"type":"object","required":["id","number","userId","orderId","status","items","subtotal","discount","tax","paidAmount","refundedAmount","dueDate","createdAt","updatedAt","paidAt","billingSnapshot"],"properties":{"id":{"format":"uuid","type":"string"},"number":{"type":"string"},"userId":{"format":"uuid","type":"string"},"orderId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"status":{"enum":["draft","pending","overdue","paid","cancelled","partially_refunded","refunded"],"type":"string"},"items":{"type":"array","items":{"type":"object","required":["description","amount","quantity","serviceId"],"properties":{"description":{"type":"string"},"amount":{"description":"Valor monetário.","type":"object","required":["amountCents","currency"],"properties":{"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"currency":{"description":"Moeda ISO 4217, ex.: `BRL`.","type":"string"}}},"quantity":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"serviceId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"period":{"type":"object","required":["start","end"],"properties":{"start":{"format":"date-time","type":"string"},"end":{"format":"date-time","type":"string"}}}}}},"subtotal":{"description":"Valor monetário.","type":"object","required":["amountCents","currency"],"properties":{"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"currency":{"description":"Moeda ISO 4217, ex.: `BRL`.","type":"string"}}},"discount":{"description":"Valor monetário.","type":"object","required":["amountCents","currency"],"properties":{"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"currency":{"description":"Moeda ISO 4217, ex.: `BRL`.","type":"string"}}},"tax":{"description":"Valor monetário.","type":"object","required":["amountCents","currency"],"properties":{"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"currency":{"description":"Moeda ISO 4217, ex.: `BRL`.","type":"string"}}},"paidAmount":{"description":"Valor monetário.","type":"object","required":["amountCents","currency"],"properties":{"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"currency":{"description":"Moeda ISO 4217, ex.: `BRL`.","type":"string"}}},"refundedAmount":{"description":"Valor monetário.","type":"object","required":["amountCents","currency"],"properties":{"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"currency":{"description":"Moeda ISO 4217, ex.: `BRL`.","type":"string"}}},"dueDate":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"paidAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"billingSnapshot":{"anyOf":[{"description":"Cadastro de cobrança como estava na emissão.","type":"object","required":["name","email","document","phone","country","addressLine1","addressLine2","addressNumber","addressDistrict","city","state","zipCode"],"properties":{"name":{"type":"string"},"email":{"type":"string"},"document":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"ISO 3166-1 alpha-2.","type":"string"},"addressLine1":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressLine2":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressDistrict":{"anyOf":[{"type":"string"},{"type":"null"}]},"city":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"anyOf":[{"type":"string"},{"type":"null"}]},"zipCode":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}},"transaction":{"type":"object","required":["id","status"],"properties":{"id":{"format":"uuid","type":"string"},"status":{"enum":["initiated","pending_customer","processing","authorized","captured","failed","cancelled","refunded","disputed"],"type":"string"}}},"debitedCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"balanceCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"}}}}}},"400":{"$ref":"#/components/responses/IdempotencyKeyInvalid"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"operationId":"postInvoicesByIdPayCredit","security":[{"oauth2":["billing:write"]},{"apiKey":[]}]}},"/invoices":{"get":{"summary":"Lista as faturas da conta","description":"Devolve o histórico completo de faturas da conta: em aberto, vencidas, pagas e canceladas.\n\nEscopo: `billing:read`","tags":["Faturas"],"responses":{"200":{"description":"Faturas.","content":{"application/json":{"schema":{"type":"object","required":["invoices"],"properties":{"invoices":{"type":"array","items":{"type":"object","required":["id","number","userId","orderId","status","items","subtotal","discount","tax","paidAmount","refundedAmount","dueDate","createdAt","updatedAt","paidAt","billingSnapshot"],"properties":{"id":{"format":"uuid","type":"string"},"number":{"type":"string"},"userId":{"format":"uuid","type":"string"},"orderId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"status":{"enum":["draft","pending","overdue","paid","cancelled","partially_refunded","refunded"],"type":"string"},"items":{"type":"array","items":{"type":"object","required":["description","amount","quantity","serviceId"],"properties":{"description":{"type":"string"},"amount":{"description":"Valor monetário.","type":"object","required":["amountCents","currency"],"properties":{"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"currency":{"description":"Moeda ISO 4217, ex.: `BRL`.","type":"string"}}},"quantity":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"serviceId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"period":{"type":"object","required":["start","end"],"properties":{"start":{"format":"date-time","type":"string"},"end":{"format":"date-time","type":"string"}}}}}},"subtotal":{"description":"Valor monetário.","type":"object","required":["amountCents","currency"],"properties":{"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"currency":{"description":"Moeda ISO 4217, ex.: `BRL`.","type":"string"}}},"discount":{"description":"Valor monetário.","type":"object","required":["amountCents","currency"],"properties":{"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"currency":{"description":"Moeda ISO 4217, ex.: `BRL`.","type":"string"}}},"tax":{"description":"Valor monetário.","type":"object","required":["amountCents","currency"],"properties":{"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"currency":{"description":"Moeda ISO 4217, ex.: `BRL`.","type":"string"}}},"paidAmount":{"description":"Valor monetário.","type":"object","required":["amountCents","currency"],"properties":{"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"currency":{"description":"Moeda ISO 4217, ex.: `BRL`.","type":"string"}}},"refundedAmount":{"description":"Valor monetário.","type":"object","required":["amountCents","currency"],"properties":{"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"currency":{"description":"Moeda ISO 4217, ex.: `BRL`.","type":"string"}}},"dueDate":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"paidAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"billingSnapshot":{"anyOf":[{"description":"Cadastro de cobrança como estava na emissão.","type":"object","required":["name","email","document","phone","country","addressLine1","addressLine2","addressNumber","addressDistrict","city","state","zipCode"],"properties":{"name":{"type":"string"},"email":{"type":"string"},"document":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"ISO 3166-1 alpha-2.","type":"string"},"addressLine1":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressLine2":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressDistrict":{"anyOf":[{"type":"string"},{"type":"null"}]},"city":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"anyOf":[{"type":"string"},{"type":"null"}]},"zipCode":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"getInvoices","security":[{"oauth2":["billing:read"]},{"apiKey":[]}]}},"/invoices/{id}":{"get":{"summary":"Detalha uma fatura","description":"Devolve a fatura com os itens, quem foi cobrado (como sai no PDF) e o máximo de parcelas no cartão.\n\nEscopo: `billing:read`","tags":["Faturas"],"responses":{"200":{"description":"Fatura.","content":{"application/json":{"schema":{"type":"object","required":["invoice","taker","maxInstallments"],"properties":{"invoice":{"type":"object","required":["id","number","userId","orderId","status","items","subtotal","discount","tax","paidAmount","refundedAmount","dueDate","createdAt","updatedAt","paidAt","billingSnapshot"],"properties":{"id":{"format":"uuid","type":"string"},"number":{"type":"string"},"userId":{"format":"uuid","type":"string"},"orderId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"status":{"enum":["draft","pending","overdue","paid","cancelled","partially_refunded","refunded"],"type":"string"},"items":{"type":"array","items":{"type":"object","required":["description","amount","quantity","serviceId"],"properties":{"description":{"type":"string"},"amount":{"description":"Valor monetário.","type":"object","required":["amountCents","currency"],"properties":{"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"currency":{"description":"Moeda ISO 4217, ex.: `BRL`.","type":"string"}}},"quantity":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"serviceId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"period":{"type":"object","required":["start","end"],"properties":{"start":{"format":"date-time","type":"string"},"end":{"format":"date-time","type":"string"}}}}}},"subtotal":{"description":"Valor monetário.","type":"object","required":["amountCents","currency"],"properties":{"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"currency":{"description":"Moeda ISO 4217, ex.: `BRL`.","type":"string"}}},"discount":{"description":"Valor monetário.","type":"object","required":["amountCents","currency"],"properties":{"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"currency":{"description":"Moeda ISO 4217, ex.: `BRL`.","type":"string"}}},"tax":{"description":"Valor monetário.","type":"object","required":["amountCents","currency"],"properties":{"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"currency":{"description":"Moeda ISO 4217, ex.: `BRL`.","type":"string"}}},"paidAmount":{"description":"Valor monetário.","type":"object","required":["amountCents","currency"],"properties":{"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"currency":{"description":"Moeda ISO 4217, ex.: `BRL`.","type":"string"}}},"refundedAmount":{"description":"Valor monetário.","type":"object","required":["amountCents","currency"],"properties":{"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"currency":{"description":"Moeda ISO 4217, ex.: `BRL`.","type":"string"}}},"dueDate":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"paidAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"billingSnapshot":{"anyOf":[{"description":"Cadastro de cobrança como estava na emissão.","type":"object","required":["name","email","document","phone","country","addressLine1","addressLine2","addressNumber","addressDistrict","city","state","zipCode"],"properties":{"name":{"type":"string"},"email":{"type":"string"},"document":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"ISO 3166-1 alpha-2.","type":"string"},"addressLine1":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressLine2":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressDistrict":{"anyOf":[{"type":"string"},{"type":"null"}]},"city":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"anyOf":[{"type":"string"},{"type":"null"}]},"zipCode":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}},"taker":{"description":"Quem foi cobrado, como sai no PDF.","type":"object","required":["name","email","documentLabel","document","phone","addressLines"],"properties":{"name":{"type":"string"},"email":{"type":"string"},"documentLabel":{"anyOf":[{"description":"`CPF`, `CNPJ` ou `Passaporte`.","type":"string"},{"type":"null"}]},"document":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressLines":{"type":"array","items":{"type":"string"}}}},"maxInstallments":{"minimum":1,"description":"Máximo de parcelas no cartão para esta fatura.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"description":"Máximo de parcelas no cartão para esta fatura.","type":"integer"}]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getInvoicesById","security":[{"oauth2":["billing:read"]},{"apiKey":[]}]}},"/invoices/{id}/pdf":{"get":{"summary":"Baixa a fatura em PDF","tags":["Faturas"],"responses":{"200":{"description":"PDF da fatura (anexo).","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getInvoicesByIdPdf","description":"Escopo: `billing:read`","security":[{"oauth2":["billing:read"]},{"apiKey":[]}]}},"/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"],"responses":{"200":{"description":"Estado da fatura e Pix pendente.","content":{"application/json":{"schema":{"type":"object","required":["status","paidAt","pix"],"properties":{"status":{"enum":["draft","pending","overdue","paid","cancelled","partially_refunded","refunded"],"type":"string"},"paidAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"pix":{"anyOf":[{"description":"Só com a fatura em aberto e um Pix pendente.","type":"object","required":["transactionId","expiresAt"],"properties":{"transactionId":{"format":"uuid","type":"string"},"expiresAt":{"format":"date-time","description":"Até quando o QR vale.","type":"string"}}},{"type":"null"}]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getInvoicesByIdStatus","security":[{"oauth2":["billing:read"]},{"apiKey":[]}]}},"/credits":{"get":{"summary":"Saldo e histórico de créditos","tags":["Créditos"],"responses":{"200":{"description":"Saldos por moeda e lançamentos.","content":{"application/json":{"schema":{"type":"object","required":["balances","transactions"],"properties":{"balances":{"type":"array","items":{"type":"object","required":["currency","balanceCents"],"properties":{"currency":{"type":"string"},"balanceCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"}}}},"transactions":{"type":"array","items":{"type":"object","required":["id","amountCents","currency","reason","createdAt"],"properties":{"id":{"format":"uuid","type":"string"},"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string; negativo é débito.","type":"string"},"currency":{"type":"string"},"reason":{"enum":["service_downgrade_refund","admin_adjustment","invoice_payment","invoice_refund","affiliate_payout"],"type":"string"},"createdAt":{"format":"date-time","type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"getCredits","description":"Escopo: `billing:read`","security":[{"oauth2":["billing:read"]},{"apiKey":[]}]}},"/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"],"responses":{"200":{"description":"Perfil de cobrança.","content":{"application/json":{"schema":{"type":"object","required":["name","email","profile","phoneParts","phoneVerifiedAt","documentLocked","missingForPix","missingForCard"],"properties":{"name":{"type":"string"},"email":{"type":"string"},"profile":{"type":"object","required":["country","document","phone","addressLine1","addressNumber","addressLine2","addressDistrict","city","state","zipCode"],"properties":{"country":{"description":"ISO 3166-1 alpha-2.","type":"string"},"document":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"description":"E.164, ex.: `+5511987654321`.","type":"string"},{"type":"null"}]},"addressLine1":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressLine2":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressDistrict":{"anyOf":[{"type":"string"},{"type":"null"}]},"city":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"anyOf":[{"type":"string"},{"type":"null"}]},"zipCode":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"phoneParts":{"anyOf":[{"type":"object","required":["dialCode","nationalNumber"],"properties":{"dialCode":{"description":"DDI sem `+`.","type":"string"},"nationalNumber":{"description":"Só dígitos.","type":"string"}}},{"type":"null"}]},"phoneVerifiedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"documentLocked":{"description":"`true` com CPF/CNPJ válido: não pode mais ser trocado.","type":"boolean"},"missingForPix":{"type":"array","items":{"enum":["name","email","document","phone","country","addressLine1","addressNumber","addressDistrict","city","state","zipCode"],"type":"string"}},"missingForCard":{"type":"array","items":{"enum":["name","email","document","phone","country","addressLine1","addressNumber","addressDistrict","city","state","zipCode"],"type":"string"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"getProfile","security":[{"oauth2":["account:read"]},{"apiKey":[]}]},"put":{"summary":"Atualiza o perfil de cobrança","tags":["Conta"],"responses":{"200":{"description":"Perfil atualizado.","content":{"application/json":{"schema":{"type":"object","required":["name","email","profile","phoneParts","phoneVerifiedAt","documentLocked","missingForPix","missingForCard"],"properties":{"name":{"type":"string"},"email":{"type":"string"},"profile":{"type":"object","required":["country","document","phone","addressLine1","addressNumber","addressLine2","addressDistrict","city","state","zipCode"],"properties":{"country":{"description":"ISO 3166-1 alpha-2.","type":"string"},"document":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"description":"E.164, ex.: `+5511987654321`.","type":"string"},{"type":"null"}]},"addressLine1":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressLine2":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressDistrict":{"anyOf":[{"type":"string"},{"type":"null"}]},"city":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"anyOf":[{"type":"string"},{"type":"null"}]},"zipCode":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"phoneParts":{"anyOf":[{"type":"object","required":["dialCode","nationalNumber"],"properties":{"dialCode":{"description":"DDI sem `+`.","type":"string"},"nationalNumber":{"description":"Só dígitos.","type":"string"}}},{"type":"null"}]},"phoneVerifiedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"documentLocked":{"description":"`true` com CPF/CNPJ válido: não pode mais ser trocado.","type":"boolean"},"missingForPix":{"type":"array","items":{"enum":["name","email","document","phone","country","addressLine1","addressNumber","addressDistrict","city","state","zipCode"],"type":"string"}},"missingForCard":{"type":"array","items":{"enum":["name","email","document","phone","country","addressLine1","addressNumber","addressDistrict","city","state","zipCode"],"type":"string"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":[]}]}},"/profile/notifications":{"get":{"summary":"Lê as preferências de notificação","tags":["Conta"],"responses":{"200":{"description":"Matriz categoria x canal.","content":{"application/json":{"schema":{"type":"object","required":["rows","hasPhone"],"properties":{"rows":{"type":"array","items":{"type":"object","required":["category","cells"],"properties":{"category":{"enum":["security","billing_essential","billing","services","support","announcements","account_tips","marketing"],"type":"string"},"cells":{"type":"array","items":{"type":"object","required":["channel","enabled","mandatory"],"properties":{"channel":{"enum":["email","whatsapp"],"type":"string"},"enabled":{"type":"boolean"},"mandatory":{"description":"`true` = não pode ser desligado.","type":"boolean"}}}}}}},"hasPhone":{"description":"WhatsApp só liga com telefone no perfil.","type":"boolean"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"getProfileNotifications","description":"Escopo: `account:read`","security":[{"oauth2":["account:read"]},{"apiKey":[]}]},"put":{"summary":"Atualiza as preferências de notificação","tags":["Conta"],"responses":{"200":{"description":"Matriz já atualizada.","content":{"application/json":{"schema":{"type":"object","required":["rows","hasPhone"],"properties":{"rows":{"type":"array","items":{"type":"object","required":["category","cells"],"properties":{"category":{"enum":["security","billing_essential","billing","services","support","announcements","account_tips","marketing"],"type":"string"},"cells":{"type":"array","items":{"type":"object","required":["channel","enabled","mandatory"],"properties":{"channel":{"enum":["email","whatsapp"],"type":"string"},"enabled":{"type":"boolean"},"mandatory":{"description":"`true` = não pode ser desligado.","type":"boolean"}}}}}}},"hasPhone":{"description":"WhatsApp só liga com telefone no perfil.","type":"boolean"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":[]}]}},"/profile/security-status":{"get":{"summary":"Diz se a conta tem segundo fator","tags":["Conta"],"responses":{"200":{"description":"Situação de segurança.","content":{"application/json":{"schema":{"type":"object","required":["hasSecondFactor","remindersEnabled"],"properties":{"hasSecondFactor":{"description":"2FA ou ao menos uma passkey.","type":"boolean"},"remindersEnabled":{"description":"\"Dicas de segurança\" por e-mail ligadas.","type":"boolean"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"getProfileSecurityStatus","description":"Escopo: `account:read`","security":[{"oauth2":["account:read"]},{"apiKey":[]}]}},"/profile/announcements":{"get":{"summary":"Avisos do painel do cliente","tags":["Conta"],"responses":{"200":{"description":"Avisos ativos e recentes.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["active","recent"],"properties":{"active":{"description":"No ar e não dispensados, prioridade maior primeiro.","type":"array","items":{"type":"object","required":["id","title","body","tone","ctaLabel","ctaUrl","dismissible","startsAt","endsAt","seen","dismissed","clicked"],"properties":{"id":{"format":"uuid","type":"string"},"title":{"type":"string"},"body":{"description":"Texto puro.","type":"string"},"tone":{"enum":["info","warning","success","danger"],"type":"string"},"ctaLabel":{"anyOf":[{"type":"string"},{"type":"null"}]},"ctaUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"dismissible":{"type":"boolean"},"startsAt":{"format":"date-time","type":"string"},"endsAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"seen":{"type":"boolean"},"dismissed":{"type":"boolean"},"clicked":{"type":"boolean"}}}},"recent":{"description":"Os últimos 20, inclusive dispensados.","type":"array","items":{"type":"object","required":["id","title","body","tone","ctaLabel","ctaUrl","dismissible","startsAt","endsAt","seen","dismissed","clicked"],"properties":{"id":{"format":"uuid","type":"string"},"title":{"type":"string"},"body":{"description":"Texto puro.","type":"string"},"tone":{"enum":["info","warning","success","danger"],"type":"string"},"ctaLabel":{"anyOf":[{"type":"string"},{"type":"null"}]},"ctaUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"dismissible":{"type":"boolean"},"startsAt":{"format":"date-time","type":"string"},"endsAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"seen":{"type":"boolean"},"dismissed":{"type":"boolean"},"clicked":{"type":"boolean"}}}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"getProfileAnnouncements","description":"Escopo: `account:read`","security":[{"oauth2":["account:read"]},{"apiKey":[]}]}},"/profile/announcements/{id}/seen":{"post":{"summary":"Marca o aviso como visto","tags":["Conta"],"responses":{"200":{"description":"Recibo gravado (idempotente).","content":{"application/json":{"schema":{"type":"object","required":["ok"],"properties":{"ok":{"const":true,"type":"boolean"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"operationId":"postProfileAnnouncementsByIdSeen","description":"Escopo: `account:write`","security":[{"oauth2":["account:write"]},{"apiKey":[]}]}},"/profile/announcements/{id}/dismiss":{"post":{"summary":"Dispensa o aviso","tags":["Conta"],"responses":{"200":{"description":"Recibo gravado (idempotente).","content":{"application/json":{"schema":{"type":"object","required":["ok"],"properties":{"ok":{"const":true,"type":"boolean"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"operationId":"postProfileAnnouncementsByIdDismiss","description":"Escopo: `account:write`","security":[{"oauth2":["account:write"]},{"apiKey":[]}]}},"/profile/announcements/{id}/click":{"post":{"summary":"Registra o clique no botão do aviso","tags":["Conta"],"responses":{"200":{"description":"Recibo gravado (idempotente).","content":{"application/json":{"schema":{"type":"object","required":["ok"],"properties":{"ok":{"const":true,"type":"boolean"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"operationId":"postProfileAnnouncementsByIdClick","description":"Escopo: `account:write`","security":[{"oauth2":["account:write"]},{"apiKey":[]}]}},"/notifications/opt-in":{"get":{"summary":"Confere o link de aceite de novidades e ofertas","description":"Não muda nada: só diz se o token é válido (400 se não for).","tags":["Notificações"],"responses":{"200":{"description":"Link válido.","content":{"application/json":{"schema":{"type":"object","required":["valid"],"properties":{"valid":{"const":true,"type":"boolean"}}}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"token","in":"query","required":true,"schema":{"minLength":1,"maxLength":1024,"type":"string"}}],"operationId":"getNotificationsOptIn","security":[]},"post":{"summary":"Aceita receber novidades e ofertas por link assinado","description":"Liga a categoria \"Novidades e ofertas\" no e-mail e no WhatsApp. Responde 204 mesmo para conta inexistente.","tags":["Notificações"],"responses":{"204":{"description":"Sem conteúdo"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"token","in":"query","required":true,"schema":{"minLength":1,"maxLength":1024,"type":"string"}}],"operationId":"postNotificationsOptIn","security":[]}},"/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"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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","description":"Pública, sem autenticação. Devolve os países com código ISO 3166-1 alpha-2, nome e DDI.","tags":["Localização"],"responses":{"200":{"description":"Países.","content":{"application/json":{"schema":{"type":"object","required":["countries"],"properties":{"countries":{"type":"array","items":{"type":"object","required":["code","name","dialCode"],"properties":{"code":{"description":"ISO 3166-1 alpha-2.","type":"string"},"name":{"type":"string"},"dialCode":{"description":"DDI sem `+`.","type":"string"}}}}}}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"getGeoCountries","security":[]}},"/geo/br/states":{"get":{"summary":"Lista os estados brasileiros","description":"Pública, sem autenticação. Devolve as unidades federativas com sigla e nome.","tags":["Localização"],"responses":{"200":{"description":"Estados.","content":{"application/json":{"schema":{"type":"object","required":["states"],"properties":{"states":{"type":"array","items":{"type":"object","required":["uf","name"],"properties":{"uf":{"type":"string"},"name":{"type":"string"}}}}}}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"getGeoBrStates","security":[]}},"/geo/br/states/{uf}/cities":{"get":{"summary":"Lista as cidades de um estado","description":"Pública, sem autenticação. Devolve os municípios da UF informada (maiúsculas ou minúsculas); UF inexistente responde 404.","tags":["Localização"],"responses":{"200":{"description":"Cidades da UF.","content":{"application/json":{"schema":{"type":"object","required":["uf","cities"],"properties":{"uf":{"type":"string"},"cities":{"type":"array","items":{"type":"string"}}}}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"uf","in":"path","required":true,"schema":{"minLength":2,"maxLength":2,"type":"string"}}],"operationId":"getGeoBrStatesByUfCities","security":[]}},"/services/{id}/upgrades/targets":{"get":{"summary":"Lista os planos para onde o serviço pode migrar e as opções trocáveis do plano atual","tags":["Serviços"],"responses":{"200":{"description":"Destinos e opções trocáveis.","content":{"application/json":{"schema":{"type":"object","required":["service","pending","blockedReason","targets","currentOptions"],"properties":{"service":{"type":"object","required":["id","productId","productName","planId","planName","status","billingCycle","currency","priceCents","quantity","nextDueDate","hostingLimits"],"properties":{"id":{"format":"uuid","type":"string"},"productId":{"format":"uuid","type":"string"},"productName":{"type":"string"},"planId":{"format":"uuid","type":"string"},"planName":{"type":"string"},"status":{"enum":["pending","provisioning","active","failed_provisioning","suspending","suspended","unsuspending","terminating","terminated"],"type":"string"},"billingCycle":{"enum":["monthly","quarterly","semi_annually","annually","biennially","triennially"],"type":"string"},"currency":{"type":"string"},"priceCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"quantity":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"nextDueDate":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"hostingLimits":{"anyOf":[{"additionalProperties":true,"type":"object","required":["memoryMb","cpuMilli","diskMb","maxApps","maxDatabases","redis","maxDomains","maxWorkers","buildMinutesPerMonth","backupRetentionDays","egressSmtp"],"properties":{"memoryMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"cpuMilli":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"diskMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"maxApps":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"maxDatabases":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"redis":{"type":"boolean"},"maxDomains":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"maxWorkers":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"buildMinutesPerMonth":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"backupRetentionDays":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"egressSmtp":{"type":"boolean"}}},{"type":"null"}]}}},"pending":{"anyOf":[{"type":"object","required":["serviceUpgradeId","productId","productName","planId","planName","invoiceId","createdAt"],"properties":{"serviceUpgradeId":{"format":"uuid","type":"string"},"productId":{"format":"uuid","type":"string"},"productName":{"type":"string"},"planId":{"format":"uuid","type":"string"},"planName":{"type":"string"},"invoiceId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"}}},{"type":"null"}]},"blockedReason":{"anyOf":[{"enum":["service_not_active","pending_upgrade","open_invoice","no_due_date","renewal_issued","renewal_due"],"type":"string"},{"type":"null"}]},"targets":{"type":"array","items":{"type":"object","required":["productId","name","description","active","plans"],"properties":{"productId":{"format":"uuid","type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"active":{"type":"boolean"},"plans":{"type":"array","items":{"type":"object","required":["planId","name","hostingLimits","prices","quote"],"properties":{"planId":{"format":"uuid","type":"string"},"name":{"type":"string"},"hostingLimits":{"anyOf":[{"additionalProperties":true,"type":"object","required":["memoryMb","cpuMilli","diskMb","maxApps","maxDatabases","redis","maxDomains","maxWorkers","buildMinutesPerMonth","backupRetentionDays","egressSmtp"],"properties":{"memoryMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"cpuMilli":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"diskMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"maxApps":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"maxDatabases":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"redis":{"type":"boolean"},"maxDomains":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"maxWorkers":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"buildMinutesPerMonth":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"backupRetentionDays":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"egressSmtp":{"type":"boolean"}}},{"type":"null"}]},"prices":{"type":"array","items":{"type":"object","required":["billingCycle","currency","priceCents"],"properties":{"billingCycle":{"enum":["monthly","quarterly","semi_annually","annually","biennially","triennially"],"type":"string"},"currency":{"type":"string"},"priceCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"}}}},"quote":{"type":"object","required":["currency","currentPriceCents","newPriceCents","quantity","remainingDays","periodDays","amountDueCents"],"properties":{"currency":{"type":"string"},"currentPriceCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"newPriceCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"quantity":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"remainingDays":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"periodDays":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"amountDueCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"}}}}}}}}},"currentOptions":{"type":"array","items":{"type":"object","required":["optionId","name","type","moduleKey","selectedItemId","items"],"properties":{"optionId":{"format":"uuid","type":"string"},"name":{"type":"string"},"type":{"enum":["dropdown","radio","checkbox","quantity"],"type":"string"},"moduleKey":{"anyOf":[{"type":"string"},{"type":"null"}]},"selectedItemId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","required":["itemId","name","moduleValue","selected","priceCents","setupFeeCents","change"],"properties":{"itemId":{"format":"uuid","type":"string"},"name":{"type":"string"},"moduleValue":{"anyOf":[{"type":"string"},{"type":"null"}]},"selected":{"type":"boolean"},"priceCents":{"anyOf":[{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},{"type":"null"}]},"setupFeeCents":{"anyOf":[{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},{"type":"null"}]},"change":{"anyOf":[{"type":"object","required":["newPriceCents","amountDueCents","remainingDays","periodDays","appliesImmediately"],"properties":{"newPriceCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"amountDueCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"remainingDays":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"periodDays":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"appliesImmediately":{"type":"boolean"}}},{"type":"null"}]}}}}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"operationId":"getServicesByIdUpgradesTargets","description":"Escopo: `services:read`","security":[{"oauth2":["services:read"]},{"apiKey":[]}]}},"/services/{id}/upgrades":{"post":{"summary":"Pede a troca de plano ou só de opção do serviço","description":"201 com a fatura proporcional a pagar; 200 quando a troca vale na hora (sem diferença a cobrar, inclusive redução de opção); 204 quando o pedido é igual ao atual. Troca só de opção: mesmo targetProductId e targetPlanId do serviço, com configSelections novas.\n\nEscopo: `services:write`","tags":["Serviços"],"responses":{"200":{"description":"Troca aplicada na hora.","content":{"application/json":{"schema":{"type":"object","required":["status","serviceUpgradeId","deltaCents"],"properties":{"status":{"const":"applied_immediately","type":"string"},"serviceUpgradeId":{"format":"uuid","type":"string"},"deltaCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"}}}}}},"201":{"description":"Troca pendente da fatura.","content":{"application/json":{"schema":{"type":"object","required":["status","serviceUpgradeId","invoiceId","amountCents"],"properties":{"status":{"const":"pending","type":"string"},"serviceUpgradeId":{"format":"uuid","type":"string"},"invoiceId":{"format":"uuid","type":"string"},"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"}}}}}},"204":{"description":"Pedido igual ao atual"},"400":{"$ref":"#/components/responses/IdempotencyKeyInvalid"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["targetProductId","targetPlanId"],"properties":{"targetProductId":{"format":"uuid","type":"string"},"targetPlanId":{"format":"uuid","type":"string"},"configSelections":{"maxItems":50,"type":"array","items":{"type":"object","required":["optionId","itemId"],"properties":{"optionId":{"format":"uuid","type":"string"},"itemId":{"format":"uuid","type":"string"}}}}}}}}},"operationId":"postServicesByIdUpgrades","security":[{"oauth2":["services:write"]},{"apiKey":[]}]}},"/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"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}},{"name":"upgradeId","in":"path","required":true,"schema":{"format":"uuid","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"],"responses":{"200":{"description":"Cancelamento em aberto.","content":{"application/json":{"schema":{"type":"object","required":["cancellation"],"properties":{"cancellation":{"anyOf":[{"type":"object","required":["id","serviceId","type","status","effectiveDate","processedAt"],"properties":{"id":{"format":"uuid","type":"string"},"serviceId":{"format":"uuid","type":"string"},"type":{"enum":["immediate","end_of_billing_period"],"type":"string"},"status":{"enum":["requested","scheduled","processed","reverted"],"type":"string"},"effectiveDate":{"format":"date-time","type":"string"},"processedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getServicesByIdCancel","security":[{"oauth2":["services:read"]},{"apiKey":[]}]},"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":"Cancelamento registrado.","content":{"application/json":{"schema":{"type":"object","required":["cancellation"],"properties":{"cancellation":{"type":"object","required":["id","serviceId","type","status","effectiveDate","processedAt"],"properties":{"id":{"format":"uuid","type":"string"},"serviceId":{"format":"uuid","type":"string"},"type":{"enum":["immediate","end_of_billing_period"],"type":"string"},"status":{"enum":["requested","scheduled","processed","reverted"],"type":"string"},"effectiveDate":{"format":"date-time","type":"string"},"processedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}},"400":{"$ref":"#/components/responses/IdempotencyKeyInvalid"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"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"],"responses":{"200":{"description":"Cancelamento desfeito.","content":{"application/json":{"schema":{"type":"object","required":["cancellation"],"properties":{"cancellation":{"type":"object","required":["id","serviceId","type","status","effectiveDate","processedAt"],"properties":{"id":{"format":"uuid","type":"string"},"serviceId":{"format":"uuid","type":"string"},"type":{"enum":["immediate","end_of_billing_period"],"type":"string"},"status":{"enum":["requested","scheduled","processed","reverted"],"type":"string"},"effectiveDate":{"format":"date-time","type":"string"},"processedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"deleteServicesByIdCancel","description":"Escopo: `services:write`","security":[{"oauth2":["services:write"]},{"apiKey":[]}]}},"/services/{id}/vps":{"get":{"summary":"Lista as VPS do serviço com o estado ao vivo","tags":["VPS"],"responses":{"200":{"description":"VPS do serviço.","content":{"application/json":{"schema":{"type":"object","required":["servers"],"properties":{"servers":{"type":"array","items":{"type":"object","required":["id","uuid","name","hostname","provisionState","powerState","running","suspended","protected","buildFailed","hasActiveTask","os","resources","ipv4","ipv6","vncEnabled","firewallEnabled","trafficPeriod","live","createdAt","builtAt","hasStoredPassword"],"properties":{"id":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"uuid":{"type":"string"},"name":{"type":"string"},"hostname":{"anyOf":[{"type":"string"},{"type":"null"}]},"provisionState":{"description":"Estado no VirtFusion: `complete`, `allocated`, `building`, `queued`, `failed`...","type":"string"},"powerState":{"anyOf":[{"description":"`running`, `paused`, `shutoff`...; `null` sem leitura.","type":"string"},{"type":"null"}]},"running":{"type":"boolean"},"suspended":{"type":"boolean"},"protected":{"type":"boolean"},"buildFailed":{"type":"boolean"},"hasActiveTask":{"description":"Há uma ação em andamento ou na fila nesta VPS (build, energia, firewall...).","type":"boolean"},"os":{"type":"object","required":["templateId","name"],"properties":{"templateId":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"resources":{"type":"object","required":["cpuCores","memoryMb","storageGb","trafficGb"],"properties":{"cpuCores":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"memoryMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"storageGb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"trafficGb":{"description":"GB por ciclo; 0 = ilimitado.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"GB por ciclo; 0 = ilimitado.","type":"integer"}]}}},"ipv4":{"type":"array","items":{"type":"object","required":["address","gateway","netmask"],"properties":{"address":{"type":"string"},"gateway":{"anyOf":[{"type":"string"},{"type":"null"}]},"netmask":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"ipv6":{"type":"array","items":{"type":"string"}},"vncEnabled":{"type":"boolean"},"firewallEnabled":{"type":"boolean"},"trafficPeriod":{"anyOf":[{"type":"object","required":["start","end","limitGb"],"properties":{"start":{"type":"string"},"end":{"type":"string"},"limitGb":{"type":"number"}}},{"type":"null"}]},"live":{"anyOf":[{"type":"object","required":["cpuPercent","memoryTotalMb","memoryUsedMb","diskUsedBytes","diskTotalBytes","diskReadBytes","diskWriteBytes","netRxBytes","netTxBytes"],"properties":{"cpuPercent":{"anyOf":[{"type":"number"},{"type":"null"}]},"memoryTotalMb":{"anyOf":[{"type":"number"},{"type":"null"}]},"memoryUsedMb":{"anyOf":[{"type":"number"},{"type":"null"}]},"diskUsedBytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"diskTotalBytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"diskReadBytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"diskWriteBytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"netRxBytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"netTxBytes":{"anyOf":[{"type":"number"},{"type":"null"}]}}},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"builtAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasStoredPassword":{"description":"Há senha root guardada para mostrar.","type":"boolean"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getServicesByIdVps","description":"Escopo: `vps:read`","security":[{"oauth2":["vps:read"]},{"apiKey":[]}]}},"/services/{id}/vps/cancellations":{"get":{"summary":"Lista os cancelamentos de VPS em aberto do serviço","description":"Só os pedidos ainda não processados nem desfeitos, pela data efetiva.\n\nEscopo: `vps:read`","tags":["VPS"],"responses":{"200":{"description":"Cancelamentos em aberto.","content":{"application/json":{"schema":{"type":"object","required":["cancellations"],"properties":{"cancellations":{"type":"array","items":{"type":"object","required":["id","serviceId","serverId","serverName","type","status","effectiveDate","processedAt"],"properties":{"id":{"format":"uuid","type":"string"},"serviceId":{"format":"uuid","type":"string"},"serverId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"serverName":{"type":"string"},"type":{"enum":["immediate","end_of_billing_period"],"type":"string"},"status":{"enum":["requested","scheduled","processed","reverted"],"type":"string"},"effectiveDate":{"format":"date-time","type":"string"},"processedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getServicesByIdVpsCancellations","security":[{"oauth2":["vps:read"]},{"apiKey":[]}]}},"/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"],"responses":{"200":{"description":"Apps da VPS.","content":{"application/json":{"schema":{"type":"object","required":["apps"],"properties":{"apps":{"type":"array","items":{"type":"object","required":["id","appId","appName","icon","status","errorMessage","inputs","credentials","afterInstallNote","estimatedInstallSeconds","createdAt","startedAt","finishedAt"],"properties":{"id":{"format":"uuid","type":"string"},"appId":{"type":"string"},"appName":{"type":"string"},"icon":{"type":"string"},"status":{"enum":["pending","installing","ready","failed"],"type":"string"},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"inputs":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"credentials":{"anyOf":[{"type":"array","items":{"type":"object","required":["key","label","type","value"],"properties":{"key":{"type":"string"},"label":{"type":"string"},"type":{"enum":["link","text"],"type":"string"},"value":{"type":"string"}}}},{"type":"null"}]},"afterInstallNote":{"type":"string"},"estimatedInstallSeconds":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"createdAt":{"format":"date-time","type":"string"},"startedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"finishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getServicesByIdVpsApps","security":[{"oauth2":["vps:read"]},{"apiKey":[]}]}},"/services/{id}/vps/{serverId}/traffic":{"get":{"summary":"Consumo de tráfego da VPS por mês","tags":["VPS"],"responses":{"200":{"description":"Tráfego por mês.","content":{"application/json":{"schema":{"type":"object","required":["months"],"properties":{"months":{"type":"array","items":{"type":"object","required":["start","end","rxBytes","txBytes","totalBytes","limitGb"],"properties":{"start":{"type":"string"},"end":{"type":"string"},"rxBytes":{"type":"number"},"txBytes":{"type":"number"},"totalBytes":{"type":"number"},"limitGb":{"description":"GB; 0 = ilimitado.","type":"number"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":[]}]}},"/services/{id}/vps/{serverId}/templates":{"get":{"summary":"Lista os sistemas para reinstalar a VPS","tags":["VPS"],"responses":{"200":{"description":"Sistemas disponíveis.","content":{"application/json":{"schema":{"type":"object","required":["templates"],"properties":{"templates":{"type":"array","items":{"type":"object","required":["id","name","version","variant","group","icon","eol"],"properties":{"id":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"name":{"type":"string"},"version":{"type":"string"},"variant":{"type":"string"},"group":{"type":"string"},"icon":{"description":"Ícone do grupo; vazio quando não vem.","type":"string"},"eol":{"type":"boolean"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":[]}]}},"/services/{id}/vps/{serverId}/firewall":{"get":{"summary":"Estado do firewall da VPS","tags":["VPS"],"responses":{"200":{"description":"Firewall.","content":{"application/json":{"schema":{"type":"object","required":["firewall"],"properties":{"firewall":{"type":"object","required":["enabled","rules"],"properties":{"enabled":{"type":"boolean"},"rules":{"type":"array","items":{}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":[]}]},"put":{"summary":"Liga ou desliga o firewall da VPS","tags":["VPS"],"responses":{"200":{"description":"Firewall atualizado.","content":{"application/json":{"schema":{"type":"object","required":["firewall"],"properties":{"firewall":{"type":"object","required":["enabled","rules"],"properties":{"enabled":{"type":"boolean"},"rules":{"type":"array","items":{}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":[]}]}},"/services/{id}/vps/{serverId}/backups":{"get":{"summary":"Lista os backups da VPS","tags":["VPS"],"responses":{"200":{"description":"Backups.","content":{"application/json":{"schema":{"type":"object","required":["backups"],"properties":{"backups":{"type":"array","items":{"type":"object","required":["id","createdAt","sizeBytes","status"],"properties":{"id":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sizeBytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"status":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":[]}]}},"/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"],"responses":{"200":{"description":"Console VNC.","content":{"application/json":{"schema":{"type":"object","required":["vnc"],"properties":{"vnc":{"type":"object","required":["enabled","ip","port","password","wssToken"],"properties":{"enabled":{"type":"boolean"},"ip":{"anyOf":[{"type":"string"},{"type":"null"}]},"port":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"password":{"anyOf":[{"type":"string"},{"type":"null"}]},"wssToken":{"anyOf":[{"description":"Token do websocket do console.","type":"string"},{"type":"null"}]}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":[]}]},"put":{"summary":"Liga ou desliga o console VNC","tags":["VPS"],"responses":{"200":{"description":"Console VNC atualizado.","content":{"application/json":{"schema":{"type":"object","required":["vnc"],"properties":{"vnc":{"type":"object","required":["enabled","ip","port","password","wssToken"],"properties":{"enabled":{"type":"boolean"},"ip":{"anyOf":[{"type":"string"},{"type":"null"}]},"port":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"password":{"anyOf":[{"type":"string"},{"type":"null"}]},"wssToken":{"anyOf":[{"description":"Token do websocket do console.","type":"string"},{"type":"null"}]}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":[]}]}},"/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"],"responses":{"200":{"description":"Pontos do gráfico.","content":{"application/json":{"schema":{"type":"object","required":["range","points"],"properties":{"range":{"enum":["24h","7d","30d"],"type":"string"},"points":{"type":"array","items":{"type":"object","required":["ts","cpuPct","memUsedMb","memTotalMb","diskReadBps","diskWriteBps","netRxBps","netTxBps"],"properties":{"ts":{"format":"date-time","type":"string"},"cpuPct":{"anyOf":[{"type":"number"},{"type":"null"}]},"memUsedMb":{"anyOf":[{"type":"number"},{"type":"null"}]},"memTotalMb":{"anyOf":[{"type":"number"},{"type":"null"}]},"diskReadBps":{"anyOf":[{"type":"number"},{"type":"null"}]},"diskWriteBps":{"anyOf":[{"type":"number"},{"type":"null"}]},"netRxBps":{"anyOf":[{"type":"number"},{"type":"null"}]},"netTxBps":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":[]}]}},"/services/{id}/vps/{serverId}/power":{"post":{"summary":"Liga, desliga ou reinicia a VPS","description":"Assíncrono e sem tarefa própria: acompanhe por `GET /services/{id}/vps` até `hasActiveTask` voltar a `false`.\n\nEscopo: `vps:write`","tags":["VPS"],"responses":{"202":{"description":"Aceito; acompanhe `hasActiveTask` em `GET /services/{id}/vps`.","content":{"application/json":{"schema":{"type":"object","required":["accepted"],"properties":{"accepted":{"const":true,"type":"boolean"}}}}}},"400":{"$ref":"#/components/responses/IdempotencyKeyInvalid"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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"}]}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["boot","shutdown","restart","poweroff"]}}}}}},"operationId":"postServicesByIdVpsByServerIdPower","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"],"responses":{"200":{"description":"Nova senha root.","content":{"application/json":{"schema":{"type":"object","required":["password"],"properties":{"password":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":[]}]}},"/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"],"responses":{"200":{"description":"Reinstalação iniciada.","content":{"application/json":{"schema":{"type":"object","required":["password","appQueued"],"properties":{"password":{"anyOf":[{"description":"Nova senha root; não é repetida.","type":"string"},{"type":"null"}]},"appQueued":{"description":"O app escolhido entrou na fila de instalação.","type":"boolean"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":[]}]}},"/services/{id}/vps/{serverId}/name":{"patch":{"summary":"Renomeia a VPS","tags":["VPS"],"responses":{"200":{"description":"Nome novo.","content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":[]}]}},"/services/{id}/vps/{serverId}/cancel":{"post":{"summary":"Cancela uma VPS do serviço e mantém as demais","description":"`end_of_billing_period` apaga a VM no próximo vencimento; `immediate` apaga agora, sem reembolso do ciclo. A renovação em aberto já passa a cobrar uma VM a menos.\n\nEscopo: `vps:write`","tags":["VPS"],"responses":{"201":{"description":"Cancelamento registrado.","content":{"application/json":{"schema":{"type":"object","required":["cancellation"],"properties":{"cancellation":{"type":"object","required":["id","serviceId","serverId","serverName","type","status","effectiveDate","processedAt"],"properties":{"id":{"format":"uuid","type":"string"},"serviceId":{"format":"uuid","type":"string"},"serverId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"serverName":{"type":"string"},"type":{"enum":["immediate","end_of_billing_period"],"type":"string"},"status":{"enum":["requested","scheduled","processed","reverted"],"type":"string"},"effectiveDate":{"format":"date-time","type":"string"},"processedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}},"400":{"$ref":"#/components/responses/IdempotencyKeyInvalid"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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"}]}},{"$ref":"#/components/parameters/IdempotencyKey"}],"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":"postServicesByIdVpsByServerIdCancel","security":[{"oauth2":["vps:write"]},{"apiKey":[]}]},"delete":{"summary":"Desfaz o cancelamento agendado de uma VPS","description":"Só antes da data efetiva; a renovação em aberto volta a cobrar a VM.\n\nEscopo: `vps:write`","tags":["VPS"],"responses":{"200":{"description":"Cancelamento desfeito.","content":{"application/json":{"schema":{"type":"object","required":["cancellation"],"properties":{"cancellation":{"type":"object","required":["id","serviceId","serverId","serverName","type","status","effectiveDate","processedAt"],"properties":{"id":{"format":"uuid","type":"string"},"serviceId":{"format":"uuid","type":"string"},"serverId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"serverName":{"type":"string"},"type":{"enum":["immediate","end_of_billing_period"],"type":"string"},"status":{"enum":["requested","scheduled","processed","reverted"],"type":"string"},"effectiveDate":{"format":"date-time","type":"string"},"processedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":"deleteServicesByIdVpsByServerIdCancel","security":[{"oauth2":["vps:write"]},{"apiKey":[]}]}},"/services/{id}/mail":{"get":{"summary":"Resumo do e-mail: limites do plano, uso e domínios","tags":["E-mail"],"responses":{"200":{"description":"Resumo do e-mail.","content":{"application/json":{"schema":{"type":"object","required":["limits","usage","domains"],"properties":{"limits":{"type":"object","required":["maxDomains","maxMailboxesPerDomain","domainQuotaMb","defaultQuotaMb","maxQuotaMb","maxAliases","rateLimit"],"properties":{"maxDomains":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"maxMailboxesPerDomain":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"domainQuotaMb":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"defaultQuotaMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"maxQuotaMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"maxAliases":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"rateLimit":{"anyOf":[{"type":"object","required":["value","frame"],"properties":{"value":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"frame":{"enum":["s","m","h","d"],"type":"string"}}},{"type":"null"}]}}},"usage":{"anyOf":[{"type":"object","required":["domains"],"properties":{"domains":{"type":"array","items":{"type":"object","required":["domain","mailboxCount","aliasCount","allocatedQuotaMb","usedMb","largestMailboxQuotaMb"],"properties":{"domain":{"type":"string"},"mailboxCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"aliasCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"allocatedQuotaMb":{"type":"number"},"usedMb":{"type":"number"},"largestMailboxQuotaMb":{"type":"number"}}}}}},{"type":"null"}]},"domains":{"type":"array","items":{"type":"object","required":["id","domain","status","verified","verifiedAt","suspended","primary","createdAt","verification","dkim","access"],"properties":{"id":{"format":"uuid","type":"string"},"domain":{"type":"string"},"status":{"enum":["pending_verification","pending","active","suspended","deleting","failed"],"type":"string"},"verified":{"type":"boolean"},"verifiedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"suspended":{"type":"boolean"},"primary":{"description":"Domínio da compra; não pode ser removido.","type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"verification":{"anyOf":[{"type":"object","required":["type","name","value"],"properties":{"type":{"const":"TXT","type":"string"},"name":{"type":"string"},"value":{"type":"string"}}},{"type":"null"}]},"dkim":{"type":"array","items":{"type":"object","required":["selector","algorithm","stage","name"],"properties":{"selector":{"type":"string"},"algorithm":{"enum":["ed25519","rsa"],"type":"string"},"stage":{"enum":["pending","active","retiring","retired"],"type":"string"},"name":{"type":"string"}}}},"access":{"type":"object","required":["webmailUrl","imapHostname","smtpHostname"],"properties":{"webmailUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"imapHostname":{"type":"string"},"smtpHostname":{"type":"string"}}}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"operationId":"getServicesByIdMail","description":"Escopo: `email:read`","security":[{"oauth2":["email:read"]},{"apiKey":[]}]}},"/services/{id}/mail/domains":{"post":{"summary":"Adiciona um domínio de e-mail","description":"O domínio nasce `pending_verification`: publique o TXT de `verification` e chame `/verify`. Repetir o mesmo domínio devolve o existente (200).\n\nEscopo: `email:write`","tags":["E-mail"],"responses":{"200":{"description":"Domínio já existente.","content":{"application/json":{"schema":{"type":"object","required":["id","domain","status","verified","verifiedAt","suspended","primary","createdAt","verification","dkim","access"],"properties":{"id":{"format":"uuid","type":"string"},"domain":{"type":"string"},"status":{"enum":["pending_verification","pending","active","suspended","deleting","failed"],"type":"string"},"verified":{"type":"boolean"},"verifiedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"suspended":{"type":"boolean"},"primary":{"description":"Domínio da compra; não pode ser removido.","type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"verification":{"anyOf":[{"type":"object","required":["type","name","value"],"properties":{"type":{"const":"TXT","type":"string"},"name":{"type":"string"},"value":{"type":"string"}}},{"type":"null"}]},"dkim":{"type":"array","items":{"type":"object","required":["selector","algorithm","stage","name"],"properties":{"selector":{"type":"string"},"algorithm":{"enum":["ed25519","rsa"],"type":"string"},"stage":{"enum":["pending","active","retiring","retired"],"type":"string"},"name":{"type":"string"}}}},"access":{"type":"object","required":["webmailUrl","imapHostname","smtpHostname"],"properties":{"webmailUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"imapHostname":{"type":"string"},"smtpHostname":{"type":"string"}}}}}}}},"201":{"description":"Domínio criado.","content":{"application/json":{"schema":{"type":"object","required":["id","domain","status","verified","verifiedAt","suspended","primary","createdAt","verification","dkim","access"],"properties":{"id":{"format":"uuid","type":"string"},"domain":{"type":"string"},"status":{"enum":["pending_verification","pending","active","suspended","deleting","failed"],"type":"string"},"verified":{"type":"boolean"},"verifiedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"suspended":{"type":"boolean"},"primary":{"description":"Domínio da compra; não pode ser removido.","type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"verification":{"anyOf":[{"type":"object","required":["type","name","value"],"properties":{"type":{"const":"TXT","type":"string"},"name":{"type":"string"},"value":{"type":"string"}}},{"type":"null"}]},"dkim":{"type":"array","items":{"type":"object","required":["selector","algorithm","stage","name"],"properties":{"selector":{"type":"string"},"algorithm":{"enum":["ed25519","rsa"],"type":"string"},"stage":{"enum":["pending","active","retiring","retired"],"type":"string"},"name":{"type":"string"}}}},"access":{"type":"object","required":["webmailUrl","imapHostname","smtpHostname"],"properties":{"webmailUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"imapHostname":{"type":"string"},"smtpHostname":{"type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":1,"maxLength":253,"type":"string"}}}}}},"operationId":"postServicesByIdMailDomains","security":[{"oauth2":["email:write"]},{"apiKey":[]}]}},"/services/{id}/mail/domains/{domainId}":{"delete":{"summary":"Remove um domínio de e-mail, com as caixas e os aliases dele","description":"O domínio da compra não pode ser removido. Assíncrono: o domínio fica `deleting` e as caixas vão para a lixeira antes de saírem do servidor (tarefa `domain.remove`). 204 quando o domínio já não existia.\n\nEscopo: `email:write`","tags":["E-mail"],"responses":{"202":{"description":"Remoção enfileirada: a própria tarefa.","content":{"application/json":{"schema":{"type":"object","required":["id","kind","targetLabel","status","mailboxId","domainId","backupId","trashId","progress","result","error","attempts","createdAt","startedAt","finishedAt"],"properties":{"id":{"format":"uuid","type":"string"},"kind":{"enum":["mailbox.delete","domain.remove","backup.restore","trash.restore"],"type":"string"},"targetLabel":{"description":"Endereço da caixa ou nome do domínio.","type":"string"},"status":{"enum":["queued","running","succeeded","failed"],"type":"string"},"mailboxId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"domainId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"backupId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"trashId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"progress":{"type":"object","required":["done","total"],"properties":{"done":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"total":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},"result":{"anyOf":[{"description":"Resumo ao terminar; os campos variam por `kind`.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}}]}}},{"type":"null"}]},"error":{"anyOf":[{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},{"type":"null"}]},"attempts":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"createdAt":{"format":"date-time","type":"string"},"startedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"finishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}},"headers":{"Location":{"description":"Endpoint para acompanhar a tarefa: `/api/v1/services/{id}/mail/jobs/{jobId}`.","schema":{"type":"string"}}}},"204":{"description":"Já removido"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}},{"name":"domainId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"operationId":"deleteServicesByIdMailDomainsByDomainId","security":[{"oauth2":["email:write"]},{"apiKey":[]}]}},"/services/{id}/mail/domains/{domainId}/verify":{"post":{"summary":"Confere o TXT de posse do domínio e o ativa","tags":["E-mail"],"responses":{"200":{"description":"Resultado da verificação.","content":{"application/json":{"schema":{"type":"object","required":["verified","reason","domain"],"properties":{"verified":{"type":"boolean"},"reason":{"anyOf":[{"enum":["txt_missing","dns_unavailable"],"type":"string"},{"type":"null"}]},"domain":{"type":"object","required":["id","domain","status","verified","verifiedAt","suspended","primary","createdAt","verification","dkim","access"],"properties":{"id":{"format":"uuid","type":"string"},"domain":{"type":"string"},"status":{"enum":["pending_verification","pending","active","suspended","deleting","failed"],"type":"string"},"verified":{"type":"boolean"},"verifiedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"suspended":{"type":"boolean"},"primary":{"description":"Domínio da compra; não pode ser removido.","type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"verification":{"anyOf":[{"type":"object","required":["type","name","value"],"properties":{"type":{"const":"TXT","type":"string"},"name":{"type":"string"},"value":{"type":"string"}}},{"type":"null"}]},"dkim":{"type":"array","items":{"type":"object","required":["selector","algorithm","stage","name"],"properties":{"selector":{"type":"string"},"algorithm":{"enum":["ed25519","rsa"],"type":"string"},"stage":{"enum":["pending","active","retiring","retired"],"type":"string"},"name":{"type":"string"}}}},"access":{"type":"object","required":["webmailUrl","imapHostname","smtpHostname"],"properties":{"webmailUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"imapHostname":{"type":"string"},"smtpHostname":{"type":"string"}}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}},{"name":"domainId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"operationId":"postServicesByIdMailDomainsByDomainIdVerify","description":"Escopo: `email:write`","security":[{"oauth2":["email:write"]},{"apiKey":[]}]}},"/services/{id}/mail/domains/{domainId}/dns":{"get":{"summary":"Registros DNS do domínio com a conferência ao vivo","description":"Cada registro traz `found` (o que o DNS devolveu; MX como `<prioridade> <host>` e SRV como `<prioridade> <peso> <porta> <host>`) e `status`: `ok`, `missing` (nada publicado), `mismatch` (publicado com outro valor) ou `unknown` (DNS indisponível ou lento).\n\nEscopo: `email:read`","tags":["E-mail"],"responses":{"200":{"description":"Registros e conferência.","content":{"application/json":{"schema":{"type":"object","required":["records","checkedAt"],"properties":{"records":{"type":"array","items":{"type":"object","required":["type","name","value","purpose","required","found","status"],"properties":{"type":{"enum":["MX","TXT","CNAME","SRV"],"type":"string"},"name":{"type":"string"},"value":{"type":"string"},"priority":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"purpose":{"enum":["verification","mx","spf","dkim","dmarc","autoconfig","srv","mta-sts","tls-rpt"],"type":"string"},"required":{"type":"boolean"},"found":{"type":"array","items":{"type":"string"}},"status":{"enum":["ok","missing","mismatch","unknown"],"type":"string"}}}},"checkedAt":{"format":"date-time","type":"string"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}},{"name":"domainId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"operationId":"getServicesByIdMailDomainsByDomainIdDns","security":[{"oauth2":["email:read"]},{"apiKey":[]}]}},"/services/{id}/mail/domains/{domainId}/dkim/rotate":{"post":{"summary":"DKIM, passo 1: cria as chaves novas (publique o DNS antes de ativar)","tags":["E-mail"],"responses":{"200":{"description":"Domínio atualizado.","content":{"application/json":{"schema":{"type":"object","required":["id","domain","status","verified","verifiedAt","suspended","primary","createdAt","verification","dkim","access"],"properties":{"id":{"format":"uuid","type":"string"},"domain":{"type":"string"},"status":{"enum":["pending_verification","pending","active","suspended","deleting","failed"],"type":"string"},"verified":{"type":"boolean"},"verifiedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"suspended":{"type":"boolean"},"primary":{"description":"Domínio da compra; não pode ser removido.","type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"verification":{"anyOf":[{"type":"object","required":["type","name","value"],"properties":{"type":{"const":"TXT","type":"string"},"name":{"type":"string"},"value":{"type":"string"}}},{"type":"null"}]},"dkim":{"type":"array","items":{"type":"object","required":["selector","algorithm","stage","name"],"properties":{"selector":{"type":"string"},"algorithm":{"enum":["ed25519","rsa"],"type":"string"},"stage":{"enum":["pending","active","retiring","retired"],"type":"string"},"name":{"type":"string"}}}},"access":{"type":"object","required":["webmailUrl","imapHostname","smtpHostname"],"properties":{"webmailUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"imapHostname":{"type":"string"},"smtpHostname":{"type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}},{"name":"domainId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"operationId":"postServicesByIdMailDomainsByDomainIdDkimRotate","description":"Escopo: `email:write`","security":[{"oauth2":["email:write"]},{"apiKey":[]}]}},"/services/{id}/mail/domains/{domainId}/dkim/activate":{"post":{"summary":"DKIM, passo 2: ativa as chaves novas e aposenta as antigas","tags":["E-mail"],"responses":{"200":{"description":"Domínio atualizado.","content":{"application/json":{"schema":{"type":"object","required":["id","domain","status","verified","verifiedAt","suspended","primary","createdAt","verification","dkim","access"],"properties":{"id":{"format":"uuid","type":"string"},"domain":{"type":"string"},"status":{"enum":["pending_verification","pending","active","suspended","deleting","failed"],"type":"string"},"verified":{"type":"boolean"},"verifiedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"suspended":{"type":"boolean"},"primary":{"description":"Domínio da compra; não pode ser removido.","type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"verification":{"anyOf":[{"type":"object","required":["type","name","value"],"properties":{"type":{"const":"TXT","type":"string"},"name":{"type":"string"},"value":{"type":"string"}}},{"type":"null"}]},"dkim":{"type":"array","items":{"type":"object","required":["selector","algorithm","stage","name"],"properties":{"selector":{"type":"string"},"algorithm":{"enum":["ed25519","rsa"],"type":"string"},"stage":{"enum":["pending","active","retiring","retired"],"type":"string"},"name":{"type":"string"}}}},"access":{"type":"object","required":["webmailUrl","imapHostname","smtpHostname"],"properties":{"webmailUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"imapHostname":{"type":"string"},"smtpHostname":{"type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}},{"name":"domainId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"operationId":"postServicesByIdMailDomainsByDomainIdDkimActivate","description":"Escopo: `email:write`","security":[{"oauth2":["email:write"]},{"apiKey":[]}]}},"/services/{id}/mail/domains/{domainId}/dkim/prune":{"post":{"summary":"DKIM, passo 3: apaga as chaves aposentadas","tags":["E-mail"],"responses":{"200":{"description":"Domínio atualizado.","content":{"application/json":{"schema":{"type":"object","required":["id","domain","status","verified","verifiedAt","suspended","primary","createdAt","verification","dkim","access"],"properties":{"id":{"format":"uuid","type":"string"},"domain":{"type":"string"},"status":{"enum":["pending_verification","pending","active","suspended","deleting","failed"],"type":"string"},"verified":{"type":"boolean"},"verifiedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"suspended":{"type":"boolean"},"primary":{"description":"Domínio da compra; não pode ser removido.","type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"verification":{"anyOf":[{"type":"object","required":["type","name","value"],"properties":{"type":{"const":"TXT","type":"string"},"name":{"type":"string"},"value":{"type":"string"}}},{"type":"null"}]},"dkim":{"type":"array","items":{"type":"object","required":["selector","algorithm","stage","name"],"properties":{"selector":{"type":"string"},"algorithm":{"enum":["ed25519","rsa"],"type":"string"},"stage":{"enum":["pending","active","retiring","retired"],"type":"string"},"name":{"type":"string"}}}},"access":{"type":"object","required":["webmailUrl","imapHostname","smtpHostname"],"properties":{"webmailUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"imapHostname":{"type":"string"},"smtpHostname":{"type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}},{"name":"domainId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"operationId":"postServicesByIdMailDomainsByDomainIdDkimPrune","description":"Escopo: `email:write`","security":[{"oauth2":["email:write"]},{"apiKey":[]}]}},"/services/{id}/mail/domains/{domainId}/mailboxes":{"get":{"summary":"Lista as caixas do domínio com aliases e uso","tags":["E-mail"],"responses":{"200":{"description":"Caixas e uso.","content":{"application/json":{"schema":{"type":"object","required":["mailboxes","usage"],"properties":{"mailboxes":{"type":"array","items":{"type":"object","required":["id","domainId","localPart","address","displayName","quotaMb","status","active","aliases","createdAt"],"properties":{"id":{"format":"uuid","type":"string"},"domainId":{"format":"uuid","type":"string"},"localPart":{"type":"string"},"address":{"type":"string"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"quotaMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"status":{"enum":["pending","active","suspended","failed","deleting"],"type":"string"},"active":{"type":"boolean"},"aliases":{"type":"array","items":{"type":"object","required":["id","localPart","address"],"properties":{"id":{"format":"uuid","type":"string"},"localPart":{"type":"string"},"address":{"type":"string"}}}},"createdAt":{"format":"date-time","type":"string"}}}},"usage":{"anyOf":[{"type":"object","required":["domain","mailboxCount","aliasCount","allocatedQuotaMb","usedMb","largestMailboxQuotaMb"],"properties":{"domain":{"type":"string"},"mailboxCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"aliasCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"allocatedQuotaMb":{"type":"number"},"usedMb":{"type":"number"},"largestMailboxQuotaMb":{"type":"number"}}},{"type":"null"}]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}},{"name":"domainId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"operationId":"getServicesByIdMailDomainsByDomainIdMailboxes","description":"Escopo: `email:read`","security":[{"oauth2":["email:read"]},{"apiKey":[]}]},"post":{"summary":"Cria uma caixa de e-mail","description":"`quotaMb` ausente usa o padrão do plano. A senha só entra aqui e nunca volta.\n\nEscopo: `email:write`","tags":["E-mail"],"responses":{"201":{"description":"Caixa criada.","content":{"application/json":{"schema":{"type":"object","required":["id","domainId","localPart","address","displayName","quotaMb","status","active","aliases","createdAt"],"properties":{"id":{"format":"uuid","type":"string"},"domainId":{"format":"uuid","type":"string"},"localPart":{"type":"string"},"address":{"type":"string"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"quotaMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"status":{"enum":["pending","active","suspended","failed","deleting"],"type":"string"},"active":{"type":"boolean"},"aliases":{"type":"array","items":{"type":"object","required":["id","localPart","address"],"properties":{"id":{"format":"uuid","type":"string"},"localPart":{"type":"string"},"address":{"type":"string"}}}},"createdAt":{"format":"date-time","type":"string"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}},{"name":"domainId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["localPart","password"],"properties":{"localPart":{"minLength":1,"maxLength":64,"type":"string"},"displayName":{"maxLength":255,"type":["string","null"]},"quotaMb":{"minimum":1,"maximum":10485760,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":10485760,"type":"integer"}]},"password":{"minLength":8,"maxLength":128,"type":"string"}}}}}},"operationId":"postServicesByIdMailDomainsByDomainIdMailboxes","security":[{"oauth2":["email:write"]},{"apiKey":[]}]}},"/services/{id}/mail/mailboxes/{mailboxId}":{"patch":{"summary":"Altera a quota ou liga/desliga (suspende) uma caixa","tags":["E-mail"],"responses":{"200":{"description":"Caixa atualizada.","content":{"application/json":{"schema":{"type":"object","required":["id","domainId","localPart","address","displayName","quotaMb","status","active","aliases","createdAt"],"properties":{"id":{"format":"uuid","type":"string"},"domainId":{"format":"uuid","type":"string"},"localPart":{"type":"string"},"address":{"type":"string"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"quotaMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"status":{"enum":["pending","active","suspended","failed","deleting"],"type":"string"},"active":{"type":"boolean"},"aliases":{"type":"array","items":{"type":"object","required":["id","localPart","address"],"properties":{"id":{"format":"uuid","type":"string"},"localPart":{"type":"string"},"address":{"type":"string"}}}},"createdAt":{"format":"date-time","type":"string"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}},{"name":"mailboxId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"quotaMb":{"minimum":1,"maximum":10485760,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":10485760,"type":"integer"}]},"active":{"type":"boolean"}}}}}},"operationId":"patchServicesByIdMailMailboxesByMailboxId","description":"Escopo: `email:write`","security":[{"oauth2":["email:write"]},{"apiKey":[]}]},"delete":{"summary":"Apaga uma caixa e os aliases dela (vai para a lixeira)","description":"Assíncrono: a caixa fica `deleting` (congelada) e o worker copia o conteúdo para a lixeira antes de tirá-la do servidor. Acompanhe por `GET /jobs/:jobId`. Repetir devolve a tarefa ativa.\n\nEscopo: `email:write`","tags":["E-mail"],"responses":{"202":{"description":"Exclusão enfileirada: a própria tarefa.","content":{"application/json":{"schema":{"type":"object","required":["id","kind","targetLabel","status","mailboxId","domainId","backupId","trashId","progress","result","error","attempts","createdAt","startedAt","finishedAt"],"properties":{"id":{"format":"uuid","type":"string"},"kind":{"enum":["mailbox.delete","domain.remove","backup.restore","trash.restore"],"type":"string"},"targetLabel":{"description":"Endereço da caixa ou nome do domínio.","type":"string"},"status":{"enum":["queued","running","succeeded","failed"],"type":"string"},"mailboxId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"domainId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"backupId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"trashId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"progress":{"type":"object","required":["done","total"],"properties":{"done":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"total":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},"result":{"anyOf":[{"description":"Resumo ao terminar; os campos variam por `kind`.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}}]}}},{"type":"null"}]},"error":{"anyOf":[{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},{"type":"null"}]},"attempts":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"createdAt":{"format":"date-time","type":"string"},"startedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"finishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}},"headers":{"Location":{"description":"Endpoint para acompanhar a tarefa: `/api/v1/services/{id}/mail/jobs/{jobId}`.","schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}},{"name":"mailboxId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"operationId":"deleteServicesByIdMailMailboxesByMailboxId","security":[{"oauth2":["email:write"]},{"apiKey":[]}]}},"/services/{id}/mail/mailboxes/{mailboxId}/password":{"post":{"summary":"Troca a senha de uma caixa","tags":["E-mail"],"responses":{"204":{"description":"Senha trocada"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}},{"name":"mailboxId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["password"],"properties":{"password":{"minLength":8,"maxLength":128,"type":"string"}}}}}},"operationId":"postServicesByIdMailMailboxesByMailboxIdPassword","description":"Escopo: `email:write`","security":[{"oauth2":["email:write"]},{"apiKey":[]}]}},"/services/{id}/mail/mailboxes/{mailboxId}/aliases":{"put":{"summary":"Define a lista completa de aliases de uma caixa","description":"`aliases` são as partes locais (antes do `@`), no domínio da caixa. A lista substitui a atual.\n\nEscopo: `email:write`","tags":["E-mail"],"responses":{"200":{"description":"Caixa com os aliases novos.","content":{"application/json":{"schema":{"type":"object","required":["id","domainId","localPart","address","displayName","quotaMb","status","active","aliases","createdAt"],"properties":{"id":{"format":"uuid","type":"string"},"domainId":{"format":"uuid","type":"string"},"localPart":{"type":"string"},"address":{"type":"string"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"quotaMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"status":{"enum":["pending","active","suspended","failed","deleting"],"type":"string"},"active":{"type":"boolean"},"aliases":{"type":"array","items":{"type":"object","required":["id","localPart","address"],"properties":{"id":{"format":"uuid","type":"string"},"localPart":{"type":"string"},"address":{"type":"string"}}}},"createdAt":{"format":"date-time","type":"string"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}},{"name":"mailboxId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["aliases"],"properties":{"aliases":{"maxItems":100,"type":"array","items":{"minLength":1,"maxLength":64,"type":"string"}}}}}}},"operationId":"putServicesByIdMailMailboxesByMailboxIdAliases","security":[{"oauth2":["email:write"]},{"apiKey":[]}]}},"/services/{id}/mail/trash":{"get":{"summary":"Lixeira: caixas apagadas que ainda podem ser restauradas","description":"Cada item vale 30 dias a partir da exclusão; depois o conteúdo é apagado de vez.\n\nEscopo: `email:read`","tags":["E-mail"],"responses":{"200":{"description":"Itens da lixeira.","content":{"application/json":{"schema":{"type":"object","required":["items","retentionDays"],"properties":{"items":{"type":"array","items":{"type":"object","required":["id","domainId","domain","mailboxId","address","displayName","quotaMb","aliases","messageCount","totalBytes","reason","status","deletedAt","expiresAt","restorable","blockers","passwordRequired","job"],"properties":{"id":{"format":"uuid","type":"string"},"domainId":{"format":"uuid","type":"string"},"domain":{"type":"string"},"mailboxId":{"format":"uuid","type":"string"},"address":{"type":"string"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"quotaMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"aliases":{"type":"array","items":{"type":"string"}},"messageCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"totalBytes":{"type":"number"},"reason":{"enum":["customer","admin","domain_removed","service_terminated"],"type":"string"},"status":{"enum":["available","restoring","restored","purged"],"type":"string"},"deletedAt":{"format":"date-time","type":"string"},"expiresAt":{"format":"date-time","type":"string"},"restorable":{"type":"boolean"},"blockers":{"type":"array","items":{"enum":["expired","domain_missing","domain_not_ready","domain_suspended","address_taken","plan_limit"],"type":"string"}},"passwordRequired":{"type":"boolean"},"job":{"anyOf":[{"type":"object","required":["id","kind","targetLabel","status","mailboxId","domainId","backupId","trashId","progress","result","error","attempts","createdAt","startedAt","finishedAt"],"properties":{"id":{"format":"uuid","type":"string"},"kind":{"enum":["mailbox.delete","domain.remove","backup.restore","trash.restore"],"type":"string"},"targetLabel":{"description":"Endereço da caixa ou nome do domínio.","type":"string"},"status":{"enum":["queued","running","succeeded","failed"],"type":"string"},"mailboxId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"domainId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"backupId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"trashId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"progress":{"type":"object","required":["done","total"],"properties":{"done":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"total":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},"result":{"anyOf":[{"description":"Resumo ao terminar; os campos variam por `kind`.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}}]}}},{"type":"null"}]},"error":{"anyOf":[{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},{"type":"null"}]},"attempts":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"createdAt":{"format":"date-time","type":"string"},"startedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"finishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}},"retentionDays":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"operationId":"getServicesByIdMailTrash","security":[{"oauth2":["email:read"]},{"apiKey":[]}]}},"/services/{id}/mail/trash/{trashId}/restore":{"post":{"summary":"Restaura uma caixa da lixeira no mesmo endereço","description":"Assíncrono (tarefa `trash.restore`). Volta com a senha antiga; `password` só é obrigatório quando o item tem `passwordRequired`. Recusa endereço já reutilizado, domínio ausente/suspenso ou plano sem espaço.\n\nEscopo: `email:write`","tags":["E-mail"],"responses":{"202":{"description":"Restauração enfileirada: a própria tarefa.","content":{"application/json":{"schema":{"type":"object","required":["id","kind","targetLabel","status","mailboxId","domainId","backupId","trashId","progress","result","error","attempts","createdAt","startedAt","finishedAt"],"properties":{"id":{"format":"uuid","type":"string"},"kind":{"enum":["mailbox.delete","domain.remove","backup.restore","trash.restore"],"type":"string"},"targetLabel":{"description":"Endereço da caixa ou nome do domínio.","type":"string"},"status":{"enum":["queued","running","succeeded","failed"],"type":"string"},"mailboxId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"domainId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"backupId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"trashId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"progress":{"type":"object","required":["done","total"],"properties":{"done":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"total":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},"result":{"anyOf":[{"description":"Resumo ao terminar; os campos variam por `kind`.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}}]}}},{"type":"null"}]},"error":{"anyOf":[{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},{"type":"null"}]},"attempts":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"createdAt":{"format":"date-time","type":"string"},"startedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"finishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}},"headers":{"Location":{"description":"Endpoint para acompanhar a tarefa: `/api/v1/services/{id}/mail/jobs/{jobId}`.","schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}},{"name":"trashId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"minLength":8,"maxLength":128,"type":"string"}}}}}},"operationId":"postServicesByIdMailTrashByTrashIdRestore","security":[{"oauth2":["email:write"]},{"apiKey":[]}]}},"/services/{id}/mail/mailboxes/{mailboxId}/backups":{"get":{"summary":"Backups diários de uma caixa","description":"Um por dia, guardados por 7 dias; do mais novo para o mais antigo.\n\nEscopo: `email:read`","tags":["E-mail"],"responses":{"200":{"description":"Backups da caixa.","content":{"application/json":{"schema":{"type":"object","required":["backups","retentionDays"],"properties":{"backups":{"type":"array","items":{"type":"object","required":["id","mailboxId","address","messageCount","totalBytes","createdAt","completedAt","expiresAt"],"properties":{"id":{"format":"uuid","type":"string"},"mailboxId":{"format":"uuid","type":"string"},"address":{"type":"string"},"messageCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"totalBytes":{"type":"number"},"createdAt":{"format":"date-time","type":"string"},"completedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"expiresAt":{"format":"date-time","type":"string"}}}},"retentionDays":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}},{"name":"mailboxId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"operationId":"getServicesByIdMailMailboxesByMailboxIdBackups","security":[{"oauth2":["email:read"]},{"apiKey":[]}]}},"/services/{id}/mail/mailboxes/{mailboxId}/backups/{backupId}/restore":{"post":{"summary":"Restaura um backup na própria caixa, sem apagar nada","description":"Assíncrono (tarefa `backup.restore`). As mensagens voltam na pasta `Restaurado AAAA-MM-DD` (com as subpastas originais); as que já estão na caixa são puladas.\n\nEscopo: `email:write`","tags":["E-mail"],"responses":{"202":{"description":"Restauração enfileirada: a própria tarefa.","content":{"application/json":{"schema":{"type":"object","required":["id","kind","targetLabel","status","mailboxId","domainId","backupId","trashId","progress","result","error","attempts","createdAt","startedAt","finishedAt"],"properties":{"id":{"format":"uuid","type":"string"},"kind":{"enum":["mailbox.delete","domain.remove","backup.restore","trash.restore"],"type":"string"},"targetLabel":{"description":"Endereço da caixa ou nome do domínio.","type":"string"},"status":{"enum":["queued","running","succeeded","failed"],"type":"string"},"mailboxId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"domainId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"backupId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"trashId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"progress":{"type":"object","required":["done","total"],"properties":{"done":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"total":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},"result":{"anyOf":[{"description":"Resumo ao terminar; os campos variam por `kind`.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}}]}}},{"type":"null"}]},"error":{"anyOf":[{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},{"type":"null"}]},"attempts":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"createdAt":{"format":"date-time","type":"string"},"startedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"finishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}},"headers":{"Location":{"description":"Endpoint para acompanhar a tarefa: `/api/v1/services/{id}/mail/jobs/{jobId}`.","schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}},{"name":"mailboxId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}},{"name":"backupId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"operationId":"postServicesByIdMailMailboxesByMailboxIdBackupsByBackupIdRestore","security":[{"oauth2":["email:write"]},{"apiKey":[]}]}},"/services/{id}/mail/jobs":{"get":{"summary":"Tarefas de e-mail do serviço (exclusões e restaurações), mais novas primeiro","tags":["E-mail"],"responses":{"200":{"description":"Tarefas.","content":{"application/json":{"schema":{"type":"object","required":["jobs"],"properties":{"jobs":{"type":"array","items":{"type":"object","required":["id","kind","targetLabel","status","mailboxId","domainId","backupId","trashId","progress","result","error","attempts","createdAt","startedAt","finishedAt"],"properties":{"id":{"format":"uuid","type":"string"},"kind":{"enum":["mailbox.delete","domain.remove","backup.restore","trash.restore"],"type":"string"},"targetLabel":{"description":"Endereço da caixa ou nome do domínio.","type":"string"},"status":{"enum":["queued","running","succeeded","failed"],"type":"string"},"mailboxId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"domainId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"backupId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"trashId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"progress":{"type":"object","required":["done","total"],"properties":{"done":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"total":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},"result":{"anyOf":[{"description":"Resumo ao terminar; os campos variam por `kind`.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}}]}}},{"type":"null"}]},"error":{"anyOf":[{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},{"type":"null"}]},"attempts":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"createdAt":{"format":"date-time","type":"string"},"startedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"finishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"operationId":"getServicesByIdMailJobs","description":"Escopo: `email:read`","security":[{"oauth2":["email:read"]},{"apiKey":[]}]}},"/services/{id}/mail/jobs/{jobId}":{"get":{"summary":"Situação de uma tarefa de e-mail","tags":["E-mail"],"responses":{"200":{"description":"Tarefa.","content":{"application/json":{"schema":{"type":"object","required":["id","kind","targetLabel","status","mailboxId","domainId","backupId","trashId","progress","result","error","attempts","createdAt","startedAt","finishedAt"],"properties":{"id":{"format":"uuid","type":"string"},"kind":{"enum":["mailbox.delete","domain.remove","backup.restore","trash.restore"],"type":"string"},"targetLabel":{"description":"Endereço da caixa ou nome do domínio.","type":"string"},"status":{"enum":["queued","running","succeeded","failed"],"type":"string"},"mailboxId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"domainId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"backupId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"trashId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"progress":{"type":"object","required":["done","total"],"properties":{"done":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"total":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},"result":{"anyOf":[{"description":"Resumo ao terminar; os campos variam por `kind`.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}}]}}},{"type":"null"}]},"error":{"anyOf":[{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},{"type":"null"}]},"attempts":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"createdAt":{"format":"date-time","type":"string"},"startedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"finishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}},{"name":"jobId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"operationId":"getServicesByIdMailJobsByJobId","description":"Escopo: `email:read`","security":[{"oauth2":["email:read"]},{"apiKey":[]}]}},"/services":{"get":{"summary":"Lista os serviços da conta","description":"Devolve os serviços da conta, do mais antigo ao mais novo, com produto, categoria e plano.\n\nEscopo: `services:read`","tags":["Serviços"],"responses":{"200":{"description":"Serviços.","content":{"application/json":{"schema":{"type":"object","required":["services"],"properties":{"services":{"type":"array","items":{"type":"object","required":["id","userId","productId","planId","status","billingCycle","nextDueDate","suspendedAt","terminatedAt","moduleData","domain","nickname","priceCents","hostingKind","createdAt","updatedAt","product","planName"],"properties":{"id":{"format":"uuid","type":"string"},"userId":{"format":"uuid","type":"string"},"productId":{"format":"uuid","type":"string"},"planId":{"format":"uuid","type":"string"},"status":{"enum":["pending","provisioning","active","failed_provisioning","suspending","suspended","unsuspending","terminating","terminated"],"type":"string"},"billingCycle":{"enum":["monthly","quarterly","semi_annually","annually","biennially","triennially"],"type":"string"},"nextDueDate":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"suspendedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"terminatedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"moduleData":{"description":"Dados do módulo que provisiona o serviço (variam por produto).","type":"object","patternProperties":{"^(.*)$":{}}},"domain":{"anyOf":[{"description":"Domínio ou hostname informado na compra.","type":"string"},{"type":"null"}]},"nickname":{"anyOf":[{"maxLength":60,"description":"Apelido dado pelo cliente no painel.","type":"string"},{"type":"null"}]},"priceCents":{"pattern":"^[0-9]+$","description":"Valor da renovação no ciclo `billingCycle`, em centavos (string): preço por unidade × unidades. `0` em serviço sem cobrança.","type":"string"},"hostingKind":{"anyOf":[{"enum":["site","database","bot"],"description":"Tipo da conta de hospedagem; `null` quando o serviço não tem conta.","type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"product":{"anyOf":[{"type":"object","required":["name","slug","moduleName","categorySlug"],"properties":{"name":{"type":"string"},"slug":{"type":"string"},"moduleName":{"enum":["virtfusion","hosting","mailcow","mail","domain_registrar","none"],"type":"string"},"categorySlug":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"planName":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"getServices","security":[{"oauth2":["services:read"]},{"apiKey":[]}]}},"/services/{id}":{"get":{"summary":"Detalha um serviço","description":"Mesmo formato de um item de `GET /services`. O dono do serviço e a equipe com permissão de gerenciar qualquer serviço podem ler.\n\nEscopo: `services:read`","tags":["Serviços"],"responses":{"200":{"description":"Serviço.","content":{"application/json":{"schema":{"type":"object","required":["service"],"properties":{"service":{"type":"object","required":["id","userId","productId","planId","status","billingCycle","nextDueDate","suspendedAt","terminatedAt","moduleData","domain","nickname","priceCents","hostingKind","createdAt","updatedAt","product","planName"],"properties":{"id":{"format":"uuid","type":"string"},"userId":{"format":"uuid","type":"string"},"productId":{"format":"uuid","type":"string"},"planId":{"format":"uuid","type":"string"},"status":{"enum":["pending","provisioning","active","failed_provisioning","suspending","suspended","unsuspending","terminating","terminated"],"type":"string"},"billingCycle":{"enum":["monthly","quarterly","semi_annually","annually","biennially","triennially"],"type":"string"},"nextDueDate":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"suspendedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"terminatedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"moduleData":{"description":"Dados do módulo que provisiona o serviço (variam por produto).","type":"object","patternProperties":{"^(.*)$":{}}},"domain":{"anyOf":[{"description":"Domínio ou hostname informado na compra.","type":"string"},{"type":"null"}]},"nickname":{"anyOf":[{"maxLength":60,"description":"Apelido dado pelo cliente no painel.","type":"string"},{"type":"null"}]},"priceCents":{"pattern":"^[0-9]+$","description":"Valor da renovação no ciclo `billingCycle`, em centavos (string): preço por unidade × unidades. `0` em serviço sem cobrança.","type":"string"},"hostingKind":{"anyOf":[{"enum":["site","database","bot"],"description":"Tipo da conta de hospedagem; `null` quando o serviço não tem conta.","type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"product":{"anyOf":[{"type":"object","required":["name","slug","moduleName","categorySlug"],"properties":{"name":{"type":"string"},"slug":{"type":"string"},"moduleName":{"enum":["virtfusion","hosting","mailcow","mail","domain_registrar","none"],"type":"string"},"categorySlug":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"planName":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"operationId":"getServicesById","security":[{"oauth2":["services:read"]},{"apiKey":[]}]}},"/services/{id}/suspend":{"post":{"summary":"Suspende um serviço","tags":["Serviços"],"responses":{"200":{"description":"Serviço suspenso.","content":{"application/json":{"schema":{"type":"object","required":["service"],"properties":{"service":{"additionalProperties":true,"type":"object","required":["id","userId","productId","planId","status","billingCycle","nextDueDate","suspendedAt","terminatedAt","suspensionCause","moduleData","createdAt","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"userId":{"format":"uuid","type":"string"},"productId":{"format":"uuid","type":"string"},"planId":{"format":"uuid","type":"string"},"status":{"enum":["pending","provisioning","active","failed_provisioning","suspending","suspended","unsuspending","terminating","terminated"],"type":"string"},"billingCycle":{"enum":["monthly","quarterly","semi_annually","annually","biennially","triennially"],"type":"string"},"nextDueDate":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"suspendedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"terminatedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"suspensionCause":{"anyOf":[{"enum":["billing","admin","customer","abuse"],"type":"string"},{"type":"null"}]},"moduleData":{"description":"Dados do módulo que provisiona o serviço (variam por produto).","type":"object","patternProperties":{"^(.*)$":{}}},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postServicesByIdSuspend","description":"Escopo: `services:write`","security":[{"oauth2":["services:write"]},{"apiKey":[]}]}},"/services/{id}/unsuspend":{"post":{"summary":"Reativa um serviço suspenso","tags":["Serviços"],"responses":{"200":{"description":"Serviço reativado.","content":{"application/json":{"schema":{"type":"object","required":["service"],"properties":{"service":{"additionalProperties":true,"type":"object","required":["id","userId","productId","planId","status","billingCycle","nextDueDate","suspendedAt","terminatedAt","suspensionCause","moduleData","createdAt","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"userId":{"format":"uuid","type":"string"},"productId":{"format":"uuid","type":"string"},"planId":{"format":"uuid","type":"string"},"status":{"enum":["pending","provisioning","active","failed_provisioning","suspending","suspended","unsuspending","terminating","terminated"],"type":"string"},"billingCycle":{"enum":["monthly","quarterly","semi_annually","annually","biennially","triennially"],"type":"string"},"nextDueDate":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"suspendedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"terminatedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"suspensionCause":{"anyOf":[{"enum":["billing","admin","customer","abuse"],"type":"string"},{"type":"null"}]},"moduleData":{"description":"Dados do módulo que provisiona o serviço (variam por produto).","type":"object","patternProperties":{"^(.*)$":{}}},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postServicesByIdUnsuspend","description":"Escopo: `services:write`","security":[{"oauth2":["services:write"]},{"apiKey":[]}]}},"/services/{id}/nickname":{"patch":{"summary":"Dá um apelido ao serviço","description":"Só o titular. Até 60 caracteres; espaços repetidos viram um. `null` ou texto vazio apaga o apelido. A equipe e o \"entrar como\" recebem 403.\n\nEscopo: `services:write`","tags":["Serviços"],"responses":{"200":{"description":"Apelido gravado.","content":{"application/json":{"schema":{"type":"object","required":["service"],"properties":{"service":{"type":"object","required":["id","nickname"],"properties":{"id":{"format":"uuid","type":"string"},"nickname":{"anyOf":[{"maxLength":60,"description":"`null` = sem apelido.","type":"string"},{"type":"null"}]}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["nickname"],"properties":{"nickname":{"maxLength":200,"type":["string","null"]}}}}}},"operationId":"patchServicesByIdNickname","security":[{"oauth2":["services:write"]},{"apiKey":[]}]}},"/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"],"responses":{"200":{"description":"Serviço encerrado.","content":{"application/json":{"schema":{"type":"object","required":["service"],"properties":{"service":{"additionalProperties":true,"type":"object","required":["id","userId","productId","planId","status","billingCycle","nextDueDate","suspendedAt","terminatedAt","suspensionCause","moduleData","createdAt","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"userId":{"format":"uuid","type":"string"},"productId":{"format":"uuid","type":"string"},"planId":{"format":"uuid","type":"string"},"status":{"enum":["pending","provisioning","active","failed_provisioning","suspending","suspended","unsuspending","terminating","terminated"],"type":"string"},"billingCycle":{"enum":["monthly","quarterly","semi_annually","annually","biennially","triennially"],"type":"string"},"nextDueDate":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"suspendedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"terminatedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"suspensionCause":{"anyOf":[{"enum":["billing","admin","customer","abuse"],"type":"string"},{"type":"null"}]},"moduleData":{"description":"Dados do módulo que provisiona o serviço (variam por produto).","type":"object","patternProperties":{"^(.*)$":{}}},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postServicesByIdTerminate","security":[{"oauth2":["services:write"]},{"apiKey":[]}]}},"/tickets":{"post":{"summary":"Abre um ticket","description":"Abre um ticket em nome da conta do token, com a primeira mensagem. `serviceId` (opcional) liga o ticket a um serviço da própria conta; serviço de outra conta ou inexistente dá 404. Devolve o ticket e essa mensagem.\n\nEscopo: `tickets:write`","tags":["Tickets"],"responses":{"201":{"description":"Ticket aberto.","content":{"application/json":{"schema":{"type":"object","required":["ticket","firstReply"],"properties":{"ticket":{"type":"object","required":["id","userId","serviceId","subject","department","priority","status","createdAt","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"userId":{"format":"uuid","type":"string"},"serviceId":{"anyOf":[{"format":"uuid","description":"Serviço da própria conta sobre o qual é o ticket; `null` = assunto geral.","type":"string"},{"type":"null"}]},"subject":{"type":"string"},"department":{"anyOf":[{"type":"string"},{"type":"null"}]},"priority":{"enum":["low","medium","high"],"type":"string"},"status":{"enum":["open","answered","customer_reply","closed"],"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}},"firstReply":{"type":"object","required":["id","ticketId","userId","message","isStaff","createdAt","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"ticketId":{"format":"uuid","type":"string"},"userId":{"format":"uuid","type":"string"},"message":{"type":"string"},"isStaff":{"description":"`true` quando quem respondeu foi a equipe.","type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}}}}},"400":{"$ref":"#/components/responses/IdempotencyKeyInvalid"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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"]},"serviceId":{"format":"uuid","type":"string"}}}}}},"operationId":"postTickets","security":[{"oauth2":["tickets:write"]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]},"get":{"summary":"Lista os tickets da conta","description":"Devolve os tickets da conta com o total de respostas de cada um e a contagem por estado. Filtre pelo estado com `status`.\n\nEscopo: `tickets:read`","tags":["Tickets"],"responses":{"200":{"description":"Tickets e contagem.","content":{"application/json":{"schema":{"type":"object","required":["tickets","counts"],"properties":{"tickets":{"type":"array","items":{"type":"object","required":["id","userId","serviceId","subject","department","priority","status","createdAt","updatedAt","replyCount"],"properties":{"id":{"format":"uuid","type":"string"},"userId":{"format":"uuid","type":"string"},"serviceId":{"anyOf":[{"format":"uuid","description":"Serviço da própria conta sobre o qual é o ticket; `null` = assunto geral.","type":"string"},{"type":"null"}]},"subject":{"type":"string"},"department":{"anyOf":[{"type":"string"},{"type":"null"}]},"priority":{"enum":["low","medium","high"],"type":"string"},"status":{"enum":["open","answered","customer_reply","closed"],"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"replyCount":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]}}}},"counts":{"description":"Total por estado, sem o filtro `status`.","type":"object","required":["open","answered","customer_reply","closed"],"properties":{"open":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"answered":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"customer_reply":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"closed":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","answered","customer_reply","closed"]}}],"operationId":"getTickets","security":[{"oauth2":["tickets:read"]},{"apiKey":[]}]}},"/tickets/{id}":{"get":{"summary":"Detalha um ticket com as respostas","description":"Devolve o ticket e todas as mensagens dele, da mais antiga à mais nova.\n\nEscopo: `tickets:read`","tags":["Tickets"],"responses":{"200":{"description":"Ticket e respostas.","content":{"application/json":{"schema":{"type":"object","required":["ticket","replies"],"properties":{"ticket":{"type":"object","required":["id","userId","serviceId","subject","department","priority","status","createdAt","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"userId":{"format":"uuid","type":"string"},"serviceId":{"anyOf":[{"format":"uuid","description":"Serviço da própria conta sobre o qual é o ticket; `null` = assunto geral.","type":"string"},{"type":"null"}]},"subject":{"type":"string"},"department":{"anyOf":[{"type":"string"},{"type":"null"}]},"priority":{"enum":["low","medium","high"],"type":"string"},"status":{"enum":["open","answered","customer_reply","closed"],"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}},"replies":{"type":"array","items":{"type":"object","required":["id","ticketId","userId","message","isStaff","createdAt","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"ticketId":{"format":"uuid","type":"string"},"userId":{"format":"uuid","type":"string"},"message":{"type":"string"},"isStaff":{"description":"`true` quando quem respondeu foi a equipe.","type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getTicketsById","security":[{"oauth2":["tickets:read"]},{"apiKey":[]}]}},"/tickets/{id}/reply":{"post":{"summary":"Responde a um ticket","tags":["Tickets"],"responses":{"200":{"description":"Resposta gravada.","content":{"application/json":{"schema":{"type":"object","required":["reply"],"properties":{"reply":{"type":"object","required":["id","ticketId","userId","message","isStaff","createdAt","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"ticketId":{"format":"uuid","type":"string"},"userId":{"format":"uuid","type":"string"},"message":{"type":"string"},"isStaff":{"description":"`true` quando quem respondeu foi a equipe.","type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}}}}},"400":{"$ref":"#/components/responses/IdempotencyKeyInvalid"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"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":[]}]}},"/tickets/{id}/close":{"post":{"summary":"Fecha um ticket","tags":["Tickets"],"responses":{"200":{"description":"Ticket fechado.","content":{"application/json":{"schema":{"type":"object","required":["ticket"],"properties":{"ticket":{"type":"object","required":["id","userId","serviceId","subject","department","priority","status","createdAt","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"userId":{"format":"uuid","type":"string"},"serviceId":{"anyOf":[{"format":"uuid","description":"Serviço da própria conta sobre o qual é o ticket; `null` = assunto geral.","type":"string"},{"type":"null"}]},"subject":{"type":"string"},"department":{"anyOf":[{"type":"string"},{"type":"null"}]},"priority":{"enum":["low","medium","high"],"type":"string"},"status":{"enum":["open","answered","customer_reply","closed"],"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postTicketsByIdClose","description":"Escopo: `tickets:write`","security":[{"oauth2":["tickets:write"]},{"apiKey":[]}]}},"/tickets/{id}/reopen":{"post":{"summary":"Reabre um ticket","tags":["Tickets"],"responses":{"200":{"description":"Ticket reaberto.","content":{"application/json":{"schema":{"type":"object","required":["ticket"],"properties":{"ticket":{"type":"object","required":["id","userId","serviceId","subject","department","priority","status","createdAt","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"userId":{"format":"uuid","type":"string"},"serviceId":{"anyOf":[{"format":"uuid","description":"Serviço da própria conta sobre o qual é o ticket; `null` = assunto geral.","type":"string"},{"type":"null"}]},"subject":{"type":"string"},"department":{"anyOf":[{"type":"string"},{"type":"null"}]},"priority":{"enum":["low","medium","high"],"type":"string"},"status":{"enum":["open","answered","customer_reply","closed"],"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postTicketsByIdReopen","description":"Escopo: `tickets:write`","security":[{"oauth2":["tickets:write"]},{"apiKey":[]}]}},"/help/categories":{"get":{"summary":"Categorias da central de ajuda","description":"Pública, sem autenticação. Devolve as categorias da central de ajuda com seus dados de exibição.","tags":["Ajuda"],"responses":{"200":{"description":"Categorias visíveis.","content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","title","description","icon","position","parentId","articleCount"],"properties":{"id":{"format":"uuid","type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"icon":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"parentId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"articleCount":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]}}}}}}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"getHelpCategories","security":[]}},"/help/categories/{slug}":{"get":{"summary":"Categoria e seus artigos","description":"Pública, sem autenticação. Devolve a categoria pelo `slug` e a lista resumida dos artigos dela.","tags":["Ajuda"],"responses":{"200":{"description":"Categoria e artigos.","content":{"application/json":{"schema":{"type":"object","required":["category","articles"],"properties":{"category":{"type":"object","required":["id","slug","title","description","icon","position","parentId","articleCount"],"properties":{"id":{"format":"uuid","type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"icon":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"parentId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"articleCount":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]}}},"articles":{"type":"array","items":{"type":"object","required":["id","slug","categorySlug","title","summary","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"slug":{"type":"string"},"categorySlug":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}}}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"slug","in":"path","required":true,"schema":{"minLength":1,"maxLength":120,"type":"string"}}],"operationId":"getHelpCategoriesBySlug","security":[]}},"/help/articles/{slug}":{"get":{"summary":"Artigo da central","description":"Pública, sem autenticação. Devolve o artigo pelo `slug`, a categoria dele e artigos relacionados.","tags":["Ajuda"],"responses":{"200":{"description":"Artigo, categoria e relacionados.","content":{"application/json":{"schema":{"type":"object","required":["article","category","related"],"properties":{"article":{"type":"object","required":["id","slug","categorySlug","title","summary","body","audience","keywords","publishedAt","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"slug":{"type":"string"},"categorySlug":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"body":{"type":"string"},"audience":{"enum":["public","customers","internal"],"type":"string"},"keywords":{"type":"array","items":{"type":"string"}},"publishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"updatedAt":{"format":"date-time","type":"string"}}},"category":{"type":"object","required":["id","slug","title","description","icon","position","parentId","articleCount"],"properties":{"id":{"format":"uuid","type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"icon":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"parentId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"articleCount":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]}}},"related":{"type":"array","items":{"type":"object","required":["id","slug","categorySlug","title","summary","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"slug":{"type":"string"},"categorySlug":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}}}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"slug","in":"path","required":true,"schema":{"minLength":1,"maxLength":120,"type":"string"}}],"operationId":"getHelpArticlesBySlug","security":[]}},"/help/search":{"get":{"summary":"Busca na central de ajuda","description":"Pública, sem autenticação. Busca artigos pelo texto de `q` (2 a 200 caracteres) e devolve os resultados.","tags":["Ajuda"],"responses":{"200":{"description":"Artigos encontrados.","content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","categorySlug","title","summary","excerpt","audience"],"properties":{"id":{"format":"uuid","type":"string"},"slug":{"type":"string"},"categorySlug":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"excerpt":{"description":"Trecho do artigo com o termo buscado.","type":"string"},"audience":{"enum":["public","customers","internal"],"type":"string"}}}}}}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"q","in":"query","required":true,"schema":{"minLength":2,"maxLength":200,"type":"string"}}],"operationId":"getHelpSearch","security":[]}},"/help/articles/{slug}/view":{"post":{"summary":"Conta uma visualização","description":"Pública, sem autenticação. Registra uma leitura do artigo; responde 204 sem corpo.","tags":["Ajuda"],"responses":{"204":{"description":"Sem conteúdo."},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"slug","in":"path","required":true,"schema":{"minLength":1,"maxLength":120,"type":"string"}}],"operationId":"postHelpArticlesBySlugView","security":[]}},"/help/articles/{slug}/feedback":{"post":{"summary":"Este artigo ajudou?","description":"Pública, sem autenticação. Registra se o artigo ajudou (`helpful`). Devolve `recorded: false` quando o mesmo IP já votou neste artigo há pouco.","tags":["Ajuda"],"responses":{"200":{"description":"Se o voto contou.","content":{"application/json":{"schema":{"type":"object","required":["recorded"],"properties":{"recorded":{"description":"`false` quando o mesmo IP já votou neste artigo há pouco.","type":"boolean"}}}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"slug","in":"path","required":true,"schema":{"minLength":1,"maxLength":120,"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["helpful"],"properties":{"helpful":{"type":"boolean"}}}}}},"operationId":"postHelpArticlesBySlugFeedback","security":[]}},"/affiliates/program":{"get":{"summary":"Regras e taxas públicas do programa de afiliados","description":"Pública, sem autenticação. Devolve as regras vigentes do programa de afiliados: se aceita inscrições, validade do cookie, carência, mínimos e meios de saque, comissão padrão e por produto, e a versão dos termos.","tags":["Afiliados"],"responses":{"200":{"description":"Regras vigentes.","content":{"application/json":{"schema":{"type":"object","required":["applicationsOpen","cookieDays","holdDays","minPixPayoutCents","minCreditPayoutCents","payoutMethods","defaultRule","productRules","termsVersion"],"properties":{"applicationsOpen":{"type":"boolean"},"cookieDays":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"holdDays":{"minimum":0,"description":"Carência até a comissão ficar disponível.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"description":"Carência até a comissão ficar disponível.","type":"integer"}]},"minPixPayoutCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"minCreditPayoutCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"payoutMethods":{"type":"array","items":{"enum":["credit","pix"],"type":"string"}},"defaultRule":{"type":"object","required":["rateBps","maxPayments"],"properties":{"rateBps":{"minimum":0,"description":"Taxa em pontos-base (1000 = 10%).","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"description":"Taxa em pontos-base (1000 = 10%).","type":"integer"}]},"maxPayments":{"anyOf":[{"minimum":1,"description":"Pagamentos que geram comissão; `null` = todos.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"description":"Pagamentos que geram comissão; `null` = todos.","type":"integer"}]},{"type":"null"}]}}},"productRules":{"type":"array","items":{"type":"object","required":["productId","productName","productSlug","categorySlug","rateBps","maxPayments"],"properties":{"productId":{"format":"uuid","type":"string"},"productName":{"type":"string"},"productSlug":{"type":"string"},"categorySlug":{"type":"string"},"rateBps":{"minimum":0,"description":"Taxa em pontos-base (1000 = 10%).","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"description":"Taxa em pontos-base (1000 = 10%).","type":"integer"}]},"maxPayments":{"anyOf":[{"minimum":1,"description":"Pagamentos que geram comissão; `null` = todos.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"description":"Pagamentos que geram comissão; `null` = todos.","type":"integer"}]},{"type":"null"}]}}}},"termsVersion":{"type":"string"}}}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"getAffiliatesProgram","security":[]}},"/affiliates/click":{"post":{"summary":"Registra um clique de indicação (público, limite por IP)","description":"Pública, sem autenticação. Registra o clique num link `?ref=` e devolve `clickId` (valor do cookie de indicação; `null` para robô) e `cookieDays`. Código inexistente ou afiliado suspenso responde 404; acima do limite por IP, 429.","tags":["Afiliados"],"responses":{"200":{"description":"Clique registrado.","content":{"application/json":{"schema":{"type":"object","required":["clickId","cookieDays"],"properties":{"clickId":{"anyOf":[{"description":"Valor do cookie de indicação; `null` para robô.","type":"string"},{"type":"null"}]},"cookieDays":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]}}}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"minLength":1,"maxLength":64,"type":"string"},"previousClickId":{"maxLength":64,"type":["string","null"]},"landingUrl":{"maxLength":2000,"type":["string","null"]},"referrerUrl":{"maxLength":2000,"type":["string","null"]}}}}}},"operationId":"postAffiliatesClick","security":[]}},"/affiliates/me":{"get":{"summary":"Situação do usuário no programa de afiliados","tags":["Afiliados"],"responses":{"200":{"description":"Situação, pedido, conta e saldos.","content":{"application/json":{"schema":{"type":"object","required":["state","canApply","applyBlockedReason","reapplyAt","application","affiliate","balances","program"],"properties":{"state":{"enum":["none","pending","rejected","cancelled","active","suspended"],"type":"string"},"canApply":{"type":"boolean"},"applyBlockedReason":{"anyOf":[{"enum":["program_closed","staff","profile_incomplete","cooldown","pending","affiliate"],"type":"string"},{"type":"null"}]},"reapplyAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"application":{"anyOf":[{"type":"object","required":["id","status","websiteUrl","channels","message","decisionReason","createdAt","reviewedAt"],"properties":{"id":{"format":"uuid","type":"string"},"status":{"enum":["pending","approved","rejected","cancelled"],"type":"string"},"websiteUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"channels":{"type":"array","items":{"enum":["website","blog","youtube","instagram","tiktok","x","facebook","linkedin","whatsapp_telegram","discord","newsletter","paid_ads","other"],"type":"string"}},"message":{"type":"string"},"decisionReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"reviewedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}},{"type":"null"}]},"affiliate":{"anyOf":[{"type":"object","required":["id","code","status","suspensionReason","createdAt","pixKey"],"properties":{"id":{"format":"uuid","type":"string"},"code":{"type":"string"},"status":{"enum":["active","suspended"],"type":"string"},"suspensionReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"pixKey":{"anyOf":[{"type":"object","required":["type","hint","updatedAt"],"properties":{"type":{"enum":["cpf","cnpj","email","phone","random"],"type":"string"},"hint":{"type":"string"},"updatedAt":{"format":"date-time","type":"string"}}},{"type":"null"}]}}},{"type":"null"}]},"balances":{"anyOf":[{"type":"object","required":["pendingCents","availableCents","requestedCents","paidCents"],"properties":{"pendingCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"availableCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"requestedCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"paidCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"}}},{"type":"null"}]},"program":{"type":"object","required":["applicationsOpen","cookieDays","holdDays","minPixPayoutCents","minCreditPayoutCents","payoutMethods","defaultRule","productRules","termsVersion"],"properties":{"applicationsOpen":{"type":"boolean"},"cookieDays":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"holdDays":{"minimum":0,"description":"Carência até a comissão ficar disponível.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"description":"Carência até a comissão ficar disponível.","type":"integer"}]},"minPixPayoutCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"minCreditPayoutCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"payoutMethods":{"type":"array","items":{"enum":["credit","pix"],"type":"string"}},"defaultRule":{"type":"object","required":["rateBps","maxPayments"],"properties":{"rateBps":{"minimum":0,"description":"Taxa em pontos-base (1000 = 10%).","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"description":"Taxa em pontos-base (1000 = 10%).","type":"integer"}]},"maxPayments":{"anyOf":[{"minimum":1,"description":"Pagamentos que geram comissão; `null` = todos.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"description":"Pagamentos que geram comissão; `null` = todos.","type":"integer"}]},{"type":"null"}]}}},"productRules":{"type":"array","items":{"type":"object","required":["productId","productName","productSlug","categorySlug","rateBps","maxPayments"],"properties":{"productId":{"format":"uuid","type":"string"},"productName":{"type":"string"},"productSlug":{"type":"string"},"categorySlug":{"type":"string"},"rateBps":{"minimum":0,"description":"Taxa em pontos-base (1000 = 10%).","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"description":"Taxa em pontos-base (1000 = 10%).","type":"integer"}]},"maxPayments":{"anyOf":[{"minimum":1,"description":"Pagamentos que geram comissão; `null` = todos.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"description":"Pagamentos que geram comissão; `null` = todos.","type":"integer"}]},{"type":"null"}]}}}},"termsVersion":{"type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"getAffiliatesMe","description":"Escopo: `account:read`","security":[{"oauth2":["account:read"]},{"apiKey":[]}]}},"/affiliates/me/summary":{"get":{"summary":"Resumo de desempenho do afiliado","tags":["Afiliados"],"responses":{"200":{"description":"Totais do período e série diária.","content":{"application/json":{"schema":{"type":"object","required":["periodDays","clicks","signups","referrals","orders","paidOrders","earnedCents","series"],"properties":{"periodDays":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"clicks":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"signups":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"referrals":{"minimum":0,"description":"Vínculos ativos no total, não só no período.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"description":"Vínculos ativos no total, não só no período.","type":"integer"}]},"orders":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"paidOrders":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"earnedCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"series":{"type":"array","items":{"type":"object","required":["date","clicks","orders","earnedCents"],"properties":{"date":{"format":"date","description":"`AAAA-MM-DD` em America/Sao_Paulo.","type":"string"},"clicks":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"orders":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"earnedCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"string","enum":["7","30","90"]}}],"operationId":"getAffiliatesMeSummary","description":"Escopo: `account:read`","security":[{"oauth2":["account:read"]},{"apiKey":[]}]}},"/affiliates/me/rates":{"get":{"summary":"Taxas efetivas do afiliado por produto","tags":["Afiliados"],"responses":{"200":{"description":"Taxa de cada produto.","content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","required":["productId","productName","categoryName","rateBps","maxPayments","level"],"properties":{"productId":{"format":"uuid","type":"string"},"productName":{"type":"string"},"categoryName":{"type":"string"},"rateBps":{"minimum":0,"description":"Taxa em pontos-base (1000 = 10%).","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"description":"Taxa em pontos-base (1000 = 10%).","type":"integer"}]},"maxPayments":{"anyOf":[{"minimum":1,"description":"Pagamentos que geram comissão; `null` = todos.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"description":"Pagamentos que geram comissão; `null` = todos.","type":"integer"}]},{"type":"null"}]},"level":{"enum":["affiliate_product","product_excluded","affiliate","product","program","system_default"],"description":"De onde veio a taxa.","type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"getAffiliatesMeRates","description":"Escopo: `account:read`","security":[{"oauth2":["account:read"]},{"apiKey":[]}]}},"/affiliates/me/commissions":{"get":{"summary":"Comissões do afiliado","tags":["Afiliados"],"responses":{"200":{"description":"Página de comissões.","content":{"application/json":{"schema":{"type":"object","required":["items","total","page","pageSize","totalPages"],"properties":{"items":{"type":"array","items":{"type":"object","required":["id","kind","state","amountCents","baseCents","rateBps","paymentNumber","productName","customerLabel","invoiceNumber","availableAt","releasedAt","cancelledAt","cancelReason","note","createdAt"],"properties":{"id":{"format":"uuid","type":"string"},"kind":{"enum":["sale","adjustment"],"type":"string"},"state":{"enum":["pending","available","cancelled"],"type":"string"},"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string.","type":"string"},"baseCents":{"anyOf":[{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},{"type":"null"}]},"rateBps":{"anyOf":[{"minimum":0,"description":"Taxa em pontos-base (1000 = 10%).","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"description":"Taxa em pontos-base (1000 = 10%).","type":"integer"}]},{"type":"null"}]},"paymentNumber":{"anyOf":[{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},{"type":"null"}]},"productName":{"anyOf":[{"type":"string"},{"type":"null"}]},"customerLabel":{"anyOf":[{"description":"Nome mascarado; nunca o e-mail.","type":"string"},{"type":"null"}]},"invoiceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"availableAt":{"format":"date-time","type":"string"},"releasedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"cancelledAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"cancelReason":{"anyOf":[{"enum":["refund","chargeback","payment_reverted","invoice_not_paid","manual"],"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"}}}},"total":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"page":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"pageSize":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"totalPages":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"page","in":"query","required":false,"schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"type":"number"}]}},{"name":"pageSize","in":"query","required":false,"schema":{"minimum":1,"maximum":100,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":100,"type":"number"}]}},{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["pending","available","cancelled"]}}],"operationId":"getAffiliatesMeCommissions","description":"Escopo: `account:read`","security":[{"oauth2":["account:read"]},{"apiKey":[]}]}},"/affiliates/me/referrals":{"get":{"summary":"Clientes indicados pelo afiliado","tags":["Afiliados"],"responses":{"200":{"description":"Página de indicados.","content":{"application/json":{"schema":{"type":"object","required":["items","total","page","pageSize","totalPages"],"properties":{"items":{"type":"array","items":{"type":"object","required":["id","customerLabel","source","createdAt","active","ordersCount","earnedCents"],"properties":{"id":{"format":"uuid","type":"string"},"customerLabel":{"description":"Nome mascarado; nunca o e-mail.","type":"string"},"source":{"enum":["signup","checkout","admin"],"type":"string"},"createdAt":{"format":"date-time","type":"string"},"active":{"type":"boolean"},"ordersCount":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"earnedCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"}}}},"total":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"page":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"pageSize":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"totalPages":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"page","in":"query","required":false,"schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"type":"number"}]}},{"name":"pageSize","in":"query","required":false,"schema":{"minimum":1,"maximum":100,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":100,"type":"number"}]}}],"operationId":"getAffiliatesMeReferrals","description":"Escopo: `account:read`","security":[{"oauth2":["account:read"]},{"apiKey":[]}]}},"/affiliates/me/payouts":{"get":{"summary":"Saques do afiliado","tags":["Afiliados"],"responses":{"200":{"description":"Página de saques.","content":{"application/json":{"schema":{"type":"object","required":["items","total","page","pageSize","totalPages"],"properties":{"items":{"type":"array","items":{"type":"object","required":["id","method","status","amountCents","pixKeyHint","reference","rejectionReason","createdAt","reviewedAt","paidAt"],"properties":{"id":{"format":"uuid","type":"string"},"method":{"enum":["credit","pix"],"type":"string"},"status":{"enum":["requested","paid","rejected","cancelled"],"type":"string"},"amountCents":{"pattern":"^-?[0-9]+$","description":"Centavos, como string (inteiro).","type":"string"},"pixKeyHint":{"anyOf":[{"type":"string"},{"type":"null"}]},"reference":{"anyOf":[{"type":"string"},{"type":"null"}]},"rejectionReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"reviewedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"paidAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}},"total":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"page":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"pageSize":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"totalPages":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"page","in":"query","required":false,"schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"type":"number"}]}},{"name":"pageSize","in":"query","required":false,"schema":{"minimum":1,"maximum":100,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":100,"type":"number"}]}}],"operationId":"getAffiliatesMePayouts","description":"Escopo: `account:read`","security":[{"oauth2":["account:read"]},{"apiKey":[]}]}},"/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"],"responses":{"200":{"description":"Resultado do processamento.","content":{"application/json":{"schema":{"type":"object","required":["outcome"],"properties":{"outcome":{"enum":["duplicate","ignored","already_paid","paid","credited_cancelled_invoice","already_credited","payment_failed","refunded","chargedback"],"type":"string"},"invoiceId":{"format":"uuid","type":"string"},"reason":{"description":"Só com `outcome: ignored`.","type":"string"},"full":{"description":"Só com `outcome: refunded`: estorno total.","type":"boolean"}}}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"requestBody":{"content":{"text/plain":{"schema":{"type":"string"}}},"required":true},"operationId":"postWebhooksPagarme","security":[]}},"/webhooks/whatsapp":{"post":{"summary":"Recebe eventos do WhatsApp (WI)","description":"Uso exclusivo do WI, assinado por HMAC (x-wi-signature-v2). Recibos de entrega e leitura, respostas, bloqueios e queda da sessão.","tags":["Webhooks recebidos"],"responses":{"200":{"description":"Evento gravado.","content":{"application/json":{"schema":{"type":"object","required":["ok","outcome"],"properties":{"ok":{"const":true,"type":"boolean"},"outcome":{"enum":["accepted","duplicate","ignored"],"type":"string"}}}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"requestBody":{"content":{"text/plain":{"schema":{"maxLength":262144,"type":"string"}}},"required":true},"operationId":"postWebhooksWhatsapp","security":[]}},"/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"],"responses":{"200":{"description":"Instalação encerrada.","content":{"application/json":{"schema":{"type":"object","required":["ok"],"properties":{"ok":{"const":true,"type":"boolean"}}}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":[]}},"/r/{token}":{"get":{"summary":"Clique em link de campanha","description":"Redireciona para o destino gravado do link rastreado.","tags":["Campanhas"],"responses":{"302":{"description":"Redireciona para o destino do link.","headers":{"Location":{"description":"URL gravada do link; token inválido leva à página inicial do site.","schema":{"type":"string"}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"token","in":"path","required":true,"schema":{"minLength":1,"maxLength":80,"type":"string"}}],"operationId":"getRByToken","security":[]}},"/o/{token}":{"get":{"summary":"Pixel de abertura de e-mail de campanha","description":"Pública, sem autenticação. Registra a abertura do e-mail ligado ao `token` e devolve um GIF transparente de 1x1 (`image/gif`), sem cache.","tags":["Campanhas"],"responses":{"200":{"description":"GIF transparente de 1x1.","content":{"image/gif":{"schema":{"type":"string","format":"binary"}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"token","in":"path","required":true,"schema":{"minLength":1,"maxLength":80,"type":"string"}}],"operationId":"getOByToken","security":[]}},"/seo/config":{"get":{"summary":"Configuração pública de SEO","description":"Configuração global, regras de SEO ligadas e modelos da imagem de compartilhamento, para o site montar o <head> e o card gerado.","tags":["SEO"],"responses":{"200":{"description":"Configuração efetiva.","content":{"application/json":{"schema":{"type":"object","required":["global","rules","ogTemplates"],"properties":{"global":{"additionalProperties":true,"type":"object","required":["siteName","titleTemplate","defaultDescription","defaultOgImageKey","defaultOgTemplateId","twitterSite","organization","noindexAll"],"properties":{"siteName":{"type":"string"},"titleTemplate":{"description":"`%s` vira o título da página.","type":"string"},"defaultDescription":{"type":"string"},"defaultOgImageKey":{"anyOf":[{"type":"string"},{"type":"null"}]},"defaultOgTemplateId":{"anyOf":[{"type":"string"},{"type":"null"}]},"twitterSite":{"anyOf":[{"type":"string"},{"type":"null"}]},"organization":{"additionalProperties":true,"type":"object","required":["name","legalName","logoUrl","sameAs"],"properties":{"name":{"type":"string"},"legalName":{"type":"string"},"logoUrl":{"type":"string"},"sameAs":{"type":"array","items":{"type":"string"}}}},"noindexAll":{"type":"boolean"}}},"rules":{"type":"array","items":{"type":"object","required":["id","matchType","matchValue","priority","enabled","title","description","canonical","robots","ogTitle","ogDescription","ogImageKey","ogType","twitterCard","ogTemplateId","ogTemplateTitle","ogTemplateSubtitle","jsonLd"],"properties":{"id":{"format":"uuid","type":"string"},"matchType":{"enum":["path","route","product"],"type":"string"},"matchValue":{"type":"string"},"priority":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"enabled":{"type":"boolean"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"canonical":{"anyOf":[{"type":"string"},{"type":"null"}]},"robots":{"anyOf":[{"type":"string"},{"type":"null"}]},"ogTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"ogDescription":{"anyOf":[{"type":"string"},{"type":"null"}]},"ogImageKey":{"anyOf":[{"type":"string"},{"type":"null"}]},"ogType":{"anyOf":[{"type":"string"},{"type":"null"}]},"twitterCard":{"anyOf":[{"type":"string"},{"type":"null"}]},"ogTemplateId":{"anyOf":[{"type":"string"},{"type":"null"}]},"ogTemplateTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"ogTemplateSubtitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"jsonLd":{"description":"JSON-LD livre; `null` sem dado estruturado."}}}},"ogTemplates":{"type":"array","items":{"type":"object","required":["id","name","spec"],"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"spec":{"additionalProperties":true,"type":"object","required":["layout","background"],"properties":{"layout":{"enum":["classic","centered","split"],"type":"string"},"background":{"enum":["dark","brand","white","image"],"type":"string"}}}}}}}}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"getSeoConfig","security":[]}},"/seo/og-images/*":{"get":{"summary":"Imagem de compartilhamento (Open Graph)","description":"Bytes de uma imagem OG enviada pelo painel de SEO (chaves seo/og/...).","tags":["SEO"],"responses":{"200":{"description":"Imagem enviada.","content":{"image/png":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"getSeoOgImages","security":[]}},"/social-login/providers":{"get":{"summary":"Provedores de login social ligados","description":"Provedores ligados (Google, GitHub, Discord) para os botões de login.","tags":["Auth"],"responses":{"200":{"description":"Provedores ligados.","content":{"application/json":{"schema":{"type":"object","required":["providers"],"properties":{"providers":{"type":"array","items":{"type":"object","required":["id","enabled"],"properties":{"id":{"enum":["google","github","discord"],"type":"string"},"enabled":{"const":true,"type":"boolean"}}}}}}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"getSocialLoginProviders","security":[]}},"/analytics/collect":{"post":{"summary":"Beacon do analytics","description":"Recebe pageview, ping, evento ou Web Vitals do site (JSON em text/plain). Sempre 204.","tags":["Analytics"],"responses":{"204":{"description":"Sem conteúdo, sempre."},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"postAnalyticsCollect","security":[]}},"/marketing/public-config":{"get":{"summary":"Tags públicas do Google","description":"IDs do GA4, GTM e Google Ads e a versão da política de cookies.","tags":["Marketing"],"responses":{"200":{"description":"IDs das tags e versão da política.","content":{"application/json":{"schema":{"type":"object","required":["policyVersion","ga4MeasurementId","gtmContainerId","googleAdsId","adsConversionLabels"],"properties":{"policyVersion":{"description":"Data da política de cookies (`AAAA-MM-DD`).","type":"string"},"ga4MeasurementId":{"anyOf":[{"type":"string"},{"type":"null"}]},"gtmContainerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"googleAdsId":{"anyOf":[{"type":"string"},{"type":"null"}]},"adsConversionLabels":{"type":"object","required":["signUp","beginCheckout","purchase"],"properties":{"signUp":{"anyOf":[{"type":"string"},{"type":"null"}]},"beginCheckout":{"anyOf":[{"type":"string"},{"type":"null"}]},"purchase":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"getMarketingPublicConfig","security":[]}},"/marketing/touches":{"post":{"summary":"Ponto de entrada do visitante","description":"Classifica a origem e grava o ponto (repetição em 30 min é ignorada).","tags":["Marketing"],"responses":{"204":{"description":"Sem conteúdo, mesmo com falha (melhor esforço)."},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["visitorId","landingUrl"],"properties":{"visitorId":{"maxLength":36,"type":"string"},"landingUrl":{"minLength":1,"maxLength":2000,"type":"string"},"referrerUrl":{"maxLength":2000,"type":["string","null"]}},"additionalProperties":false}}}},"operationId":"postMarketingTouches","security":[]}},"/marketing/consents":{"post":{"summary":"Prova do consentimento de cookies","description":"Grava a escolha do banner com o visitante e o usuário da sessão.","tags":["Marketing"],"responses":{"204":{"description":"Consentimento gravado."},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["policyVersion","analytics","ads","measurement","source"],"properties":{"policyVersion":{"maxLength":20,"pattern":"^\\d{4}-\\d{2}-\\d{2}$","type":"string"},"analytics":{"type":"boolean"},"ads":{"type":"boolean"},"measurement":{"type":"boolean"},"source":{"type":"string","enum":["banner","preferences"]}}}}}},"operationId":"postMarketingConsents","security":[]}},"/hosting/{serviceId}/components":{"get":{"summary":"Lista os componentes do projeto","tags":["Hospedagem"],"responses":{"200":{"description":"Componentes.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","required":["id","appId","name","kind","runtime","runtimeVersion","image","command","port","memoryMb","cpuMilli","desiredState","actualState","schedule","origin","composeService","createdAt","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"appId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"name":{"type":"string"},"kind":{"enum":["app","worker","cron","db-mariadb","db-mysql","db-postgres","redis"],"type":"string"},"runtime":{"anyOf":[{"type":"string"},{"type":"null"}]},"runtimeVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"command":{"anyOf":[{"type":"string"},{"type":"null"}]},"port":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"memoryMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"cpuMilli":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"desiredState":{"enum":["running","stopped"],"type":"string"},"actualState":{"enum":["creating","running","stopped","restarting","crashed","missing"],"type":"string"},"schedule":{"anyOf":[{"type":"string"},{"type":"null"}]},"origin":{"enum":["panel","vixpi-json","compose"],"type":"string"},"composeService":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","in":"query","required":false,"schema":{"format":"uuid","type":"string"}}],"operationId":"getHostingByServiceIdComponents","description":"Escopo: `hosting:read`","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]},"post":{"summary":"Cria um componente","tags":["Hospedagem"],"responses":{"201":{"description":"Componente criado.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","name","kind","runtimeVersion","memoryMb","cpuMilli","desiredState","actualState","operationId"],"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"kind":{"enum":["app","worker","cron","db-mariadb","db-mysql","db-postgres","redis"],"type":"string"},"runtimeVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"memoryMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"cpuMilli":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"desiredState":{"enum":["running","stopped"],"type":"string"},"actualState":{"enum":["creating","running","stopped","restarting","crashed","missing"],"type":"string"},"operationId":{"format":"uuid","description":"Acompanhe em `GET /operations/{id}`.","type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","kind","memoryMb","cpuMilli"],"properties":{"appId":{"format":"uuid","type":"string"},"name":{"type":"string"},"kind":{"type":"string"},"memoryMb":{"type":"number"},"cpuMilli":{"type":"number"},"runtime":{"type":["string","null"]},"runtimeVersion":{"type":["string","null"]},"image":{"type":["string","null"]},"command":{"type":["string","null"]},"port":{"type":["number","null"]},"schedule":{"type":["string","null"]},"desiredState":{"type":["string","null"]}}}}}},"operationId":"postHostingByServiceIdComponents","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/components/{componentId}":{"delete":{"summary":"Remove um componente","tags":["Hospedagem"],"description":"O container é removido no servidor; a resposta traz a operação `component.remove` para acompanhar.\n\nEscopo: `hosting:write`","responses":{"202":{"description":"Aceito para processamento.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["operationId"],"properties":{"operationId":{"format":"uuid","description":"Acompanhe em `GET /operations/{id}`.","type":"string"}}}}}}},"headers":{"Location":{"description":"Endpoint para acompanhar a tarefa: `/api/v1/hosting/{serviceId}/operations/{operationId}`.","schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"componentId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"deleteHostingByServiceIdComponentsByComponentId","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]},"patch":{"summary":"Altera um componente","tags":["Hospedagem"],"responses":{"200":{"description":"Componente alterado.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","name","kind","memoryMb","cpuMilli","desiredState","actualState","command","schedule","operationId"],"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"kind":{"enum":["app","worker","cron","db-mariadb","db-mysql","db-postgres","redis"],"type":"string"},"memoryMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"cpuMilli":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"desiredState":{"enum":["running","stopped"],"type":"string"},"actualState":{"enum":["creating","running","stopped","restarting","crashed","missing"],"type":"string"},"command":{"anyOf":[{"type":"string"},{"type":"null"}]},"schedule":{"anyOf":[{"type":"string"},{"type":"null"}]},"operationId":{"format":"uuid","description":"Acompanhe em `GET /operations/{id}`.","type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":[]}]}},"/hosting/{serviceId}/components/{componentId}/restart":{"post":{"summary":"Reinicia um componente","tags":["Hospedagem"],"description":"Reinicia o container no servidor; a resposta traz a operação `component.action` para acompanhar. Componente parado e app do Vixpi Run sem versão no ar devolvem 409.\n\nEscopo: `hosting:write`","responses":{"202":{"description":"Aceito para processamento.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["operationId"],"properties":{"operationId":{"format":"uuid","description":"Acompanhe em `GET /operations/{id}`.","type":"string"}}}}}}},"headers":{"Location":{"description":"Endpoint para acompanhar a tarefa: `/api/v1/hosting/{serviceId}/operations/{operationId}`.","schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"componentId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postHostingByServiceIdComponentsByComponentIdRestart","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/components/{componentId}/credentials":{"get":{"summary":"Revela as variáveis de conexão de um banco ou Redis","tags":["Hospedagem"],"description":"Devolve as linhas prontas para `.env` (URL de conexão e `DB_*` com a senha), lidas do servidor. Só o titular da conta: suporte e admin (`manage:all`) recebem 403. Resposta sem cache; cada acesso fica na auditoria (sem valores).\n\nEscopo: `hosting:write`","responses":{"200":{"description":"Variáveis de conexão.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["env"],"properties":{"env":{"description":"Variáveis de conexão (URL, host, porta, usuário, senha, nome).","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"componentId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdComponentsByComponentIdCredentials","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/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.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["operationId"],"properties":{"operationId":{"format":"uuid","description":"Acompanhe em `GET /operations/{id}`.","type":"string"}}}}}}},"headers":{"Location":{"description":"Endpoint para acompanhar a tarefa: `/api/v1/hosting/{serviceId}/operations/{operationId}`.","schema":{"type":"string"}}}},"204":{"description":"Nada mudou."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"putHostingByServiceIdComponentsAllocation","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/apps":{"get":{"summary":"Lista os apps do projeto","tags":["Hospedagem: apps"],"responses":{"200":{"description":"Apps.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","required":["id","name","primary","runtime","runtimeVersion","port","memoryMb","cpuMilli","desiredState","actualState","technicalHost","removing","createdAt","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"primary":{"description":"App principal (não pode ser removido).","type":"boolean"},"runtime":{"anyOf":[{"type":"string"},{"type":"null"}]},"runtimeVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"port":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"memoryMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"cpuMilli":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"desiredState":{"enum":["running","stopped"],"type":"string"},"actualState":{"enum":["creating","running","stopped","restarting","crashed","missing"],"type":"string"},"technicalHost":{"anyOf":[{"description":"Só em conta `site`.","type":"string"},{"type":"null"}]},"removing":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdApps","description":"Escopo: `hosting:read`","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]},"post":{"summary":"Cria um app extra","tags":["Hospedagem: apps"],"responses":{"201":{"description":"App criado.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","name","primary","runtime","runtimeVersion","port","memoryMb","cpuMilli","desiredState","actualState","technicalHost","removing","createdAt","updatedAt","operationId"],"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"primary":{"description":"App principal (não pode ser removido).","type":"boolean"},"runtime":{"anyOf":[{"type":"string"},{"type":"null"}]},"runtimeVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"port":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"memoryMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"cpuMilli":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"desiredState":{"enum":["running","stopped"],"type":"string"},"actualState":{"enum":["creating","running","stopped","restarting","crashed","missing"],"type":"string"},"technicalHost":{"anyOf":[{"description":"Só em conta `site`.","type":"string"},{"type":"null"}]},"removing":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"operationId":{"format":"uuid","description":"Acompanhe em `GET /operations/{id}`.","type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","memoryMb","cpuMilli"],"properties":{"name":{"minLength":2,"maxLength":20,"type":"string"},"runtime":{"type":"string"},"runtimeVersion":{"type":"string"},"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"}]},"port":{"minimum":1,"maximum":65535,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":65535,"type":"integer"}]}}}}}},"operationId":"postHostingByServiceIdApps","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/apps/{appId}":{"delete":{"summary":"Remove um app extra","description":"`confirmation` deve ser o nome do app. O principal não pode ser removido. A remoção termina no servidor, por isso a resposta é 202.\n\nEscopo: `hosting:write`","tags":["Hospedagem: apps"],"responses":{"202":{"description":"Aceito para processamento.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","removing","operationId"],"properties":{"id":{"format":"uuid","type":"string"},"removing":{"const":true,"type":"boolean"},"operationId":{"format":"uuid","description":"Acompanhe em `GET /operations/{id}`.","type":"string"}}}}}}},"headers":{"Location":{"description":"Endpoint para acompanhar a tarefa: `/api/v1/hosting/{serviceId}/operations/{operationId}`.","schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["confirmation"],"properties":{"confirmation":{"type":"string"}}}}}},"operationId":"deleteHostingByServiceIdAppsByAppId","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/endpoints":{"get":{"summary":"Lista os endpoints do projeto","description":"Endereço (`fqdn` e `publicPort`) que o cliente usa para conectar no banco ou no bot, regras de acesso por IP e situação do certificado.\n\nEscopo: `hosting:read`","tags":["Hospedagem: endpoints"],"responses":{"200":{"description":"Endpoints.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","required":["id","componentId","name","fqdn","line","region","publicPort","localPort","requireTls","allowPlatform","status","configVersion","certStatus","certExpiresAt","disabledReason","disabledAt","refusalAlertThreshold","refusalAlertSentAt","rules","createdAt","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"componentId":{"format":"uuid","type":"string"},"name":{"type":"string"},"fqdn":{"type":"string"},"line":{"enum":["vdx","vrx"],"type":"string"},"region":{"type":"string"},"publicPort":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"localPort":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"requireTls":{"type":"boolean"},"allowPlatform":{"type":"boolean"},"status":{"enum":["pending","active","removing","failed","parked"],"type":"string"},"configVersion":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"certStatus":{"enum":["none","pending","active","renewing","failed"],"type":"string"},"certExpiresAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"disabledReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"disabledAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"refusalAlertThreshold":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"refusalAlertSentAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"rules":{"type":"array","items":{"type":"object","required":["cidr","label"],"properties":{"cidr":{"type":"string"},"label":{"type":"string"}}}},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdEndpoints","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]},"post":{"summary":"Cria um endpoint","description":"Para projeto de banco, de bot ou para um banco de dados/Redis do site (o servidor do site precisa abrir acesso externo a bancos; um endereço por banco; ligar reinicia o banco uma vez para ativar o TLS). A porta pública é sorteada na faixa 20000-29999 da região e não muda, nem na migração. Sem `rules`, ninguém conecta até você liberar um IP; `allowPlatform` libera os servidores da Vixpi e faixa ampla em `rules` exige `confirmAnyIp: true`. A configuração termina no servidor, por isso a resposta é 202.\n\nEscopo: `hosting:write`","tags":["Hospedagem: endpoints"],"responses":{"202":{"description":"Aceito para processamento.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","componentId","name","fqdn","line","region","publicPort","localPort","requireTls","allowPlatform","status","configVersion","certStatus","certExpiresAt","disabledReason","disabledAt","refusalAlertThreshold","refusalAlertSentAt","rules","createdAt","updatedAt","operationId"],"properties":{"id":{"format":"uuid","type":"string"},"componentId":{"format":"uuid","type":"string"},"name":{"type":"string"},"fqdn":{"type":"string"},"line":{"enum":["vdx","vrx"],"type":"string"},"region":{"type":"string"},"publicPort":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"localPort":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"requireTls":{"type":"boolean"},"allowPlatform":{"type":"boolean"},"status":{"enum":["pending","active","removing","failed","parked"],"type":"string"},"configVersion":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"certStatus":{"enum":["none","pending","active","renewing","failed"],"type":"string"},"certExpiresAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"disabledReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"disabledAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"refusalAlertThreshold":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"refusalAlertSentAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"rules":{"type":"array","items":{"type":"object","required":["cidr","label"],"properties":{"cidr":{"type":"string"},"label":{"type":"string"}}}},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"operationId":{"format":"uuid","description":"Acompanhe em `GET /operations/{id}`.","type":"string"}}}}}}},"headers":{"Location":{"description":"Endpoint para acompanhar a tarefa: `/api/v1/hosting/{serviceId}/operations/{operationId}`.","schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["componentId","name"],"properties":{"componentId":{"format":"uuid","type":"string"},"name":{"minLength":2,"maxLength":20,"type":"string"},"requireTls":{"type":"boolean"},"rules":{"type":"array","items":{"type":"object","required":["cidr","label"],"properties":{"cidr":{"minLength":1,"maxLength":64,"type":"string"},"label":{"maxLength":60,"type":"string"}}}},"allowPlatform":{"type":"boolean"},"confirmAnyIp":{"type":"boolean"}}}}}},"operationId":"postHostingByServiceIdEndpoints","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/endpoints/{endpointId}/rules":{"put":{"summary":"Troca as regras de acesso de um endpoint","description":"Substitui a lista inteira (até 100 regras; CIDR IPv4 ou IPv6, repetido conta uma vez). Lista vazia bloqueia todo acesso. `allowPlatform` liga ou desliga os servidores da Vixpi (ausente = mantém). Regra nova ampla (qualquer IP, IPv4 maior que `/8`, IPv6 maior que `/16`, ou regras novas que somadas chegam a uma `/7` IPv4 ou `/15` IPv6) exige `confirmAnyIp: true`; sem ela, 422 `HOSTING_ENDPOINT_ANY_IP_UNCONFIRMED`.\n\nEscopo: `hosting:write`","tags":["Hospedagem: endpoints"],"responses":{"202":{"description":"Aceito para processamento. `Location` só quando há operação (`operationId` não nulo).","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","componentId","name","fqdn","line","region","publicPort","localPort","requireTls","allowPlatform","status","configVersion","certStatus","certExpiresAt","disabledReason","disabledAt","refusalAlertThreshold","refusalAlertSentAt","rules","createdAt","updatedAt","operationId"],"properties":{"id":{"format":"uuid","type":"string"},"componentId":{"format":"uuid","type":"string"},"name":{"type":"string"},"fqdn":{"type":"string"},"line":{"enum":["vdx","vrx"],"type":"string"},"region":{"type":"string"},"publicPort":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"localPort":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"requireTls":{"type":"boolean"},"allowPlatform":{"type":"boolean"},"status":{"enum":["pending","active","removing","failed","parked"],"type":"string"},"configVersion":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"certStatus":{"enum":["none","pending","active","renewing","failed"],"type":"string"},"certExpiresAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"disabledReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"disabledAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"refusalAlertThreshold":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"refusalAlertSentAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"rules":{"type":"array","items":{"type":"object","required":["cidr","label"],"properties":{"cidr":{"type":"string"},"label":{"type":"string"}}}},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"operationId":{"anyOf":[{"format":"uuid","description":"`null` quando nada mudou no servidor.","type":"string"},{"type":"null"}]}}}}}}},"headers":{"Location":{"description":"Endpoint para acompanhar a tarefa: `/api/v1/hosting/{serviceId}/operations/{operationId}`.","schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"endpointId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["rules"],"properties":{"rules":{"type":"array","items":{"type":"object","required":["cidr","label"],"properties":{"cidr":{"minLength":1,"maxLength":64,"type":"string"},"label":{"maxLength":60,"type":"string"}}}},"allowPlatform":{"type":"boolean"},"confirmAnyIp":{"type":"boolean"}}}}}},"operationId":"putHostingByServiceIdEndpointsByEndpointIdRules","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]},"post":{"summary":"Libera um acesso no endpoint","description":"Soma uma liberação às regras atuais: `cidr` (um IP ou faixa; faixa ampla, como no `PUT`, exige `confirmAnyIp: true`), `my-ip` (o IP de quem faz o pedido), `platform` (servidores da Vixpi, a lista acompanha os servidores sozinha) ou `any` (qualquer IP; exige `confirmAnyIp: true`). Regra repetida conta uma vez. A resposta é 202 com `status` e `configVersion`.\n\nEscopo: `hosting:write`","tags":["Hospedagem: endpoints"],"responses":{"202":{"description":"Aceito para processamento. `Location` só quando há operação (`operationId` não nulo).","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","componentId","name","fqdn","line","region","publicPort","localPort","requireTls","allowPlatform","status","configVersion","certStatus","certExpiresAt","disabledReason","disabledAt","refusalAlertThreshold","refusalAlertSentAt","rules","createdAt","updatedAt","operationId"],"properties":{"id":{"format":"uuid","type":"string"},"componentId":{"format":"uuid","type":"string"},"name":{"type":"string"},"fqdn":{"type":"string"},"line":{"enum":["vdx","vrx"],"type":"string"},"region":{"type":"string"},"publicPort":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"localPort":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"requireTls":{"type":"boolean"},"allowPlatform":{"type":"boolean"},"status":{"enum":["pending","active","removing","failed","parked"],"type":"string"},"configVersion":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"certStatus":{"enum":["none","pending","active","renewing","failed"],"type":"string"},"certExpiresAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"disabledReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"disabledAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"refusalAlertThreshold":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"refusalAlertSentAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"rules":{"type":"array","items":{"type":"object","required":["cidr","label"],"properties":{"cidr":{"type":"string"},"label":{"type":"string"}}}},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"operationId":{"anyOf":[{"format":"uuid","description":"`null` quando nada mudou no servidor.","type":"string"},{"type":"null"}]}}}}}}},"headers":{"Location":{"description":"Endpoint para acompanhar a tarefa: `/api/v1/hosting/{serviceId}/operations/{operationId}`.","schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"endpointId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["kind","cidr"],"properties":{"kind":{"const":"cidr","type":"string"},"cidr":{"minLength":1,"maxLength":64,"type":"string"},"label":{"maxLength":60,"type":"string"},"confirmAnyIp":{"type":"boolean"}}},{"type":"object","required":["kind"],"properties":{"kind":{"const":"my-ip","type":"string"},"label":{"maxLength":60,"type":"string"}}},{"type":"object","required":["kind"],"properties":{"kind":{"const":"platform","type":"string"}}},{"type":"object","required":["kind","confirmAnyIp"],"properties":{"kind":{"const":"any","type":"string"},"confirmAnyIp":{"type":"boolean"},"label":{"maxLength":60,"type":"string"}}}]}}}},"operationId":"postHostingByServiceIdEndpointsByEndpointIdRules","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/endpoints/{endpointId}":{"delete":{"summary":"Remove um endpoint","description":"O endereço sai do ar no servidor e o nome do DNS é apagado. No banco do site, ele volta a aceitar conexão só de dentro do site (reinicia uma vez). O endpoint do projeto de banco não sai assim: tire as regras. Repetir o pedido refaz a remoção. A resposta é 202.\n\nEscopo: `hosting:write`","tags":["Hospedagem: endpoints"],"responses":{"202":{"description":"Aceito para processamento.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","componentId","name","fqdn","line","region","publicPort","localPort","requireTls","allowPlatform","status","configVersion","certStatus","certExpiresAt","disabledReason","disabledAt","refusalAlertThreshold","refusalAlertSentAt","rules","createdAt","updatedAt","operationId"],"properties":{"id":{"format":"uuid","type":"string"},"componentId":{"format":"uuid","type":"string"},"name":{"type":"string"},"fqdn":{"type":"string"},"line":{"enum":["vdx","vrx"],"type":"string"},"region":{"type":"string"},"publicPort":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"localPort":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"requireTls":{"type":"boolean"},"allowPlatform":{"type":"boolean"},"status":{"enum":["pending","active","removing","failed","parked"],"type":"string"},"configVersion":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"certStatus":{"enum":["none","pending","active","renewing","failed"],"type":"string"},"certExpiresAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"disabledReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"disabledAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"refusalAlertThreshold":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"refusalAlertSentAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"rules":{"type":"array","items":{"type":"object","required":["cidr","label"],"properties":{"cidr":{"type":"string"},"label":{"type":"string"}}}},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"operationId":{"format":"uuid","description":"Acompanhe em `GET /operations/{id}`.","type":"string"}}}}}}},"headers":{"Location":{"description":"Endpoint para acompanhar a tarefa: `/api/v1/hosting/{serviceId}/operations/{operationId}`.","schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"endpointId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"operationId":"deleteHostingByServiceIdEndpointsByEndpointId","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/endpoints/{endpointId}/access/stream":{"get":{"summary":"Acompanha os acessos ao endpoint ao vivo","description":"Fluxo NDJSON que fica aberto (até 1 hora): primeiro as últimas 100 conexões, depois cada conexão nova. Cada linha traz `at` (ISO), `ip`, `outcome` (`accepted`, `refused` pelas regras de IP ou `failed`), `status`, `durationMs`, `bytesIn` e `bytesOut`.\n\nEscopo: `hosting:read`","tags":["Hospedagem: endpoints"],"responses":{"200":{"description":"Conexões, uma por linha.","content":{"application/x-ndjson":{}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"endpointId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"operationId":"getHostingByServiceIdEndpointsByEndpointIdAccessStream","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]}},"/hosting/{serviceId}/endpoints/{endpointId}/refusal-alert":{"put":{"summary":"Liga, muda ou desliga o aviso de conexões recusadas","description":"`threshold`: recusas pelas regras de IP, numa janela de cerca de 15 minutos, a partir das quais o dono é avisado por e-mail e WhatsApp (conforme as preferências), no máximo uma vez a cada 6 horas. Inteiro de 10 a 100000; `null` desliga. Fora da faixa: 422 `HOSTING_ENDPOINT_REFUSAL_ALERT_INVALID`.\n\nEscopo: `hosting:write`","tags":["Hospedagem: endpoints"],"responses":{"200":{"description":"Endpoint.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","componentId","name","fqdn","line","region","publicPort","localPort","requireTls","allowPlatform","status","configVersion","certStatus","certExpiresAt","disabledReason","disabledAt","refusalAlertThreshold","refusalAlertSentAt","rules","createdAt","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"componentId":{"format":"uuid","type":"string"},"name":{"type":"string"},"fqdn":{"type":"string"},"line":{"enum":["vdx","vrx"],"type":"string"},"region":{"type":"string"},"publicPort":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"localPort":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"requireTls":{"type":"boolean"},"allowPlatform":{"type":"boolean"},"status":{"enum":["pending","active","removing","failed","parked"],"type":"string"},"configVersion":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"certStatus":{"enum":["none","pending","active","renewing","failed"],"type":"string"},"certExpiresAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"disabledReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"disabledAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"refusalAlertThreshold":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"refusalAlertSentAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"rules":{"type":"array","items":{"type":"object","required":["cidr","label"],"properties":{"cidr":{"type":"string"},"label":{"type":"string"}}}},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"endpointId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["threshold"],"properties":{"threshold":{"type":["number","null"]}}}}}},"operationId":"putHostingByServiceIdEndpointsByEndpointIdRefusalAlert","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/databases":{"get":{"summary":"Mostra o banco gerenciado","description":"Motor e versão, endereço público (CNAME do endpoint, nunca o IP do servidor), bancos com tamanho e usuários com a URL de conexão sem senha. Lido do servidor a cada chamada. Na hospedagem de sites, passe `componentId`; banco ainda no modelo antigo responde 409 `DB_NOT_MANAGED`.\n\nEscopo: `hosting:read`","tags":["Hospedagem: bancos"],"responses":{"200":{"description":"Banco gerenciado.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["engine","version","componentId","state","memoryMb","endpoint","databases","mainDatabase","users"],"properties":{"engine":{"enum":["postgres","mysql","mariadb","redis"],"type":"string"},"version":{"anyOf":[{"type":"string"},{"type":"null"}]},"componentId":{"format":"uuid","type":"string"},"state":{"enum":["creating","running","stopped","restarting","crashed","missing"],"type":"string"},"memoryMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"endpoint":{"anyOf":[{"type":"object","required":["id","fqdn","publicPort","status","certStatus","requireTls"],"properties":{"id":{"format":"uuid","type":"string"},"fqdn":{"type":"string"},"publicPort":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"status":{"enum":["pending","active","removing","failed","parked"],"type":"string"},"certStatus":{"enum":["none","pending","active","renewing","failed"],"type":"string"},"requireTls":{"type":"boolean"}}},{"type":"null"}]},"databases":{"type":"array","items":{"type":"object","required":["name","sizeBytes"],"properties":{"name":{"type":"string"},"sizeBytes":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]}}}},"mainDatabase":{"anyOf":[{"description":"Banco principal (não pode ser apagado: 409 `DB_PROTECTED`). `null` no Redis e em servidor ainda sem a atualização.","type":"string"},{"type":"null"}]},"users":{"type":"array","items":{"type":"object","required":["username","access","database","connectionUrl"],"properties":{"username":{"type":"string"},"access":{"enum":["admin","readwrite","readonly"],"type":"string"},"database":{"description":"Nome do banco ou `*` (todos).","type":"string"},"connectionUrl":{"anyOf":[{"description":"URL de conexão sem senha.","type":"string"},{"type":"null"}]}}}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"componentId","in":"query","required":false,"schema":{"format":"uuid","description":"Banco ou Redis da hospedagem de sites (obrigatório nela). No banco gerenciado (VDX) pode ficar de fora.","type":"string"}}],"operationId":"getHostingByServiceIdDatabases","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]},"post":{"summary":"Cria um banco na instância","description":"Use de 1 a 32 caracteres entre letras minúsculas, números e _, começando por letra. Redis não tem bancos nomeados (422 `DB_UNSUPPORTED`).\n\nEscopo: `hosting:write`","tags":["Hospedagem: bancos"],"responses":{"201":{"description":"Banco criado.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["name"],"properties":{"name":{"type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"componentId","in":"query","required":false,"schema":{"format":"uuid","description":"Banco ou Redis da hospedagem de sites (obrigatório nela). No banco gerenciado (VDX) pode ficar de fora.","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"pattern":"^[a-z][a-z0-9_]{0,31}$","type":"string"}}}}}},"operationId":"postHostingByServiceIdDatabases","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/databases/stats":{"get":{"summary":"Conexões e disco do banco","description":"Conexões abertas agora e o teto do plano, mais o disco usado e o limite. CPU e memória ao longo do tempo: `GET /hosting/:serviceId/metrics`.\n\nEscopo: `hosting:read`","tags":["Hospedagem: bancos"],"responses":{"200":{"description":"Conexões e disco.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["activeConnections","maxConnections","diskMb","diskLimitMb"],"properties":{"activeConnections":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"maxConnections":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"diskMb":{"type":"number"},"diskLimitMb":{"type":"number"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"componentId","in":"query","required":false,"schema":{"format":"uuid","description":"Banco ou Redis da hospedagem de sites (obrigatório nela). No banco gerenciado (VDX) pode ficar de fora.","type":"string"}}],"operationId":"getHostingByServiceIdDatabasesStats","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]}},"/hosting/{serviceId}/databases/log":{"get":{"summary":"Log do motor do banco","description":"Últimas linhas (padrão 200, máximo 1000) do log do container do banco.\n\nEscopo: `hosting:read`","tags":["Hospedagem: bancos"],"responses":{"200":{"description":"Linhas do log.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["lines"],"properties":{"lines":{"type":"array","items":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"componentId","in":"query","required":false,"schema":{"format":"uuid","description":"Banco ou Redis da hospedagem de sites (obrigatório nela). No banco gerenciado (VDX) pode ficar de fora.","type":"string"}},{"name":"tail","in":"query","required":false,"schema":{"minimum":1,"maximum":1000,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":1000,"type":"number"}]}}],"operationId":"getHostingByServiceIdDatabasesLog","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]}},"/hosting/{serviceId}/databases/extensions":{"get":{"summary":"Extensões do banco","description":"Só PostgreSQL (MySQL, MariaDB e Redis: 409 `DB_EXTENSION_NOT_SUPPORTED`). Mostra as extensões de cada banco e as que a imagem oferece: `installBy: panel` instala por esta API (lista da Vixpi); `sql` é confiável e o próprio usuário do banco cria com `CREATE EXTENSION`.\n\nEscopo: `hosting:read`","tags":["Hospedagem: bancos"],"responses":{"200":{"description":"Extensões.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["componentId","databases","available"],"properties":{"componentId":{"format":"uuid","type":"string"},"databases":{"type":"array","items":{"type":"object","required":["name","extensions"],"properties":{"name":{"type":"string"},"extensions":{"type":"array","items":{"type":"object","required":["name","version","allowed","trusted"],"properties":{"name":{"type":"string"},"version":{"type":"string"},"allowed":{"description":"`true`: o titular gerencia (lista da Vixpi ou confiável). `false`: já existia e fica como está.","type":"boolean"},"trusted":{"type":"boolean"}}}}}}},"available":{"type":"array","items":{"type":"object","required":["name","defaultVersion","trusted","needsRestart","installBy"],"properties":{"name":{"type":"string"},"defaultVersion":{"type":"string"},"trusted":{"type":"boolean"},"needsRestart":{"description":"Instalar reinicia o banco por alguns segundos.","type":"boolean"},"installBy":{"description":"`panel`: instale por `POST /databases/extensions`. `sql`: confiável, crie com `CREATE EXTENSION`.","anyOf":[{"const":"panel","type":"string"},{"const":"sql","type":"string"}]}}}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"componentId","in":"query","required":false,"schema":{"format":"uuid","description":"Banco ou Redis da hospedagem de sites (obrigatório nela). No banco gerenciado (VDX) pode ficar de fora.","type":"string"}}],"operationId":"getHostingByServiceIdDatabasesExtensions","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]},"post":{"summary":"Instala uma extensão no banco","description":"Só as da lista da Vixpi (`installBy: panel`); outra = 422 `DB_EXTENSION_NOT_ALLOWED`. Roda como operação (202): acompanhe em `GET /hosting/:serviceId/operations/:operationId`. Com `needsRestart`, o banco reinicia por alguns segundos.\n\nEscopo: `hosting:write`","tags":["Hospedagem: bancos"],"responses":{"202":{"description":"Instalação na fila.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["operationId","name","action","needsRestart"],"properties":{"operationId":{"format":"uuid","description":"Acompanhe em `GET /operations/{id}`.","type":"string"},"name":{"type":"string"},"action":{"anyOf":[{"const":"create","type":"string"},{"const":"drop","type":"string"}]},"needsRestart":{"type":"boolean"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"componentId","in":"query","required":false,"schema":{"format":"uuid","description":"Banco ou Redis da hospedagem de sites (obrigatório nela). No banco gerenciado (VDX) pode ficar de fora.","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["database","name"],"properties":{"database":{"pattern":"^[a-z][a-z0-9_]{0,31}$","type":"string"},"name":{"pattern":"^[a-z][a-z0-9_-]{0,62}$","type":"string"}}}}}},"operationId":"postHostingByServiceIdDatabasesExtensions","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/databases/extensions/{database}/{name}":{"delete":{"summary":"Remove uma extensão do banco","description":"Só as da lista da Vixpi. Objetos que dependem da extensão impedem a remoção (a operação falha sem mudar nada). Roda como operação (202).\n\nEscopo: `hosting:write`","tags":["Hospedagem: bancos"],"responses":{"202":{"description":"Remoção na fila.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["operationId","name","action","needsRestart"],"properties":{"operationId":{"format":"uuid","description":"Acompanhe em `GET /operations/{id}`.","type":"string"},"name":{"type":"string"},"action":{"anyOf":[{"const":"create","type":"string"},{"const":"drop","type":"string"}]},"needsRestart":{"type":"boolean"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"database","in":"path","required":true,"schema":{"pattern":"^[a-z][a-z0-9_]{0,31}$","type":"string"}},{"name":"name","in":"path","required":true,"schema":{"pattern":"^[a-z][a-z0-9_-]{0,62}$","type":"string"}},{"name":"componentId","in":"query","required":false,"schema":{"format":"uuid","description":"Banco ou Redis da hospedagem de sites (obrigatório nela). No banco gerenciado (VDX) pode ficar de fora.","type":"string"}}],"operationId":"deleteHostingByServiceIdDatabasesExtensionsByDatabaseByName","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/databases/import":{"post":{"summary":"Importa um dump num banco","description":"Carrega um `.sql`, `.sql.gz`, `.zip` (com um `.sql`) ou dump do `pg_dump -Fc` num banco que já existe (PostgreSQL, MySQL ou MariaDB; Redis = 409 `DB_UNSUPPORTED`). O dump roda com o usuário admin do banco, nunca como superusuário. Antes, a Vixpi tira um backup da conta (`backupId`). Roda como operação (202): acompanhe em `GET /hosting/:serviceId/operations/:operationId`; falhas do motor chegam no `error.code` da operação (`DB_IMPORT_FILE_INVALID`, `DB_IMPORT_TOO_LARGE`, `DB_IMPORT_FAILED`, `DB_IMPORT_PG_VERSION`). Já há backup, restore ou import em curso = 409 `HOSTING_RESTORE_IN_PROGRESS`.\n\nEscopo: `hosting:write`","tags":["Hospedagem: bancos"],"responses":{"202":{"description":"Import na fila.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["operationId","backupId","database"],"properties":{"operationId":{"format":"uuid","description":"Acompanhe em `GET /operations/{id}`.","type":"string"},"backupId":{"format":"uuid","description":"Backup de segurança da conta, tirado antes de carregar o dump.","type":"string"},"database":{"type":"string"}}}}}}},"headers":{"Location":{"description":"Endpoint para acompanhar a tarefa: `/api/v1/hosting/{serviceId}/operations/{operationId}`.","schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"componentId","in":"query","required":false,"schema":{"format":"uuid","description":"Banco ou Redis da hospedagem de sites (obrigatório nela). No banco gerenciado (VDX) pode ficar de fora.","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["database","path"],"properties":{"database":{"minLength":1,"maxLength":64,"description":"Banco que já existe no motor e recebe o dump.","type":"string"},"path":{"minLength":1,"maxLength":1024,"description":"Arquivo na raiz `data` da hospedagem (`data/volumes`, que o site não serve), com caminho relativo a ela (ex.: `.vixpi-import/dump.sql.gz`, enviado por `POST /files/upload?root=data` ou por SFTP em `/data/volumes/.vixpi-import/`).","type":"string"},"clean":{"description":"`true`: esvazia o banco antes de carregar. Padrão `false` (carrega por cima).","type":"boolean"}}}}}},"operationId":"postHostingByServiceIdDatabasesImport","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/databases/{name}":{"delete":{"summary":"Apaga um banco da instância","description":"Apaga o banco e os dados dele (sem volta). O banco principal criado com a conta é protegido (409 `DB_PROTECTED`).\n\nEscopo: `hosting:write`","tags":["Hospedagem: bancos"],"responses":{"200":{"description":"Banco apagado.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["name","dropped"],"properties":{"name":{"type":"string"},"dropped":{"const":true,"type":"boolean"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"pattern":"^[a-z][a-z0-9_]{0,31}$","type":"string"}},{"name":"componentId","in":"query","required":false,"schema":{"format":"uuid","description":"Banco ou Redis da hospedagem de sites (obrigatório nela). No banco gerenciado (VDX) pode ficar de fora.","type":"string"}}],"operationId":"deleteHostingByServiceIdDatabasesByName","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/databases/users":{"post":{"summary":"Cria um usuário do banco","description":"`readwrite` lê e altera dados; `readonly` só lê. `database` `*` libera todos os bancos da instância. A senha é gerada no servidor e aparece SÓ nesta resposta (não fica guardada na Vixpi).\n\nEscopo: `hosting:write`","tags":["Hospedagem: bancos"],"responses":{"201":{"description":"Usuário criado.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["username","password","access","database","connectionUrl"],"properties":{"username":{"type":"string"},"password":{"description":"Mostrada só nesta resposta.","type":"string"},"access":{"enum":["admin","readwrite","readonly"],"type":"string"},"database":{"type":"string"},"connectionUrl":{"anyOf":[{"description":"URL de conexão com a senha.","type":"string"},{"type":"null"}]}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"componentId","in":"query","required":false,"schema":{"format":"uuid","description":"Banco ou Redis da hospedagem de sites (obrigatório nela). No banco gerenciado (VDX) pode ficar de fora.","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["username","access","database"],"properties":{"username":{"pattern":"^[a-z][a-z0-9_]{0,31}$","type":"string"},"access":{"type":"string","enum":["readwrite","readonly"]},"database":{"anyOf":[{"const":"*","type":"string"},{"pattern":"^[a-z][a-z0-9_]{0,31}$","type":"string"}]}}}}}},"operationId":"postHostingByServiceIdDatabasesUsers","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/databases/users/{username}/password":{"post":{"summary":"Gera uma senha nova para um usuário do banco","description":"A senha antiga para de valer na hora. A nova aparece SÓ nesta resposta. A senha do usuário principal (admin) também pode ser trocada aqui.\n\nEscopo: `hosting:write`","tags":["Hospedagem: bancos"],"responses":{"200":{"description":"Senha nova.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["username","password"],"properties":{"username":{"type":"string"},"password":{"description":"Mostrada só nesta resposta.","type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"username","in":"path","required":true,"schema":{"pattern":"^[a-z][a-z0-9_]{0,31}$","type":"string"}},{"name":"componentId","in":"query","required":false,"schema":{"format":"uuid","description":"Banco ou Redis da hospedagem de sites (obrigatório nela). No banco gerenciado (VDX) pode ficar de fora.","type":"string"}}],"operationId":"postHostingByServiceIdDatabasesUsersByUsernamePassword","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/databases/users/{username}":{"delete":{"summary":"Apaga um usuário do banco","description":"Derruba o acesso do usuário. O usuário principal (admin) é protegido (409 `DB_PROTECTED`).\n\nEscopo: `hosting:write`","tags":["Hospedagem: bancos"],"responses":{"200":{"description":"Usuário apagado.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["username","dropped"],"properties":{"username":{"type":"string"},"dropped":{"const":true,"type":"boolean"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"username","in":"path","required":true,"schema":{"pattern":"^[a-z][a-z0-9_]{0,31}$","type":"string"}},{"name":"componentId","in":"query","required":false,"schema":{"format":"uuid","description":"Banco ou Redis da hospedagem de sites (obrigatório nela). No banco gerenciado (VDX) pode ficar de fora.","type":"string"}}],"operationId":"deleteHostingByServiceIdDatabasesUsersByUsername","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/replica":{"get":{"tags":["Hospedagem: bancos"],"summary":"Réplica de leitura do banco gerenciado","description":"Papel do serviço (primário, réplica ou sozinho), situação e atraso da réplica e o endereço somente leitura (`db-ro`). `rebuildAt` diz quando a réplica volta sozinha depois de uma promoção (com a opção `read`). No primário, `promotion` diz o modo de promoção disponível agora, o motivo quando não há, o texto da confirmação e a perda estimada do failover. Sem segredo nem IP de nó.\n\nEscopo: `hosting:read`","responses":{"200":{"description":"Papel e situação da réplica.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"anyOf":[{"type":"object","required":["role","replica"],"properties":{"role":{"const":"standalone","type":"string"},"replica":{"type":"null"}}},{"type":"object","required":["role","replica"],"properties":{"role":{"enum":["primary","replica"],"type":"string"},"primaryServiceId":{"anyOf":[{"description":"Só quando `role` é `replica`.","type":"string"},{"type":"null"}]},"replica":{"type":"object","required":["serviceId","status","lagSeconds","lagBytes","statusReportedAt","statusStale","promotedAt","lastErrorCode","rebuildAt","endpoint"],"properties":{"serviceId":{"type":"string"},"status":{"enum":["seeding","streaming","degraded","broken","promoting","fenced"],"type":"string"},"lagSeconds":{"anyOf":[{"type":"number"},{"type":"null"}]},"lagBytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"statusReportedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"statusStale":{"type":"boolean"},"promotedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"lastErrorCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"rebuildAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"endpoint":{"anyOf":[{"type":"object","required":["fqdn","publicPort","status","certStatus"],"properties":{"fqdn":{"type":"string"},"publicPort":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"status":{"enum":["pending","active","removing","failed","parked"],"type":"string"},"certStatus":{"enum":["none","pending","active","renewing","failed"],"type":"string"}}},{"type":"null"}]}}},"promotion":{"description":"Só no serviço do primário.","type":"object","required":["mode","reason","availableAt","confirmText","dataLoss"],"properties":{"mode":{"anyOf":[{"enum":["switchover","failover"],"type":"string"},{"type":"null"}]},"reason":{"anyOf":[{"enum":["seeding","promoting","fenced","account_not_active","primary_not_ready","replica_offline","replica_broken","replica_status_stale","primary_silence_too_short","primary_reachable_by_replica","cooldown"],"type":"string"},{"type":"null"}]},"availableAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"confirmText":{"anyOf":[{"type":"string"},{"type":"null"}]},"dataLoss":{"anyOf":[{"type":"object","required":["lagSeconds","lagBytes","measuredAt"],"properties":{"lagSeconds":{"anyOf":[{"type":"number"},{"type":"null"}]},"lagBytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"measuredAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}}}]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdReplica","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]}},"/hosting/{serviceId}/replica/promote":{"post":{"tags":["Hospedagem: bancos"],"summary":"Promove a réplica de leitura a banco principal","description":"Só no serviço do banco principal. `switchover` (primário no ar, sem perda) ou `failover` (emergência, pode perder as últimas gravações; exige `acceptDataLoss: true`). `confirm` é o endereço `db` do banco. Um pedido por banco a cada 60 s. A réplica é recriada sozinha depois da promoção.\n\nEscopo: `hosting:write`","responses":{"202":{"description":"Promoção iniciada. Sem endpoint de operação: acompanhe em `GET /hosting/{serviceId}/replica`.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["status","mode"],"properties":{"status":{"const":"promoting","type":"string"},"mode":{"enum":["switchover","failover"],"type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["mode","confirm"],"properties":{"mode":{"type":"string","enum":["switchover","failover"]},"confirm":{"minLength":1,"maxLength":253,"type":"string"},"acceptDataLoss":{"type":"boolean"}}}}}},"operationId":"postHostingByServiceIdReplicaPromote","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/components/{componentId}/replica":{"get":{"summary":"Réplica de leitura de um banco do site","tags":["Hospedagem: bancos"],"description":"Estado da réplica do banco, réplicas contratadas e usadas no serviço e o endereço de leitura. `roUser` é só o nome do usuário: a senha é a do banco do site.\n\nEscopo: `hosting:read`","responses":{"200":{"description":"Situação da réplica.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["status","quota","roFqdn","roPort","roUser","roRules","lagSeconds","lagBytes","statusStale","lastErrorCode"],"properties":{"status":{"enum":["none","seeding","streaming","degraded","broken","promoting","fenced"],"type":"string"},"quota":{"type":"object","required":["included","used"],"properties":{"included":{"description":"Réplicas contratadas no adicional `site_db_replicas`.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"Réplicas contratadas no adicional `site_db_replicas`.","type":"integer"}]},"used":{"description":"Bancos do serviço que já têm réplica.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"Bancos do serviço que já têm réplica.","type":"integer"}]}}},"roFqdn":{"anyOf":[{"type":"string"},{"type":"null"}]},"roPort":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"roUser":{"anyOf":[{"description":"Usuário no endereço de leitura; a senha é a do banco do site.","type":"string"},{"type":"null"}]},"roRules":{"anyOf":[{"description":"Quem conecta no endereço de leitura; `null` enquanto ele não existe. Muda por `PUT .../replica/rules`.","type":"array","items":{"type":"object","required":["cidr","label"],"properties":{"cidr":{"type":"string"},"label":{"type":"string"}}}},{"type":"null"}]},"lagSeconds":{"anyOf":[{"type":"number"},{"type":"null"}]},"lagBytes":{"anyOf":[{"type":"number"},{"type":"null"}]},"statusStale":{"type":"boolean"},"lastErrorCode":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}},{"name":"componentId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"operationId":"getHostingByServiceIdComponentsByComponentIdReplica","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]},"put":{"summary":"Liga a réplica de leitura de um banco do site","tags":["Hospedagem: bancos"],"description":"Usa uma das réplicas contratadas no adicional do serviço. O banco reinicia uma vez (alguns segundos) para entrar na configuração de réplica; sem acesso externo ligado, o endereço do banco é criado sem regras (só a réplica entra).\n\nEscopo: `hosting:write`","responses":{"202":{"description":"Réplica pedida.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["status"],"properties":{"status":{"enum":["seeding","removing"],"type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}},{"name":"componentId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"operationId":"putHostingByServiceIdComponentsByComponentIdReplica","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]},"delete":{"summary":"Desliga a réplica de leitura de um banco do site","tags":["Hospedagem: bancos"],"description":"Remove a réplica do banco e libera uma das réplicas contratadas. O banco do site reinicia uma vez para sair da configuração de réplica.\n\nEscopo: `hosting:write`","responses":{"202":{"description":"Remoção pedida.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["status"],"properties":{"status":{"enum":["seeding","removing"],"type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}},{"name":"componentId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"operationId":"deleteHostingByServiceIdComponentsByComponentIdReplica","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/components/{componentId}/replica/rules":{"put":{"summary":"Troca quem conecta no endereço de leitura da réplica","tags":["Hospedagem: bancos"],"description":"Substitui a lista inteira de IPs liberados no endereço `-ro` da réplica do banco (até 100 regras; CIDR IPv4 ou IPv6). Lista vazia bloqueia todo acesso. Regra nova ampla (qualquer IP, IPv4 maior que `/8`, IPv6 maior que `/16`) exige `confirmAnyIp: true`; sem ela, 422 `HOSTING_ENDPOINT_ANY_IP_UNCONFIRMED`. Réplica ainda na cópia inicial, sem endereço: 409 `HOSTING_REPLICA_SEEDING`. A mudança termina no servidor da réplica, por isso a resposta é 202.\n\nEscopo: `hosting:write`","responses":{"202":{"description":"Regras gravadas; `operationId` nulo quando nada vai ao servidor.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["roRules","operationId"],"properties":{"roRules":{"type":"array","items":{"type":"object","required":["cidr","label"],"properties":{"cidr":{"type":"string"},"label":{"type":"string"}}}},"operationId":{"anyOf":[{"format":"uuid","description":"`null` quando nada mudou no servidor.","type":"string"},{"type":"null"}]}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}},{"name":"componentId","in":"path","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["rules"],"properties":{"rules":{"type":"array","items":{"type":"object","required":["cidr","label"],"properties":{"cidr":{"minLength":1,"maxLength":64,"type":"string"},"label":{"maxLength":60,"type":"string"}}}},"confirmAnyIp":{"type":"boolean"}}}}}},"operationId":"putHostingByServiceIdComponentsByComponentIdReplicaRules","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/runtimes":{"get":{"summary":"Lista os runtimes disponíveis","tags":["Hospedagem"],"responses":{"200":{"description":"Catálogo de runtimes.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","required":["id","name","description","versions"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"extra":{"description":"Runtime extra (Java, .NET): plano Business.","type":"boolean"},"versions":{"type":"array","items":{"type":"object","required":["version","support","minMemoryMb","defaultPort"],"properties":{"version":{"type":"string"},"support":{"enum":["active","security","eol"],"type":"string"},"minMemoryMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"defaultPort":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"getHostingRuntimes","description":"Escopo: `hosting:read`","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]}},"/hosting/database-versions":{"get":{"summary":"Lista as versões de banco disponíveis","tags":["Hospedagem"],"responses":{"200":{"description":"Catálogo de bancos.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","required":["kind","name","defaultVersion","legacyVersion","versions"],"properties":{"kind":{"enum":["db-postgres","db-mysql","db-mariadb"],"type":"string"},"name":{"type":"string"},"defaultVersion":{"type":"string"},"legacyVersion":{"type":"string"},"versions":{"type":"array","items":{"type":"object","required":["version","support","label"],"properties":{"version":{"type":"string"},"support":{"enum":["active","security","eol"],"type":"string"},"label":{"type":"string"}}}}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"getHostingDatabaseVersions","description":"Escopo: `hosting:read`","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]}},"/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"],"responses":{"200":{"description":"Conta de hospedagem.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","serviceId","shortName","kind","mode","status","limits","pendingLimits","suspendedReason","createdAt"],"properties":{"id":{"format":"uuid","type":"string"},"serviceId":{"type":"string"},"shortName":{"type":"string"},"kind":{"enum":["site","database","bot"],"type":"string"},"mode":{"enum":["mounted","built"],"type":"string"},"status":{"enum":["provisioning","active","suspended","migrating","terminating","terminated","failed"],"type":"string"},"technicalHost":{"description":"Só em conta `site`.","type":"string"},"nodeIpv4":{"anyOf":[{"description":"Só em conta `site`.","type":"string"},{"type":"null"}]},"nodeIpv6":{"anyOf":[{"description":"Só em conta `site`.","type":"string"},{"type":"null"}]},"siteDbMigrationNoticeDate":{"anyOf":[{"format":"date","description":"Só em conta `site`: dia (AAAA-MM-DD) em que os bancos do site no modelo antigo perdem o superusuário, para o aviso do painel. `null` = sem aviso.","type":"string"},{"type":"null"}]},"limits":{"additionalProperties":true,"type":"object","required":["memoryMb","cpuMilli","diskMb","maxApps","maxDatabases","redis","maxDomains","maxWorkers","buildMinutesPerMonth","backupRetentionDays","egressSmtp"],"properties":{"memoryMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"cpuMilli":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"diskMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"maxApps":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"maxDatabases":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"redis":{"type":"boolean"},"maxDomains":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"maxWorkers":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"buildMinutesPerMonth":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"backupRetentionDays":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"egressSmtp":{"type":"boolean"}}},"pendingLimits":{"anyOf":[{"additionalProperties":true,"type":"object","required":["memoryMb","cpuMilli","diskMb","maxApps","maxDatabases","redis","maxDomains","maxWorkers","buildMinutesPerMonth","backupRetentionDays","egressSmtp"],"properties":{"memoryMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"cpuMilli":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"diskMb":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"maxApps":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"maxDatabases":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"redis":{"type":"boolean"},"maxDomains":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"maxWorkers":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"buildMinutesPerMonth":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"backupRetentionDays":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"egressSmtp":{"type":"boolean"}}},{"type":"null"}]},"suspendedReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdAccount","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]}},"/hosting/{serviceId}/account/mode":{"put":{"summary":"Troca o modo da conta (`mounted` ou `built`)","tags":["Hospedagem"],"responses":{"200":{"description":"Modo novo.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["mode"],"properties":{"mode":{"enum":["mounted","built"],"type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":[]}]}},"/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"],"responses":{"200":{"description":"Operação e passos.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","kind","status","error","steps","createdAt"],"properties":{"id":{"format":"uuid","type":"string"},"kind":{"description":"Tipo da operação, ex.: `component.action`, `deploy`.","type":"string"},"status":{"enum":["queued","running","succeeded","failed","cancelled"],"type":"string"},"error":{"anyOf":[{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},{"type":"null"}]},"steps":{"type":"array","items":{"type":"object","required":["key","label","status","startedAt","finishedAt"],"properties":{"key":{"type":"string"},"label":{"type":"string"},"status":{"enum":["pending","running","done","failed","skipped"],"type":"string"},"startedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"finishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]}}}},"createdAt":{"format":"date-time","type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":[]}]}},"/hosting/{serviceId}/backups":{"get":{"summary":"Lista os backups da hospedagem","tags":["Hospedagem: backups"],"responses":{"200":{"description":"Backups.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","required":["id","kind","status","sizeBytes","createdAt","expiresAt"],"properties":{"id":{"format":"uuid","type":"string"},"kind":{"enum":["scheduled","manual","pre-restore","final"],"type":"string"},"status":{"enum":["pending","running","completed","failed","expired"],"type":"string"},"sizeBytes":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"expiresAt":{"format":"date-time","type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdBackups","description":"Escopo: `hosting:read`","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]},"post":{"summary":"Cria um backup","tags":["Hospedagem: backups"],"responses":{"201":{"description":"Backup pedido.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","kind","status","sizeBytes","createdAt","expiresAt"],"properties":{"id":{"format":"uuid","type":"string"},"kind":{"enum":["scheduled","manual","pre-restore","final"],"type":"string"},"status":{"enum":["pending","running","completed","failed","expired"],"type":"string"},"sizeBytes":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"expiresAt":{"format":"date-time","type":"string"}}}}}}}},"400":{"$ref":"#/components/responses/IdempotencyKeyInvalid"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"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"],"responses":{"200":{"description":"Link de download.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["url","expiresIn"],"properties":{"url":{"description":"URL assinada para baixar o backup.","type":"string"},"expiresIn":{"description":"Validade da URL em segundos.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"Validade da URL em segundos.","type":"integer"}]}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":[]}]}},"/hosting/{serviceId}/backups/{backupId}/restore":{"post":{"summary":"Restaura um backup","description":"Operação assíncrona: responde 202 com o `operationId`. Sem corpo, restaura a conta inteira (com um backup de segurança antes). Banco gerenciado: `intoDatabase` carrega o dump do banco principal num banco NOVO com esse nome, sem tocar no original (Redis: a operação falha com `DB_UNSUPPORTED`).\n\nEscopo: `hosting:write`","tags":["Hospedagem: backups"],"responses":{"202":{"description":"Aceito para processamento.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["operationId","backupId","message"],"properties":{"operationId":{"format":"uuid","description":"Acompanhe em `GET /operations/{id}`.","type":"string"},"backupId":{"format":"uuid","type":"string"},"message":{"type":"string"}}}}}}},"headers":{"Location":{"description":"Endpoint para acompanhar a tarefa: `/api/v1/hosting/{serviceId}/operations/{operationId}`.","schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"backupId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"intoDatabase":{"maxLength":32,"type":"string"}}}}}},"operationId":"postHostingByServiceIdBackupsByBackupIdRestore","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/domains":{"get":{"summary":"Lista os domínios do projeto","tags":["Hospedagem: domínios"],"responses":{"200":{"description":"Domínios.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","required":["id","appId","domain","isPrimary","verification","verificationToken","forceHttps","wwwRedirect","certStatus","createdAt","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"appId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"domain":{"type":"string"},"isPrimary":{"type":"boolean"},"verification":{"enum":["pending","verified","failed"],"type":"string"},"verificationToken":{"type":"string"},"forceHttps":{"type":"boolean"},"wwwRedirect":{"enum":["none","to_www","from_www"],"type":"string"},"certStatus":{"enum":["none","pending","active","renewing","failed"],"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","in":"query","required":false,"schema":{"format":"uuid","type":"string"}}],"operationId":"getHostingByServiceIdDomains","description":"Escopo: `hosting:read`","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]},"post":{"summary":"Adiciona um domínio","tags":["Hospedagem: domínios"],"responses":{"201":{"description":"Domínio adicionado.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","appId","domain","isPrimary","verification","verificationToken","forceHttps","wwwRedirect","certStatus","createdAt","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"appId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"domain":{"type":"string"},"isPrimary":{"type":"boolean"},"verification":{"enum":["pending","verified","failed"],"type":"string"},"verificationToken":{"type":"string"},"forceHttps":{"type":"boolean"},"wwwRedirect":{"enum":["none","to_www","from_www"],"type":"string"},"certStatus":{"enum":["none","pending","active","renewing","failed"],"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}}}}},"400":{"$ref":"#/components/responses/IdempotencyKeyInvalid"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"appId":{"format":"uuid","type":"string"},"domain":{"type":"string"},"isPrimary":{"type":"boolean"},"forceHttps":{"type":"boolean"},"wwwRedirect":{"type":"string","enum":["none","to_www","from_www"]}}}}}},"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"],"responses":{"200":{"description":"Domínio alterado.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","appId","domain","isPrimary","verification","verificationToken","forceHttps","wwwRedirect","certStatus","createdAt","updatedAt","operationId"],"properties":{"id":{"format":"uuid","type":"string"},"appId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"domain":{"type":"string"},"isPrimary":{"type":"boolean"},"verification":{"enum":["pending","verified","failed"],"type":"string"},"verificationToken":{"type":"string"},"forceHttps":{"type":"boolean"},"wwwRedirect":{"enum":["none","to_www","from_www"],"type":"string"},"certStatus":{"enum":["none","pending","active","renewing","failed"],"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"operationId":{"anyOf":[{"format":"uuid","description":"`null` quando o vhost não precisa mudar.","type":"string"},{"type":"null"}]}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"domainId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"appId":{"format":"uuid","type":"string"},"isPrimary":{"type":"boolean"},"forceHttps":{"type":"boolean"},"wwwRedirect":{"type":"string","enum":["none","to_www","from_www"]}}}}}},"operationId":"patchHostingByServiceIdDomainsByDomainId","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]},"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"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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. Sem `appId`, lê a do app principal.\n\nEscopo: `hosting:read`","tags":["Hospedagem: deploy"],"responses":{"200":{"description":"Fonte Git.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","appId","provider","repoUrl","branch","subdir","deployKeyPublic","webhookId","webhookUrl","autoDeploy","composeFile","composeAppService","github","createdAt","updatedAt"],"properties":{"id":{"format":"uuid","type":"string"},"appId":{"format":"uuid","type":"string"},"provider":{"enum":["git","github_app"],"type":"string"},"repoUrl":{"type":"string"},"branch":{"type":"string"},"subdir":{"type":"string"},"deployKeyPublic":{"anyOf":[{"type":"string"},{"type":"null"}]},"webhookId":{"anyOf":[{"type":"string"},{"type":"null"}]},"webhookUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"autoDeploy":{"type":"boolean"},"composeFile":{"anyOf":[{"type":"string"},{"type":"null"}]},"composeAppService":{"anyOf":[{"type":"string"},{"type":"null"}]},"github":{"anyOf":[{"type":"object","required":["installationId","repositoryId","repoFullName","htmlUrl","disconnectedAt","disconnectedReason","disconnectedLabel"],"properties":{"installationId":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"repositoryId":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"repoFullName":{"anyOf":[{"type":"string"},{"type":"null"}]},"htmlUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"disconnectedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"disconnectedReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"disconnectedLabel":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","in":"query","required":false,"schema":{"format":"uuid","type":"string"}}],"operationId":"getHostingByServiceIdGit","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]},"post":{"summary":"Configura a fonte Git","description":"Gera a chave de deploy e o webhook. O `webhookSecret` aparece só na criação. Sem `appId`, configura o app principal.\n\nEscopo: `hosting:write`","tags":["Hospedagem: deploy"],"responses":{"201":{"description":"Fonte configurada.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"anyOf":[{"type":"object","required":["id","provider","repoFullName"],"properties":{"id":{"format":"uuid","type":"string"},"provider":{"const":"github_app","type":"string"},"repoFullName":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"object","required":["id","provider","deployKeyPublic","webhookId","webhookUrl","webhookSecret"],"properties":{"id":{"format":"uuid","type":"string"},"provider":{"const":"git","type":"string"},"deployKeyPublic":{"anyOf":[{"type":"string"},{"type":"null"}]},"webhookId":{"type":"string"},"webhookUrl":{"type":"string"},"webhookSecret":{"anyOf":[{"description":"Só na criação da fonte.","type":"string"},{"type":"null"}]}}}]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["branch"],"properties":{"provider":{"type":"string","enum":["git","github_app"]},"appId":{"format":"uuid","type":"string"},"repoUrl":{"type":"string"},"installationId":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"repositoryId":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"branch":{"type":"string"},"subdir":{"type":"string"},"autoDeploy":{"type":"boolean"},"composeFile":{"type":["string","null"]},"composeAppService":{"type":["string","null"]}}}}}},"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. Corpo opcional `{ appId }`; sem ele, rotaciona o do app principal.\n\nEscopo: `hosting:write`","tags":["Hospedagem: deploy"],"responses":{"200":{"description":"Segredo novo.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["webhookSecret"],"properties":{"webhookSecret":{"type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"appId":{"format":"uuid","type":"string"}}}}}},"operationId":"postHostingByServiceIdGitWebhookSecret","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/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"],"responses":{"200":{"description":"Variáveis do projeto e dos componentes.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["project","components"],"properties":{"project":{"type":"array","items":{"type":"object","required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"components":{"type":"array","items":{"type":"object","required":["componentId","name","origin","vars"],"properties":{"componentId":{"format":"uuid","type":"string"},"name":{"type":"string"},"origin":{"enum":["panel","vixpi-json","compose"],"type":"string"},"vars":{"type":"array","items":{"type":"object","required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}}}}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdEnv","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]},"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.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["operationId"],"properties":{"operationId":{"format":"uuid","description":"Acompanhe em `GET /operations/{id}`.","type":"string"}}}}}}},"headers":{"Location":{"description":"Endpoint para acompanhar a tarefa: `/api/v1/hosting/{serviceId}/operations/{operationId}`.","schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":{"200":{"description":"Push ignorado (branch, auto deploy ou entrega repetida).","content":{"application/json":{"schema":{"type":"object","required":["ignored","reason"],"properties":{"ignored":{"const":true,"type":"boolean"},"reason":{"enum":["branch mismatch","auto deploy disabled","duplicate delivery"],"type":"string"}}}}}},"202":{"description":"Deploy enfileirado. O `Location` aponta para o deploy, que se lê com sessão ou token com escopo `hosting:read`.","content":{"application/json":{"schema":{"type":"object","required":["deploymentId"],"properties":{"deploymentId":{"format":"uuid","type":"string"}}}}},"headers":{"Location":{"description":"Endpoint para acompanhar a tarefa: `/api/v1/hosting/{serviceId}/deployments/{deploymentId}`.","schema":{"type":"string"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"webhookId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"postHostingHooksByWebhookId","security":[]}},"/github/webhook":{"post":{"summary":"Recebe os eventos do GitHub App","description":"Público: autenticado pela assinatura `X-Hub-Signature-256`. Eventos: `push`, `installation`, `installation_repositories`, `repository`.","tags":["Hospedagem: deploy"],"responses":{"200":{"description":"Entrega repetida ou GitHub App removido (descartada).","content":{"application/json":{"schema":{"type":"object","required":["ignored"],"properties":{"ignored":{"enum":["not_configured","duplicate"],"type":"string"}}}}}},"202":{"description":"Aceito para processamento.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["kind"],"properties":{"kind":{"enum":["ignored","deploys","installation","repository"],"description":"O que a entrega disparou; `deploys` enfileira os deploys.","type":"string"}}}}}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"postGithubWebhook","security":[]}},"/hosting/{serviceId}/deploy-tokens":{"post":{"summary":"Cria um token de deploy","description":"O valor do token (`vxdt_...`) aparece só nesta resposta. `appId` ausente = app principal.\n\nEscopo: `hosting:write`","tags":["Hospedagem: deploy"],"responses":{"201":{"description":"Token criado.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","name","token"],"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"token":{"description":"Valor em claro (`vxdt_...`), mostrado só agora.","type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"appId":{"format":"uuid","type":"string"}}}}}},"operationId":"postHostingByServiceIdDeployTokens","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]},"get":{"summary":"Lista os tokens de deploy","tags":["Hospedagem: deploy"],"responses":{"200":{"description":"Tokens (sem o valor).","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","required":["id","appId","name","lastUsedAt","revokedAt","createdAt"],"properties":{"id":{"format":"uuid","type":"string"},"appId":{"format":"uuid","type":"string"},"name":{"type":"string"},"lastUsedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"revokedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","in":"query","required":false,"schema":{"format":"uuid","type":"string"}}],"operationId":"getHostingByServiceIdDeployTokens","description":"Escopo: `hosting:read`","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]}},"/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"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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"],"responses":{"200":{"description":"Estado do SFTP.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["enabled","username","hasPassword","publicKeys"],"properties":{"enabled":{"type":"boolean"},"username":{"type":"string"},"hasPassword":{"type":"boolean"},"publicKeys":{"type":"array","items":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdSftp","description":"Escopo: `hosting:read`","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]},"put":{"summary":"Ativa o SFTP ou atualiza as chaves","tags":["Hospedagem"],"responses":{"200":{"description":"SFTP ativo.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["username"],"properties":{"username":{"type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":[]}]},"delete":{"summary":"Desativa o SFTP","tags":["Hospedagem"],"responses":{"200":{"description":"SFTP desativado.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["username"],"properties":{"username":{"type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"deleteHostingByServiceIdSftp","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/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"],"responses":{"200":{"description":"Senha trocada.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["username"],"properties":{"username":{"type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":[]}]}},"/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. O `Location` aponta para o deploy, que se lê com sessão ou token com escopo `hosting:read` (não com o token de deploy).","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["deploymentId"],"properties":{"deploymentId":{"format":"uuid","type":"string"}}}}}}},"headers":{"Location":{"description":"Endpoint para acompanhar a tarefa: `/api/v1/hosting/{serviceId}/deployments/{deploymentId}`.","schema":{"type":"string"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"operationId":"postHostingDeploy","security":[]}},"/hosting/{serviceId}/deployments":{"get":{"summary":"Lista os deploys","tags":["Hospedagem: deploy"],"responses":{"200":{"description":"Deploys e minutos de build.","content":{"application/json":{"schema":{"type":"object","required":["buildMinutes","data"],"properties":{"buildMinutes":{"anyOf":[{"description":"Minutos de build do mês; `null` no modo `mounted`.","type":"object","required":["used","limit","exhausted","resetsAt"],"properties":{"used":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"limit":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"exhausted":{"type":"boolean"},"resetsAt":{"format":"date-time","type":"string"}}},{"type":"null"}]},"data":{"type":"array","items":{"type":"object","required":["id","appId","status","source","ref","commitSha","buildMethod","image","durationMs","createdAt","createdBy"],"properties":{"id":{"format":"uuid","type":"string"},"appId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"status":{"enum":["queued","building","deploying","live","failed","cancelled","superseded"],"type":"string"},"source":{"enum":["git","webhook","actions","manual","image","rollback","upload"],"type":"string"},"ref":{"anyOf":[{"type":"string"},{"type":"null"}]},"commitSha":{"anyOf":[{"type":"string"},{"type":"null"}]},"buildMethod":{"anyOf":[{"enum":["vixpi-json","dockerfile","compose","railpack","nixpacks","template","none"],"type":"string"},{"type":"null"}]},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"durationMs":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}},{"name":"appId","in":"query","required":false,"schema":{"format":"uuid","type":"string"}}],"operationId":"getHostingByServiceIdDeployments","description":"Escopo: `hosting:read`","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]},"post":{"summary":"Dispara um deploy da fonte Git configurada ou de um .zip enviado","description":"Corpo opcional `{ appId, source, archivePath }`; sem `appId`, publica o app principal. `source: \"upload\"` exige `archivePath` (.zip na área de arquivos) e conta no modo imagem.\n\nEscopo: `hosting:deploy`","tags":["Hospedagem: deploy"],"responses":{"202":{"description":"Aceito para processamento.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["deploymentId"],"properties":{"deploymentId":{"format":"uuid","type":"string"}}}}}}},"headers":{"Location":{"description":"Endpoint para acompanhar a tarefa: `/api/v1/hosting/{serviceId}/deployments/{deploymentId}`.","schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/IdempotencyKeyInvalid"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"appId":{"format":"uuid","type":"string"},"source":{"type":"string","enum":["git","upload"]},"archivePath":{"minLength":1,"maxLength":1024,"type":"string"}}}}}},"operationId":"postHostingByServiceIdDeployments","security":[{"oauth2":["hosting:deploy"]},{"apiKey":[]}]}},"/hosting/{serviceId}/deployments/{deploymentId}":{"get":{"summary":"Detalha um deploy","tags":["Hospedagem: deploy"],"responses":{"200":{"description":"Deploy.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","appId","status","source","ref","commitSha","buildMethod","image","durationMs","createdAt","createdBy","logUrl"],"properties":{"id":{"format":"uuid","type":"string"},"appId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"status":{"enum":["queued","building","deploying","live","failed","cancelled","superseded"],"type":"string"},"source":{"enum":["git","webhook","actions","manual","image","rollback","upload"],"type":"string"},"ref":{"anyOf":[{"type":"string"},{"type":"null"}]},"commitSha":{"anyOf":[{"type":"string"},{"type":"null"}]},"buildMethod":{"anyOf":[{"enum":["vixpi-json","dockerfile","compose","railpack","nixpacks","template","none"],"type":"string"},{"type":"null"}]},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"durationMs":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"logUrl":{"anyOf":[{"description":"URL assinada do log de build (5 minutos).","type":"string"},{"type":"null"}]}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":[]}]}},"/hosting/{serviceId}/deployments/{deploymentId}/rollback":{"post":{"summary":"Volta para um deploy anterior","tags":["Hospedagem: deploy"],"responses":{"202":{"description":"Aceito para processamento.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["deploymentId"],"properties":{"deploymentId":{"format":"uuid","type":"string"}}}}}}},"headers":{"Location":{"description":"Endpoint para acompanhar a tarefa: `/api/v1/hosting/{serviceId}/deployments/{deploymentId}`.","schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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"],"responses":{"200":{"description":"Cancelado na hora.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["result"],"properties":{"result":{"enum":["cancelled","cancel_requested"],"type":"string"}}}}}}}},"202":{"description":"Cancelamento em curso.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["result"],"properties":{"result":{"enum":["cancelled","cancel_requested"],"type":"string"}}}}}}},"headers":{"Location":{"description":"Endpoint para acompanhar a tarefa: `/api/v1/hosting/{serviceId}/deployments/{deploymentId}`.","schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":[]}]}},"/hosting/{serviceId}/files":{"get":{"summary":"Lista um diretório","description":"Informe o caminho em `path`.\n\nEscopo: `hosting:read`","tags":["Hospedagem: arquivos"],"responses":{"200":{"description":"Entradas do diretório.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["entries"],"properties":{"entries":{"type":"array","items":{"type":"object","required":["name","path","isDirectory","isFile","sizeBytes","mtimeMs","mode"],"properties":{"name":{"type":"string"},"path":{"type":"string"},"isDirectory":{"type":"boolean"},"isFile":{"type":"boolean"},"sizeBytes":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"mtimeMs":{"type":"number"},"mode":{"type":"string"}}}},"cursor":{"description":"Próxima página (opaco).","type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"path","in":"query","required":false,"schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}},{"name":"root","in":"query","required":false,"schema":{"type":"string","enum":["code","data"]}}],"operationId":"getHostingByServiceIdFiles","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]}},"/hosting/{serviceId}/files/stat":{"get":{"summary":"Metadados de um arquivo","tags":["Hospedagem: arquivos"],"responses":{"200":{"description":"Metadados.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["name","path","isDirectory","isFile","sizeBytes","mtimeMs","mode"],"properties":{"name":{"type":"string"},"path":{"type":"string"},"isDirectory":{"type":"boolean"},"isFile":{"type":"boolean"},"sizeBytes":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"mtimeMs":{"type":"number"},"mode":{"type":"string"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"path","in":"query","required":false,"schema":{"type":"string"}},{"name":"root","in":"query","required":false,"schema":{"type":"string","enum":["code","data"]}}],"operationId":"getHostingByServiceIdFilesStat","description":"Escopo: `hosting:read`","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]}},"/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"],"responses":{"200":{"description":"Conteúdo do arquivo.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["content","mtimeMs","binary"],"properties":{"content":{"type":"string"},"mtimeMs":{"type":"number"},"binary":{"type":"boolean"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"path","in":"query","required":false,"schema":{"type":"string"}},{"name":"root","in":"query","required":false,"schema":{"type":"string","enum":["code","data"]}}],"operationId":"getHostingByServiceIdFilesRead","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/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"],"responses":{"200":{"description":"Conteúdo do arquivo.","content":{"application/octet-stream":{}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"path","in":"query","required":false,"schema":{"type":"string"}},{"name":"root","in":"query","required":false,"schema":{"type":"string","enum":["code","data"]}}],"operationId":"getHostingByServiceIdFilesDownload","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/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"],"responses":{"200":{"description":"Progresso do upload.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["offset"],"properties":{"offset":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdFilesUploadStatus","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]}},"/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"],"responses":{"200":{"description":"Arquivo gravado.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["mtimeMs"],"properties":{"mtimeMs":{"type":"number"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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"]},"root":{"type":"string","enum":["code","data"]}}}}}},"operationId":"putHostingByServiceIdFilesWrite","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/files/mkdir":{"post":{"summary":"Cria um diretório","tags":["Hospedagem: arquivos"],"responses":{"200":{"description":"Feito.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["ok"],"properties":{"ok":{"const":true,"type":"boolean"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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"},"root":{"type":"string","enum":["code","data"]}}}}}},"operationId":"postHostingByServiceIdFilesMkdir","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/files/rename":{"post":{"summary":"Renomeia ou move um arquivo","tags":["Hospedagem: arquivos"],"responses":{"200":{"description":"Feito.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["ok"],"properties":{"ok":{"const":true,"type":"boolean"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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"},"root":{"type":"string","enum":["code","data"]}}}}}},"operationId":"postHostingByServiceIdFilesRename","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/files/copy":{"post":{"summary":"Copia um arquivo ou diretório","tags":["Hospedagem: arquivos"],"responses":{"200":{"description":"Feito.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["ok"],"properties":{"ok":{"const":true,"type":"boolean"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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"},"root":{"type":"string","enum":["code","data"]}}}}}},"operationId":"postHostingByServiceIdFilesCopy","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/files/delete":{"post":{"summary":"Apaga um arquivo ou diretório","tags":["Hospedagem: arquivos"],"responses":{"200":{"description":"Feito.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["ok"],"properties":{"ok":{"const":true,"type":"boolean"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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"},"root":{"type":"string","enum":["code","data"]}}}}}},"operationId":"postHostingByServiceIdFilesDelete","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/files/chmod":{"post":{"summary":"Altera as permissões de um arquivo","tags":["Hospedagem: arquivos"],"responses":{"200":{"description":"Feito.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["ok"],"properties":{"ok":{"const":true,"type":"boolean"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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?[0-7]{3}$","type":"string"},"root":{"type":"string","enum":["code","data"]}}}}}},"operationId":"postHostingByServiceIdFilesChmod","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/files/extract":{"post":{"summary":"Descompacta um arquivo","tags":["Hospedagem: arquivos"],"responses":{"200":{"description":"Feito.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["ok"],"properties":{"ok":{"const":true,"type":"boolean"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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"},"root":{"type":"string","enum":["code","data"]}}}}}},"operationId":"postHostingByServiceIdFilesExtract","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/{serviceId}/files/compress":{"post":{"summary":"Compacta arquivos","tags":["Hospedagem: arquivos"],"responses":{"200":{"description":"Feito.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["ok"],"properties":{"ok":{"const":true,"type":"boolean"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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"]},"root":{"type":"string","enum":["code","data"]}}}}}},"operationId":"postHostingByServiceIdFilesCompress","description":"Escopo: `hosting:write`","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/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"],"responses":{"200":{"description":"Upload gravado.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"additionalProperties":true,"type":"object","required":["ok","streamId"],"properties":{"ok":{"type":"boolean"},"streamId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"sizeBytes":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"offset":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"complete":{"description":"`false`: parcial guardado, continue de `offset`.","type":"boolean"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}},{"name":"path","in":"query","required":false,"schema":{"type":"string"}},{"name":"uploadId","in":"query","required":false,"schema":{"type":"string"}},{"name":"offset","in":"query","required":false,"schema":{"type":"string"}},{"name":"total","in":"query","required":false,"schema":{"type":"string"}},{"name":"root","in":"query","required":false,"schema":{"type":"string","enum":["code","data"]}}],"operationId":"postHostingByServiceIdFilesUpload","security":[{"oauth2":["hosting:write"]},{"apiKey":[]}]}},"/hosting/metrics":{"get":{"summary":"CPU e memória atuais de várias hospedagens","description":"Para listas: uso atual (soma da última leitura de cada componente nos últimos 5 minutos) e a CPU por minuto da última hora de cada conta do próprio cliente. `services` leva até 50 ids separados por vírgula; os que não são hospedagem da conta voltam em `unavailable`.\n\nEscopo: `hosting:read`","tags":["Hospedagem"],"responses":{"200":{"description":"Uso de cada conta.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["items","unavailable"],"properties":{"items":{"type":"array","items":{"type":"object","required":["serviceId","accountId","kind","cpuMilli","memoryMb","measuredAt","cpuHistory"],"properties":{"serviceId":{"format":"uuid","type":"string"},"accountId":{"format":"uuid","type":"string"},"kind":{"enum":["site","database","bot"],"type":"string"},"cpuMilli":{"description":"CPU agora, milicores.","anyOf":[{"type":"number"},{"type":"null"}]},"memoryMb":{"description":"Memória agora, MB.","anyOf":[{"type":"number"},{"type":"null"}]},"measuredAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"cpuHistory":{"type":"array","items":{"type":"object","required":["minute","cpuMilli"],"properties":{"minute":{"format":"date-time","type":"string"},"cpuMilli":{"type":"number"}}}}}}},"unavailable":{"description":"Ids pedidos que não são hospedagem da conta (de outro cliente, inexistentes ou sem conta).","type":"array","items":{"format":"uuid","type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"services","in":"query","required":true,"schema":{"minLength":1,"maxLength":2000,"type":"string"}}],"operationId":"getHostingMetrics","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]}},"/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"],"responses":{"200":{"description":"Séries por componente.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["accountId","range","series"],"properties":{"accountId":{"format":"uuid","type":"string"},"range":{"enum":["1h","6h","24h","7d"],"type":"string"},"series":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["minute","cpuMilli","memoryMb"],"properties":{"minute":{"format":"date-time","type":"string"},"cpuMilli":{"type":"number"},"memoryMb":{"type":"number"}}}}}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdMetrics","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]}},"/hosting/{serviceId}/access-logs/domains":{"get":{"summary":"Lista os domínios com log de acesso","tags":["Hospedagem"],"responses":{"200":{"description":"Domínios.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","required":["host","primary"],"properties":{"host":{"type":"string"},"primary":{"type":"boolean"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdAccessLogsDomains","description":"Escopo: `hosting:read`","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]}},"/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"],"responses":{"200":{"description":"Linhas do log de acesso.","content":{"text/plain":{}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"parameters":[{"name":"serviceId","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getHostingByServiceIdAccessLogsStream","security":[{"oauth2":["hosting:read"]},{"apiKey":[]}]}},"/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"],"responses":{"200":{"description":"Linhas do log de build.","content":{"text/plain":{}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":[]}]}},"/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"],"responses":{"200":{"description":"Log de build.","content":{"text/plain":{}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Erro inesperado no servidor. Tente de novo mais tarde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"INTERNAL_SERVER_ERROR","code":"INTERNAL_SERVER_ERROR","message":"Erro interno inesperado."}}}}},"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":[]}]}}},"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":"Explicação em pt-BR para mostrar à pessoa; pode mudar, não compare."},"details":{"description":"Detalhes extras, quando existirem. Em `VALIDATION_ERROR` é a lista de `ValidationIssue`."}}},"ValidationIssue":{"type":"object","description":"Um campo recusado pela validação. O valor enviado nunca volta na resposta.","required":["path","message"],"properties":{"path":{"type":"string","description":"Caminho do campo (JSON Pointer), ex.: `/subject`."},"message":{"type":"string","description":"Motivo da recusa."},"summary":{"type":"string","description":"Resumo legível, quando existir."}}}},"responses":{"Unauthorized":{"description":"Token ausente, inválido, expirado ou revogado.","headers":{"WWW-Authenticate":{"description":"Desafio RFC 6750, ex.: `Bearer error=\"invalid_token\", error_description=\"invalid token\", resource_metadata=\"https://api.vixpi.host/.well-known/oauth-protected-resource\"`. O `resource_metadata` (RFC 9728) aponta o documento com o emissor e os escopos aceitos.","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` e traz `resource_metadata` (RFC 9728), ex.: `Bearer error=\"insufficient_scope\", error_description=\"missing scope\", scope=\"tickets:write\", resource_metadata=\"https://api.vixpi.host/.well-known/oauth-protected-resource\"`.","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) ou por IP.","headers":{"Retry-After":{"description":"Segundos até poder tentar de novo.","schema":{"type":"integer"}},"RateLimit-Limit":{"description":"Requisições permitidas por janela.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requisições que ainda cabem na janela atual (0 aqui).","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Segundos até a janela virar.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"RATE_LIMITED","code":"RATE_LIMITED","message":"Limite de requisições excedido."}}}},"IdempotencyKeyInvalid":{"description":"`Idempotency-Key` fora do formato (1 a 255 caracteres ASCII visíveis).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"IDEMPOTENCY_KEY_INVALID","code":"IDEMPOTENCY_KEY_INVALID","message":"Idempotency-Key deve ter de 1 a 255 caracteres ASCII visíveis."}}}},"IdempotencyConflict":{"description":"A `Idempotency-Key` já foi usada com outro pedido (`IDEMPOTENCY_KEY_REUSED`) ou o primeiro pedido ainda está em andamento (`IDEMPOTENCY_IN_PROGRESS`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"IDEMPOTENCY_KEY_REUSED","code":"IDEMPOTENCY_KEY_REUSED","message":"Esta Idempotency-Key já foi usada com outro pedido."}}}},"ValidationError":{"description":"Parâmetro ou corpo fora do esquema da operação. `details` lista cada campo recusado.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["details"],"properties":{"details":{"type":"array","items":{"$ref":"#/components/schemas/ValidationIssue"}}}}]},"example":{"error":"VALIDATION_ERROR","code":"VALIDATION_ERROR","message":"Dados inválidos na requisição.","details":[{"path":"/subject","message":"Expected string"}]}}}}},"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"description":"Chave única desta escrita (1 a 255 caracteres ASCII visíveis; um UUID serve). Repetir a chamada com a mesma chave e o mesmo corpo devolve a resposta da primeira, com `Idempotent-Replayed: true`, por 24 horas. Outro corpo com a mesma chave: `409 IDEMPOTENCY_KEY_REUSED`. Primeira ainda rodando: `409 IDEMPOTENCY_IN_PROGRESS`. Só respostas 2xx ficam guardadas.","schema":{"type":"string","minLength":1,"maxLength":255}}},"headers":{"Deprecation":{"description":"RFC 9745: presente quando a operação está descontinuada. Valor: `@<epoch>`, o momento em que a descontinuação começou. Vem com `Link: <https://vixpi.host/developers/changelog>; rel=\"deprecation\"`.","schema":{"type":"string","example":"@1798761600"}},"Sunset":{"description":"RFC 8594: data (HTTP-date) a partir da qual a operação deixa de responder.","schema":{"type":"string","example":"Wed, 30 Jun 2027 00:00:00 GMT"}}},"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_...`."}}}}