{"openapi":"3.1.0","jsonSchemaDialect":"https://spec.openapis.org/oas/3.1/dialect/base","info":{"title":"Grapnel API","version":"1.4.0","description":"Cole sua chave em Authorize e escolha um endpoint. Escritas exigem Idempotency-Key; os testes usam os dados reais da sua conta. Limite: 60 requisições/minuto por conta. [Exemplos e regras](/docs#fundamentos)."},"servers":[{"url":"/api/v1","description":"Base de produção: https://grapnel.com.br/api/v1 — operações reais na sua conta"}],"security":[{"ApiKeyBearer":[]}],"tags":[{"name":"Links"},{"name":"Pastas"},{"name":"Destinos"},{"name":"Mensagens dos links"},{"name":"Produtos"},{"name":"Logs"},{"name":"Analytics"},{"name":"Leads"},{"name":"Instâncias"},{"name":"WhatsApp"},{"name":"WhatsApp: mensagens"},{"name":"WhatsApp: conversas e contatos"},{"name":"WhatsApp: grupos e canais"},{"name":"WhatsApp: perfil e configurações"},{"name":"WhatsApp: automação"},{"name":"WhatsApp: campanhas"}],"paths":{"/logs":{"get":{"operationId":"listLogs","summary":"Consultar logs","tags":["Logs"],"description":"Escopo obrigatório: `logs:read`. Requisições autenticadas da API dos últimos 7 dias ou atividades da conta. Sem corpos, credenciais ou dados de contatos. A consulta aos logs não gera outro log. A gravação ocorre após a resposta e pode levar alguns segundos; logs não substituem a consulta ao recurso para confirmar uma operação.","x-required-scopes":["logs:read"],"parameters":[{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["api","activity"],"default":"api"},"description":"Tipo de registro."},{"name":"outcome","in":"query","required":false,"schema":{"type":"string","enum":["all","success","error"],"default":"all"},"description":"Somente para kind=api; success=2xx, error=4xx/5xx."},{"name":"request_id","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"Filtra pelo X-Request-Id. Somente para kind=api."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1},"description":"Página de resultados, mais recentes primeiro."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"description":"Registros por página."}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountLogPage"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/links/{id}/duplicate":{"post":{"operationId":"duplicateLink","summary":"Duplicar link","tags":["Links"],"description":"Escopo obrigatório: `links:write`. Duplica o link e suas configurações na mesma transação, com novo ID e slug. Retorna o link criado. Não envie corpo.","x-required-scopes":["links:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"responses":{"201":{"description":"Recurso criado.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"link":{"$ref":"#/components/schemas/Link"}},"required":["link"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/links/{id}/products":{"get":{"operationId":"listLinkProducts","summary":"Listar produtos do link","tags":["Produtos"],"description":"Escopo obrigatório: `links:read`.","x-required-scopes":["links:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"products":{"type":"array","items":{"$ref":"#/components/schemas/Product"}}},"required":["products"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}},"post":{"operationId":"createLinkProduct","summary":"Criar produto no link","tags":["Produtos"],"description":"Escopo obrigatório: `links:write`. O slug do produto deve ser único neste link. Conflitos retornam 409.","x-required-scopes":["links:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProduct"},"example":{"productName":"Camiseta","productSlug":"camiseta","productMessage":"Olá, quero comprar a camiseta."}}}},"responses":{"201":{"description":"Recurso criado.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"product":{"$ref":"#/components/schemas/Product"}},"required":["product"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/products/{id}":{"patch":{"operationId":"updateLinkProduct","summary":"Editar produto","tags":["Produtos"],"description":"Escopo obrigatório: `links:write`. Envie somente os campos alterados. Alterações de nome, slug ou mensagem podem gerar um novo product.id para preservar o histórico; guarde sempre o ID retornado. Nesse caso product.action=cloned e product.previous_product_id identifica a versão anterior.","x-required-scopes":["links:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProduct"},"example":{"productMessage":"Olá, quero mais informações sobre a camiseta."}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"product":{"$ref":"#/components/schemas/Product"}},"required":["product"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}},"delete":{"operationId":"deleteLinkProduct","summary":"Remover produto","tags":["Produtos"],"description":"Escopo obrigatório: `links:write`.","x-required-scopes":["links:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Success"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/metrics":{"get":{"operationId":"getInstanceMetrics","summary":"Consultar métricas da instância","tags":["Analytics"],"description":"Escopo obrigatório: `analytics:read`. Contagens diárias. Cada posição das séries corresponde à mesma posição em dates. Inclui histórico da sua conta mesmo após remover uma instância.","x-required-scopes":["analytics:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":365,"default":30},"description":"Quantidade de dias."}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstanceMetrics"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/links":{"get":{"operationId":"listLinks","summary":"Listar links","tags":["Links"],"description":"Escopo obrigatório: `links:read`.","x-required-scopes":["links:read"],"parameters":[{"name":"folderId","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"Filtra por pasta da sua conta."},{"name":"search","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[^,.()%\\\\\"\\r\\n]+$"},"description":"Busca por nome ou slug; não aceita vírgula, ponto, parênteses, %, barra invertida, aspas ou quebras de linha."},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"Use o nextCursor recebido na página anterior; mantenha os filtros."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"description":"Quantidade por página."}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkPage"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}},"post":{"operationId":"createLink","summary":"Criar link","tags":["Links"],"description":"Escopo obrigatório: `links:write`. Cria o link e seus destinos/mensagens na mesma transação. IDs relacionados devem pertencer à sua conta. O slug é imutável; se omitido, será gerado. Para WhatsApp, informe destinos ou phonePoolId. Para URL, informe customUrl.","x-required-scopes":["links:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLink"},"example":{"name":"Atendimento","slug":"atendimento","destinationType":"whatsapp","destinations":[{"sourceType":"manual","phoneNumber":"5511999999999","displayName":"Vendas"}],"messages":[{"message":"Olá! Quero saber mais."}]}}}},"responses":{"201":{"description":"Recurso criado.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"link":{"$ref":"#/components/schemas/Link"}},"required":["link"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/links/check-slug":{"get":{"operationId":"checkLinkSlug","summary":"Verificar disponibilidade do slug","tags":["Links"],"description":"Escopo obrigatório: `links:read`.","x-required-scopes":["links:read"],"parameters":[{"name":"slug","in":"query","required":true,"schema":{"type":"string","minLength":3,"maxLength":50,"pattern":"^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$"},"description":"Slug desejado."},{"name":"excludeId","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"Ignora este link da sua conta."}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"available":{"type":"boolean"},"suggestion":{"type":"string"}},"required":["available"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/links/{id}":{"get":{"operationId":"getLink","summary":"Consultar link e configuração","tags":["Links"],"description":"Escopo obrigatório: `links:read`.","x-required-scopes":["links:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"link":{"$ref":"#/components/schemas/Link"}},"required":["link"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}},"patch":{"operationId":"updateLink","summary":"Editar link","tags":["Links"],"description":"Escopo obrigatório: `links:write`. Envie somente os campos alterados. Corpo vazio é rejeitado. O slug não pode ser modificado. Arrays enviados substituem a respectiva configuração; omita para preservar.","x-required-scopes":["links:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLink"},"example":{"name":"Atendimento principal","isActive":true}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"link":{"$ref":"#/components/schemas/Link"}},"required":["link"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}},"delete":{"operationId":"deleteLink","summary":"Mover link para a lixeira","tags":["Links"],"description":"Escopo obrigatório: `links:write`. Desativa o acesso pelo link ao movê-lo para a lixeira. Use restore para recuperá-lo.","x-required-scopes":["links:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Success"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/links/{id}/restore":{"post":{"operationId":"restoreLink","summary":"Restaurar link da lixeira","tags":["Links"],"description":"Escopo obrigatório: `links:write`. Restaura um link da sua conta que ainda esteja na lixeira.","x-required-scopes":["links:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Success"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/analytics":{"get":{"operationId":"getAnalytics","summary":"Consultar analytics da conta","tags":["Analytics"],"description":"Escopo obrigatório: `analytics:read`. Métricas agregadas dos links da sua conta. Omitir datas consulta todo o histórico. Datas personalizadas devem estar ordenadas. Sem exportação de cliques individuais ou dados de contatos.","x-required-scopes":["analytics:read"],"parameters":[{"name":"startDate","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Início inclusivo em ISO 8601/RFC 3339, por exemplo 2026-09-01T00:00:00Z. Omitido: sem limite inicial."},{"name":"endDate","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Fim inclusivo; deve ser igual ou posterior ao início. Omitido: sem limite final."},{"name":"compare","in":"query","required":false,"schema":{"type":"string","enum":["true","false"],"default":"false"},"description":"Compara ao período anterior quando há intervalo definido."},{"name":"linkIds","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":100},"description":"UUIDs separados por vírgula; somente links da sua conta.","style":"form","explode":false},{"name":"folderIds","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":100},"description":"UUIDs de pastas separados por vírgula.","style":"form","explode":false}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsReport"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/links/{id}/analytics":{"get":{"operationId":"getLinkAnalytics","summary":"Consultar analytics de um link","tags":["Analytics"],"description":"Escopo obrigatório: `analytics:read`. Métricas agregadas por período, dispositivo, campanha e destino. Omitir datas consulta todo o histórico. Dados de visitantes individuais não são retornados.","x-required-scopes":["analytics:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"startDate","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Início inclusivo em ISO 8601/RFC 3339, por exemplo 2026-09-01T00:00:00Z. Omitido: sem limite inicial."},{"name":"endDate","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Fim inclusivo; deve ser igual ou posterior ao início. Omitido: sem limite final."},{"name":"compare","in":"query","required":false,"schema":{"type":"string","enum":["true","false"],"default":"false"},"description":"Compara ao período anterior quando há intervalo definido."}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkAnalyticsReport"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/leads":{"get":{"operationId":"listLeads","summary":"Listar contatos da conta","tags":["Leads"],"description":"Escopo obrigatório: `leads:read`. Contém dados pessoais dos contatos da sua conta. Requer leads:read. Use nextCursor sem alterações e mantenha os filtros até receber null.","x-required-scopes":["leads:read"],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["7d","30d","90d","all","custom"]},"description":"Período. custom exige start_date e end_date; os outros valores não aceitam essas datas. Sem period: a lista consulta todo o histórico; as estatísticas usam 30d."},{"name":"start_date","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Primeiro dia do período personalizado no calendário de São Paulo (UTC−03:00)."},{"name":"end_date","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Último dia inclusivo do período personalizado; igual ou posterior ao início."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50,"default":10},"description":"Quantidade de contatos por página."},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":100},"description":"Cursor retornado pela página anterior, no formato timestamp_UUID."},{"name":"vendor_phone","in":"query","required":false,"schema":{"type":"string","pattern":"^(?:\\+|00)?\\d{10,15}$"},"description":"Telefone do atendente com DDI; aceita + ou 00 no início."},{"name":"search","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[^,.()%\\\\\"\\r\\n]+$"},"description":"Busca por nome ou telefone do contato."}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadPage"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/leads/stats":{"get":{"operationId":"getLeadStats","summary":"Consultar estatísticas de contatos","tags":["Leads"],"description":"Escopo obrigatório: `leads:read`. Agrupamentos por atendente, dia, cidade e dispositivo. Padrão: últimos 30 dias. totalLeads sempre corresponde ao histórico completo.","x-required-scopes":["leads:read"],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["7d","30d","90d","all","custom"]},"description":"Período. custom exige start_date e end_date; os outros valores não aceitam essas datas. Sem period: a lista consulta todo o histórico; as estatísticas usam 30d."},{"name":"start_date","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Primeiro dia do período personalizado no calendário de São Paulo (UTC−03:00)."},{"name":"end_date","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Último dia inclusivo do período personalizado; igual ou posterior ao início."}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadStats"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/folders":{"get":{"operationId":"listFolders","summary":"Listar pastas","tags":["Pastas"],"description":"Escopo obrigatório: `links:read`.","x-required-scopes":["links:read"],"parameters":[],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"folders":{"type":"array","items":{"$ref":"#/components/schemas/Folder"}}},"required":["folders"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}},"post":{"operationId":"createFolder","summary":"Criar pasta","tags":["Pastas"],"description":"Escopo obrigatório: `links:write`.","x-required-scopes":["links:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFolder"},"example":{"name":"Campanhas","color":"#2563eb"}}}},"responses":{"201":{"description":"Recurso criado.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"folder":{"$ref":"#/components/schemas/Folder"}},"required":["folder"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/folders/{id}":{"patch":{"operationId":"updateFolder","summary":"Editar pasta","tags":["Pastas"],"description":"Escopo obrigatório: `links:write`. parentId deve pertencer à sua conta e não pode criar ciclos.","x-required-scopes":["links:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFolder"},"example":{"name":"Campanhas de setembro"}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"folder":{"$ref":"#/components/schemas/Folder"}},"required":["folder"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}},"delete":{"operationId":"deleteFolder","summary":"Excluir pasta","tags":["Pastas"],"description":"Escopo obrigatório: `links:write`.","x-required-scopes":["links:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Success"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/links/{id}/destinations":{"get":{"operationId":"listLinkDestinations","summary":"Listar destinos do link","tags":["Destinos"],"description":"Escopo obrigatório: `links:read`.","x-required-scopes":["links:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"destinations":{"type":"array","items":{"$ref":"#/components/schemas/Destination"}}},"required":["destinations"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}},"post":{"operationId":"createLinkDestination","summary":"Adicionar destino ao link","tags":["Destinos"],"description":"Escopo obrigatório: `links:write`. sourceType=instance exige instanceId de uma instância da sua conta.","x-required-scopes":["links:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDestination"},"example":{"sourceType":"manual","phoneNumber":"5511999999999","weight":1,"isActive":true}}}},"responses":{"201":{"description":"Recurso criado.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"destination":{"$ref":"#/components/schemas/Destination"}},"required":["destination"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/destinations/{id}":{"patch":{"operationId":"updateDestination","summary":"Editar destino","tags":["Destinos"],"description":"Escopo obrigatório: `links:write`.","x-required-scopes":["links:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDestination"},"example":{"weight":2}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"destination":{"$ref":"#/components/schemas/Destination"}},"required":["destination"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}},"delete":{"operationId":"deleteDestination","summary":"Remover destino","tags":["Destinos"],"description":"Escopo obrigatório: `links:write`. Destinos em uso por um teste podem retornar 409; ajuste o teste no painel antes de tentar novamente.","x-required-scopes":["links:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Success"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/links/{id}/messages":{"get":{"operationId":"listLinkMessages","summary":"Listar mensagens do link","tags":["Mensagens dos links"],"description":"Escopo obrigatório: `links:read`.","x-required-scopes":["links:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/Message"}}},"required":["messages"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}},"post":{"operationId":"createLinkMessage","summary":"Adicionar mensagem ao link","tags":["Mensagens dos links"],"description":"Escopo obrigatório: `links:write`.","x-required-scopes":["links:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMessage"},"example":{"message":"Olá! Quero mais informações.","weight":1}}}},"responses":{"201":{"description":"Recurso criado.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"$ref":"#/components/schemas/Message"}},"required":["message"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/messages/{id}":{"patch":{"operationId":"updateLinkMessage","summary":"Editar mensagem do link","tags":["Mensagens dos links"],"description":"Escopo obrigatório: `links:write`.","x-required-scopes":["links:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMessage"},"example":{"message":"Olá! Quero um orçamento."}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"$ref":"#/components/schemas/Message"}},"required":["message"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}},"delete":{"operationId":"deleteLinkMessage","summary":"Excluir mensagem do link","tags":["Mensagens dos links"],"description":"Escopo obrigatório: `links:write`.","x-required-scopes":["links:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Success"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances":{"get":{"operationId":"listInstances","summary":"Listar instâncias WhatsApp","tags":["Instâncias"],"description":"Escopo obrigatório: `instances:read`. Somente instâncias da sua conta com acesso ativo. Uma chave limitada a algumas instâncias lista só essas. Para a próxima página, incremente offset por limit; pare quando a quantidade retornada for menor que limit.","x-required-scopes":["instances:read"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Quantidade por página."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":100000,"default":0},"description":"Quantidade de registros a ignorar."}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"instances":{"type":"array","items":{"$ref":"#/components/schemas/Instance"}},"pagination":{"type":"object","properties":{"limit":{"type":"integer","minimum":0},"offset":{"type":"integer","minimum":0}},"required":["limit","offset"],"additionalProperties":false}},"required":["instances","pagination"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}":{"get":{"operationId":"getInstance","summary":"Consultar instância","tags":["Instâncias"],"description":"Escopo obrigatório: `instances:read`.","x-required-scopes":["instances:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"instance":{"$ref":"#/components/schemas/Instance"}},"required":["instance"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/status":{"get":{"operationId":"getInstanceStatus","summary":"Consultar status da conexão","tags":["WhatsApp"],"description":"Escopo obrigatório: `whatsapp:read`. Sincroniza o estado da conexão. A conta deve ter acesso ativo. Use connect para obter o pareamento.","x-required-scopes":["whatsapp:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstanceStatus"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/connect":{"post":{"operationId":"connectInstance","summary":"Conectar WhatsApp","tags":["WhatsApp"],"description":"Escopo obrigatório: `whatsapp:write`. A instância deve existir na sua conta e ter acesso ativo. Envie method=qr para receber um QR (válido por 2 minutos) ou method=paircode com phone para receber um código de pareamento (válido por 5 minutos) a digitar no WhatsApp em Aparelhos conectados > Conectar com número de telefone; depois consulte status. Pedir o código durante um pareamento por QR reinicia o pareamento. O pareamento exige ação do proprietário. A resposta depende do estágio da conexão e pode conter QR, código ou status. Se o pareamento expirar, confirme o status antes de iniciar uma nova operação com outra chave de idempotência.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectInstance"},"example":{"method":"qr"}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstanceConnection"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/disconnect":{"post":{"operationId":"disconnectInstance","summary":"Desconectar WhatsApp","tags":["WhatsApp"],"description":"Escopo obrigatório: `whatsapp:write`. Encerra a conexão da instância. Será necessário parear novamente para retomar os envios.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptyBody"},"example":{}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Success"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/groups":{"get":{"operationId":"listInstanceGroups","summary":"Listar grupos","tags":["WhatsApp"],"description":"Escopo obrigatório: `whatsapp:read`. Exige instância conectada. Use o jid retornado como destinatário de mensagens ao grupo.","x-required-scopes":["whatsapp:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"groups":{"type":"array","items":{"$ref":"#/components/schemas/Group"}}},"required":["groups"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/groups/info":{"post":{"operationId":"getInstanceGroup","summary":"Consultar grupo pelo JID","tags":["WhatsApp"],"description":"Escopo obrigatório: `whatsapp:read`. Exige instância conectada. Apesar de ser uma consulta, usa POST com JSON e exige Idempotency-Key.","x-required-scopes":["whatsapp:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupInfo"},"example":{"groupjid":"120363000000000000@g.us"}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"group":{"$ref":"#/components/schemas/Group"}},"required":["group"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/groups/messages":{"get":{"operationId":"listInstanceGroupMessages","summary":"Consultar mensagens de um grupo","tags":["WhatsApp"],"description":"Escopo obrigatório: `whatsapp:read`. Exige instância conectada e acesso ativo. Informe o groupjid retornado pela listagem de grupos. Retorna mensagens enviadas e recebidas, da mais recente para a mais antiga, no histórico disponível do provedor (até sete dias). Não marca mensagens como lidas. Continue com pagination.next_offset enquanto pagination.has_more for true; mensagens novas podem deslocar páginas, então deduplique por messageid. Retorna texto e metadados, sem conteúdo bruto, arquivos de mídia ou credenciais do provedor. Não aceita parâmetros além de groupjid, limit e offset. Não exige Idempotency-Key.","x-required-scopes":["whatsapp:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"groupjid","in":"query","required":true,"schema":{"type":"string","maxLength":64,"pattern":"^\\d{5,25}(?:-\\d{5,20})?@g\\.us$","description":"JID retornado pela consulta de grupos."},"description":"JID do grupo, obtido em GET /instances/{id}/groups."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Quantidade de mensagens por página."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":100000,"default":0},"description":"Posição no histórico, começando pelas mensagens mais recentes."}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupMessagePage"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/groups/webhook":{"get":{"operationId":"getInstanceGroupWebhook","summary":"Consultar webhook de mensagens dos grupos","tags":["WhatsApp"],"description":"Escopo obrigatório: `whatsapp:read`. Retorna a configuração da própria instância ou webhook:null quando desativado. Não devolve o segredo. Pode ser consultado com a instância desconectada; exige acesso ativo.","x-required-scopes":["whatsapp:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"webhook":{"anyOf":[{"$ref":"#/components/schemas/GroupWebhook"},{"type":"null"}]}},"required":["webhook"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}},"post":{"operationId":"configureInstanceGroupWebhook","summary":"Configurar webhook de mensagens dos grupos","tags":["WhatsApp"],"description":"Escopo obrigatório: `whatsapp:write`. Configura um destino por instância para novas mensagens recebidas em todos os grupos (fromMe=false). Usa o mesmo destino de /instances/{id}/messages/webhook e desativa a entrega de conversas individuais. Informe URL HTTPS pública e um segredo aleatório gerado no seu servidor; não use a chave da API como segredo. Pode configurar antes de conectar. Atualizar o destino ou segredo descarta entregas anteriores pendentes. Eventos não incluem credenciais, conteúdo bruto ou arquivos de mídia. Entrega assinada com HMAC SHA-256 de timestamp.corpo_bruto em UTF-8, cabeçalhos X-Grapnel-Timestamp (Unix segundos), X-Grapnel-Signature (sha256=hex) e X-Grapnel-Event-Id. Valide a assinatura com comparação constante, aceite timestamps de até cinco minutos e deduplique pelo id do evento. Qualquer HTTP 2xx confirma recebimento. Rede/timeout/408/429/5xx têm até oito tentativas por 24 horas, com recuperação a cada minuto; outros status, incluindo 3xx, encerram a entrega. Não existe garantia de ordem ou entrega única. Payload limitado a 512 KiB. Desativar, reconfigurar, transferir ou excluir a instância remove as entregas pendentes. O conteúdo é cifrado enquanto pendente e apagado após entrega/falha; metadados de deduplicação ficam por até sete dias.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigureGroupWebhook"},"example":{"url":"https://events.example.com/grapnel","secret":"example-only-random-signing-secret-32chars"}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"webhook":{"$ref":"#/components/schemas/GroupWebhook"}},"required":["webhook"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}},"callbacks":{"groupMessage":{"{$request.body#/url}":{"post":{"summary":"Receber uma nova mensagem de grupo","security":[],"parameters":[{"name":"X-Grapnel-Event-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"X-Grapnel-Timestamp","in":"header","required":true,"schema":{"type":"string","pattern":"^[0-9]+$"}},{"name":"X-Grapnel-Signature","in":"header","required":true,"schema":{"type":"string","pattern":"^sha256=[a-f0-9]{64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupWebhookEvent"}}}},"responses":{"200":{"description":"Evento recebido. Qualquer HTTP 2xx confirma recebimento."}}}}}}},"delete":{"operationId":"deleteInstanceGroupWebhook","summary":"Desativar webhook de mensagens dos grupos","tags":["WhatsApp"],"description":"Escopo obrigatório: `whatsapp:write`. Remove o destino e as entregas pendentes. Pode desativar com a instância desconectada; exige acesso ativo. Exige Idempotency-Key.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Success"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/chats":{"get":{"operationId":"listInstanceChats","summary":"Listar conversas","tags":["WhatsApp"],"description":"Escopo obrigatório: `chats:read`. Exige instância conectada e acesso ativo. Lista conversas da mais recente para a mais antiga, com nome, não lidas e horário da última mensagem. Sem dados de CRM, foto ou credenciais do provedor. Use chatid em GET /instances/{id}/chats/messages. Não exige Idempotency-Key.","x-required-scopes":["chats:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["direct","group"]},"description":"Filtra conversas individuais ou grupos. Sem o parâmetro, retorna as duas."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Quantidade de conversas por página."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":100000,"default":0},"description":"Posição na lista, começando pelas mais recentes."}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatPage"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/chats/messages":{"get":{"operationId":"listInstanceChatMessages","summary":"Consultar mensagens de uma conversa individual","tags":["WhatsApp"],"description":"Escopo obrigatório: `chats:read`. Exige instância conectada e acesso ativo. Informe o chatid de GET /instances/{id}/chats ou o número com DDI. Retorna mensagens enviadas e recebidas, da mais recente para a mais antiga, no histórico disponível do provedor. Não marca mensagens como lidas. Continue com pagination.next_offset enquanto pagination.has_more for true; deduplique por messageid. Retorna texto e metadados, sem conteúdo bruto, arquivos de mídia ou credenciais do provedor. Para grupos, use GET /instances/{id}/groups/messages. Não exige Idempotency-Key.","x-required-scopes":["chats:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"chatid","in":"query","required":true,"schema":{"anyOf":[{"type":"string","maxLength":64,"pattern":"^\\d{5,25}@(?:s\\.whatsapp\\.net|lid)$","description":"JID da conversa individual, retornado em GET /instances/{id}/chats."},{"type":"string","pattern":"^[1-9]\\d{7,14}$"}]},"description":"JID da conversa individual ou número com DDI, somente dígitos."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Quantidade de mensagens por página."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":100000,"default":0},"description":"Posição no histórico, começando pelas mensagens mais recentes."}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectMessagePage"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/messages/webhook":{"get":{"operationId":"getInstanceMessageWebhook","summary":"Consultar webhook de mensagens","tags":["WhatsApp"],"description":"Escopo obrigatório: `whatsapp:read`. Retorna o destino da instância, os eventos ativos ou webhook:null quando desativado. Não devolve o segredo. Pode ser consultado com a instância desconectada; exige acesso ativo.","x-required-scopes":["whatsapp:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"webhook":{"anyOf":[{"$ref":"#/components/schemas/MessageWebhook"},{"type":"null"}]}},"required":["webhook"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}},"post":{"operationId":"configureInstanceMessageWebhook","summary":"Configurar webhook de mensagens","tags":["WhatsApp"],"description":"Escopo obrigatório: `whatsapp:write`. Configura um destino por instância para novas mensagens recebidas (fromMe=false): grupos sempre (whatsapp.group.message.received) e conversas individuais com direct_messages=true (whatsapp.message.received, exige chats:read). Substitui o destino de /instances/{id}/groups/webhook. Informe URL HTTPS pública e um segredo aleatório gerado no seu servidor; não use a chave da API como segredo. Pode configurar antes de conectar. Atualizar o destino ou segredo descarta entregas anteriores pendentes. Eventos não incluem credenciais, conteúdo bruto ou arquivos de mídia. Entrega assinada com HMAC SHA-256 de timestamp.corpo_bruto em UTF-8, cabeçalhos X-Grapnel-Timestamp (Unix segundos), X-Grapnel-Signature (sha256=hex) e X-Grapnel-Event-Id. Valide a assinatura com comparação constante, aceite timestamps de até cinco minutos e deduplique pelo id do evento. Qualquer HTTP 2xx confirma recebimento. Rede/timeout/408/429/5xx têm até oito tentativas por 24 horas, com recuperação a cada minuto; outros status, incluindo 3xx, encerram a entrega. Não existe garantia de ordem ou entrega única. Payload limitado a 512 KiB. Desativar, reconfigurar, transferir ou excluir a instância remove as entregas pendentes. O conteúdo é cifrado enquanto pendente e apagado após entrega/falha; metadados de deduplicação ficam por até sete dias.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigureMessageWebhook"},"example":{"url":"https://events.example.com/grapnel","secret":"example-only-random-signing-secret-32chars","direct_messages":true}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"webhook":{"$ref":"#/components/schemas/MessageWebhook"}},"required":["webhook"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}},"callbacks":{"message":{"{$request.body#/url}":{"post":{"summary":"Receber uma nova mensagem","security":[],"parameters":[{"name":"X-Grapnel-Event-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"X-Grapnel-Timestamp","in":"header","required":true,"schema":{"type":"string","pattern":"^[0-9]+$"}},{"name":"X-Grapnel-Signature","in":"header","required":true,"schema":{"type":"string","pattern":"^sha256=[a-f0-9]{64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageWebhookEvent"}}}},"responses":{"200":{"description":"Evento recebido. Qualquer HTTP 2xx confirma recebimento."}}}}}}},"delete":{"operationId":"deleteInstanceMessageWebhook","summary":"Desativar webhook de mensagens","tags":["WhatsApp"],"description":"Escopo obrigatório: `whatsapp:write`. Remove o destino e as entregas pendentes de grupos e conversas individuais. Pode desativar com a instância desconectada; exige acesso ativo. Exige Idempotency-Key.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Success"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/messages/webhook/deliveries":{"get":{"operationId":"listInstanceWebhookDeliveries","summary":"Consultar entregas do webhook de mensagens","tags":["WhatsApp"],"description":"Escopo obrigatório: `whatsapp:read`. Entregas assinadas dos últimos sete dias para o destino atual da instância, da mais recente para a mais antiga: pending (aguardando), sending (em envio), delivered (HTTP 2xx) ou failed (tentativas esgotadas, status final ou acesso perdido). O id é o mesmo de X-Grapnel-Event-Id. Não devolve o conteúdo do evento. Reconfigurar ou desativar o webhook apaga o histórico. Pode ser consultado com a instância desconectada; exige acesso ativo.","x-required-scopes":["whatsapp:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["pending","sending","delivered","failed"]},"description":"Filtra por estado da entrega."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Quantidade de entregas por página."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":100000,"default":0},"description":"Posição na lista, começando pelas mais recentes."}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryPage"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/webhooks/messages":{"get":{"operationId":"listMessageWebhooks","summary":"Consultar webhooks de mensagens de todas as instâncias","tags":["WhatsApp"],"description":"Escopo obrigatório: `whatsapp:read`. Uma linha por instância que a chave pode usar, com status da conexão e o webhook de mensagens configurado ou webhook:null. Não devolve segredos. Exige acesso ativo.","x-required-scopes":["whatsapp:read"],"parameters":[],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"instances":{"type":"array","items":{"$ref":"#/components/schemas/MessageWebhookInstance"}}},"required":["instances"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}},"post":{"operationId":"configureMessageWebhooks","summary":"Configurar webhook de mensagens em várias instâncias","tags":["WhatsApp"],"description":"Escopo obrigatório: `whatsapp:write`. Aplica o mesmo destino, segredo e eventos de POST /instances/{id}/messages/webhook a até 100 instâncias, ou a todas com instance_ids=\"all\". Cada instância é configurada separadamente: results traz configured ou failed (com code e detail) por instância e summary soma os resultados; a resposta é 200 mesmo quando algumas falham. Instâncias fora da chave ou inexistentes retornam not_found. Alterações em várias instâncias têm limite próprio de 20 por hora por conta. Informe URL HTTPS pública e um segredo aleatório gerado no seu servidor; não use a chave da API como segredo. Pode configurar antes de conectar. Atualizar o destino ou segredo descarta entregas anteriores pendentes. Eventos não incluem credenciais, conteúdo bruto ou arquivos de mídia. Entrega assinada com HMAC SHA-256 de timestamp.corpo_bruto em UTF-8, cabeçalhos X-Grapnel-Timestamp (Unix segundos), X-Grapnel-Signature (sha256=hex) e X-Grapnel-Event-Id. Valide a assinatura com comparação constante, aceite timestamps de até cinco minutos e deduplique pelo id do evento. Qualquer HTTP 2xx confirma recebimento. Rede/timeout/408/429/5xx têm até oito tentativas por 24 horas, com recuperação a cada minuto; outros status, incluindo 3xx, encerram a entrega. Não existe garantia de ordem ou entrega única. Payload limitado a 512 KiB. Desativar, reconfigurar, transferir ou excluir a instância remove as entregas pendentes. O conteúdo é cifrado enquanto pendente e apagado após entrega/falha; metadados de deduplicação ficam por até sete dias.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigureMessageWebhooks"},"example":{"instance_ids":["10000000-0000-4000-8000-000000000001"],"url":"https://events.example.com/grapnel","secret":"example-only-random-signing-secret-32chars","direct_messages":true}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageWebhookBulkResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}},"callbacks":{"message":{"{$request.body#/url}":{"post":{"summary":"Receber uma nova mensagem","security":[],"parameters":[{"name":"X-Grapnel-Event-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"X-Grapnel-Timestamp","in":"header","required":true,"schema":{"type":"string","pattern":"^[0-9]+$"}},{"name":"X-Grapnel-Signature","in":"header","required":true,"schema":{"type":"string","pattern":"^sha256=[a-f0-9]{64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageWebhookEvent"}}}},"responses":{"200":{"description":"Evento recebido. Qualquer HTTP 2xx confirma recebimento."}}}}}}}},"/webhooks/messages/disable":{"post":{"operationId":"disableMessageWebhooks","summary":"Desativar webhook de mensagens em várias instâncias","tags":["WhatsApp"],"description":"Escopo obrigatório: `whatsapp:write`. Remove o destino e as entregas pendentes de até 100 instâncias, ou de todas com instance_ids=\"all\". results traz disabled ou failed por instância. Pode desativar com a instância desconectada; exige acesso ativo. Limite próprio de 20 alterações em várias instâncias por hora por conta. Exige Idempotency-Key.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisableMessageWebhooks"},"example":{"instance_ids":"all"}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageWebhookBulkResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/messages/text":{"post":{"operationId":"sendWhatsAppText","summary":"Enviar mensagem de texto","tags":["WhatsApp"],"description":"Escopo obrigatório: `whatsapp:write`. Exige instância conectada, acesso ativo e destinatário autorizado. Corpo máximo: 32 KiB. HTTP 202 confirma aceitação, sem confirmação de entrega. Em timeout, não crie outra chave automaticamente.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendText"},"example":{"number":"5511999999999","text":"Olá! Seu pedido foi confirmado."}}}},"responses":{"202":{"description":"Envio aceito para processamento; não confirma entrega.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageAccepted"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/messages/contact":{"post":{"operationId":"sendWhatsAppContact","summary":"Enviar cartão de contato","tags":["WhatsApp"],"description":"Escopo obrigatório: `whatsapp:write`. Exige instância conectada e acesso ativo. Corpo máximo: 32 KiB. HTTP 202 confirma aceitação, sem confirmação de entrega.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendContact"},"example":{"number":"5511999999999","fullName":"Equipe de vendas","phoneNumber":"5511888888888"}}}},"responses":{"202":{"description":"Envio aceito para processamento; não confirma entrega.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageAccepted"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/messages/location":{"post":{"operationId":"sendWhatsAppLocation","summary":"Enviar localização","tags":["WhatsApp"],"description":"Escopo obrigatório: `whatsapp:write`. Coordenadas em graus decimais. Exige instância conectada e acesso ativo. Corpo máximo: 32 KiB. HTTP 202 confirma aceitação, sem confirmação de entrega.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendLocation"},"example":{"number":"5511999999999","latitude":-23.5505,"longitude":-46.6333,"name":"São Paulo"}}}},"responses":{"202":{"description":"Envio aceito para processamento; não confirma entrega.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageAccepted"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/messages/media":{"post":{"operationId":"sendWhatsAppMedia","summary":"Enviar imagem, vídeo, áudio ou documento","tags":["WhatsApp"],"description":"Escopo obrigatório: `whatsapp:write`. Exige instância conectada e acesso ativo. Use a URL pública de um arquivo já enviado ao storage Grapnel; URLs externas são rejeitadas. Corpo máximo: 32 KiB; envie a URL, não os bytes do arquivo. HTTP 202 confirma aceitação, sem confirmação de entrega.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMedia"}}}},"responses":{"202":{"description":"Envio aceito para processamento; não confirma entrega.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageAccepted"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/instance/reset":{"post":{"operationId":"whatsappInstanceReset","summary":"Reiniciar runtime da instância","tags":["WhatsApp: perfil e configurações"],"description":"Escopo obrigatório: `settings:write`. Solicita um reset controlado do runtime da instância atual. Espelha POST /instance/reset do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["settings:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/instance/privacy":{"get":{"operationId":"whatsappInstancePrivacyGet","summary":"Buscar configurações de privacidade","tags":["WhatsApp: perfil e configurações"],"description":"Escopo obrigatório: `settings:read`. Busca as configurações de privacidade atuais da instância do WhatsApp. Espelha GET /instance/privacy do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["settings:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}},"post":{"operationId":"whatsappInstancePrivacy","summary":"Alterar configurações de privacidade","tags":["WhatsApp: perfil e configurações"],"description":"Escopo obrigatório: `settings:write`. Altera uma ou múltiplas configurações de privacidade da instância do WhatsApp de forma otimizada. Espelha POST /instance/privacy do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["settings:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"groupadd":{"type":"string","enum":["all","contacts","contact_blacklist","none"],"description":"Quem pode adicionar aos grupos. Valores - all, contacts, contact_blacklist, none"},"last":{"type":"string","enum":["all","contacts","contact_blacklist","none"],"description":"Quem pode ver visto por último. Valores - all, contacts, contact_blacklist, none"},"status":{"type":"string","enum":["all","contacts","contact_blacklist","none"],"description":"Quem pode ver status (recado embaixo do nome). Valores - all, contacts, contact_blacklist, none"},"profile":{"type":"string","enum":["all","contacts","contact_blacklist","none"],"description":"Quem pode ver foto de perfil. Valores - all, contacts, contact_blacklist, none"},"readreceipts":{"type":"string","enum":["all","none"],"description":"Confirmação de leitura. Valores - all, none"},"online":{"type":"string","enum":["all","match_last_seen"],"description":"Quem pode ver status online. Valores - all, match_last_seen"},"calladd":{"type":"string","enum":["all","known"],"description":"Quem pode fazer chamadas. Valores - all, known"}},"minProperties":1,"additionalProperties":false},"example":{"groupadd":"contacts"}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/instance/presence":{"post":{"operationId":"whatsappInstancePresence","summary":"Atualizar status de presença da instância","tags":["WhatsApp: perfil e configurações"],"description":"Escopo obrigatório: `settings:write`. Atualiza o status de presença global da instância do WhatsApp. Este endpoint permite: 1. Definir se a instância está disponível (Aparece \"online\") ou indisponível 2. Controlar o status de presença para todos os contatos 3. Salvar o estado atual da presença na instância Espelha POST /instance/presence do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["settings:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"presence":{"type":"string","description":"Status de presença da instância","enum":["available","unavailable"],"example":"available"}},"required":["presence"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/instance/update-delay-settings":{"post":{"operationId":"whatsappInstanceUpdateDelaySettings","summary":"Delay na fila de mensagens","tags":["WhatsApp: perfil e configurações"],"description":"Escopo obrigatório: `settings:write`. Configura o intervalo de tempo entre mensagens diretas (async=true). Espelha POST /instance/updateDelaySettings do provedor de conexão; campos e respostas seguem essa operação.","x-required-scopes":["settings:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"msg_delay_min":{"type":"integer","format":"int64","minimum":0,"description":"Delay mínimo em segundos (0 = sem delay)","example":0},"msg_delay_max":{"type":"integer","format":"int64","minimum":0,"description":"Delay máximo em segundos","example":2}},"required":["msg_delay_min","msg_delay_max"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/instance/updatechatbotsettings":{"post":{"operationId":"whatsappInstanceUpdatechatbotsettings","summary":"Chatbot Configurações","tags":["WhatsApp: automação"],"description":"Escopo obrigatório: `settings:write`. Explicação dos campos: Espelha POST /instance/updatechatbotsettings do provedor de conexão; campos e respostas seguem essa operação.","x-required-scopes":["settings:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","example":{"openai_apikey":"sk-1234567890abcdefghijklmnopqrstuvwxyz","chatbot_enabled":true,"chatbot_ignoreGroups":true,"chatbot_stopConversation":"stop","chatbot_stopMinutes":30,"chatbot_stopWhenYouSendMsg":5}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/instance/update-fields-map":{"post":{"operationId":"whatsappInstanceUpdateFieldsMap","summary":"Atualizar campos personalizados de leads","tags":["WhatsApp: automação"],"description":"Escopo obrigatório: `settings:write`. Atualiza os campos personalizados (custom fields) de uma instância. Permite configurar até 20 campos personalizados para armazenamento de informações adicionais sobre leads. Espelha POST /instance/updateFieldsMap do provedor de conexão; campos e respostas seguem essa operação.","x-required-scopes":["settings:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lead_field01":{"type":"string","description":"Campo personalizado 01","maxLength":255},"lead_field02":{"type":"string","description":"Campo personalizado 02","maxLength":255},"lead_field03":{"type":"string","description":"Campo personalizado 03","maxLength":255},"lead_field04":{"type":"string","description":"Campo personalizado 04","maxLength":255},"lead_field05":{"type":"string","description":"Campo personalizado 05","maxLength":255},"lead_field06":{"type":"string","description":"Campo personalizado 06","maxLength":255},"lead_field07":{"type":"string","description":"Campo personalizado 07","maxLength":255},"lead_field08":{"type":"string","description":"Campo personalizado 08","maxLength":255},"lead_field09":{"type":"string","description":"Campo personalizado 09","maxLength":255},"lead_field10":{"type":"string","description":"Campo personalizado 10","maxLength":255},"lead_field11":{"type":"string","description":"Campo personalizado 11","maxLength":255},"lead_field12":{"type":"string","description":"Campo personalizado 12","maxLength":255},"lead_field13":{"type":"string","description":"Campo personalizado 13","maxLength":255},"lead_field14":{"type":"string","description":"Campo personalizado 14","maxLength":255},"lead_field15":{"type":"string","description":"Campo personalizado 15","maxLength":255},"lead_field16":{"type":"string","description":"Campo personalizado 16","maxLength":255},"lead_field17":{"type":"string","description":"Campo personalizado 17","maxLength":255},"lead_field18":{"type":"string","description":"Campo personalizado 18","maxLength":255},"lead_field19":{"type":"string","description":"Campo personalizado 19","maxLength":255},"lead_field20":{"type":"string","description":"Campo personalizado 20","maxLength":255}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/instance/proxy":{"get":{"operationId":"whatsappInstanceProxyGet","summary":"Obter configuração de proxy da instância","tags":["WhatsApp: perfil e configurações"],"description":"Escopo obrigatório: `settings:read`. A uazapiGO opera com um proxy interno como padrão. Observação: nossos IPs são brasileiros. Se você atende clientes internacionais, considere usar um proxy do país/região do seu cliente (via `proxy_url`). Você pode: (1) continuar no proxy interno padrão; (2) usar um proxy próprio informando `proxy_url`. Se nada for definido, seguimos no proxy interno; ou (3) usar seu celular android como proxy instalando o aplicativo disponibilizado pela uazapi em https://github.com/uazapi/silver_proxy_apk (APK direto: https://github.com/uazapi/silver_proxy_apk/raw/refs/heads/main/silver_proxy.apk). Espelha GET /instance/proxy do provedor de conexão; campos e respostas seguem essa operação.","x-required-scopes":["settings:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}},"post":{"operationId":"whatsappInstanceProxy","summary":"Configurar ou alterar o proxy","tags":["WhatsApp: perfil e configurações"],"description":"Escopo obrigatório: `settings:write`. Permite habilitar ou trocar para: - Um proxy próprio (`proxy_url`), usando sua infraestrutura ou o aplicativo de celular para proxy próprio. - O proxy interno padrão (nenhum `proxy_url` enviado). Espelha POST /instance/proxy do provedor de conexão; campos e respostas seguem essa operação.","x-required-scopes":["settings:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enable":{"type":"boolean","description":"Define se o proxy deve ser habilitado; se `false`, remove o proxy atual","default":true},"proxy_url":{"type":"string","description":"URL do proxy a ser usado (obrigatória se `enable=true` e quiser usar um proxy próprio)","example":"http://usuario:senha@ip:porta"}},"required":["enable"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}},"delete":{"operationId":"whatsappInstanceProxyDelete","summary":"Remover o proxy configurado","tags":["WhatsApp: perfil e configurações"],"description":"Escopo obrigatório: `settings:write`. Desativa e apaga o proxy personalizado, voltando ao comportamento padrão (proxy interno). Pode reiniciar a conexão para aplicar a remoção. Espelha DELETE /instance/proxy do provedor de conexão; campos e respostas seguem essa operação.","x-required-scopes":["settings:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/profile/name":{"post":{"operationId":"whatsappProfileName","summary":"Altera o nome do perfil do WhatsApp","tags":["WhatsApp: perfil e configurações"],"description":"Escopo obrigatório: `settings:write`. Altera o nome de exibição do perfil da instância do WhatsApp. Espelha POST /profile/name do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["settings:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Novo nome do perfil do WhatsApp","example":"Minha Empresa - Atendimento","maxLength":25}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/profile/image":{"post":{"operationId":"whatsappProfileImage","summary":"Altera a imagem do perfil do WhatsApp","tags":["WhatsApp: perfil e configurações"],"description":"Escopo obrigatório: `settings:write`. Altera a imagem de perfil da instância do WhatsApp. Espelha POST /profile/image do provedor de conexão; campos e respostas seguem essa operação. Mídia (image): envie base64, data URI ou a URL pública de um arquivo no storage Grapnel. Corpo máximo: 4 MiB. Exige instância conectada.","x-required-scopes":["settings:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["image"],"properties":{"image":{"type":"string","description":"Imagem do perfil. Pode ser:\n- URL da imagem (http/https)\n- String base64 da imagem\n- \"remove\" ou \"delete\" para remover a imagem atual\n","example":"https://picsum.photos/640/640.jpg","oneOf":[{"description":"URL da imagem","example":"https://picsum.photos/640/640.jpg"},{"description":"Imagem em base64","example":"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwCdABmX/9k="},{"description":"Comando para remover imagem","example":"remove"}]}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/send/text":{"post":{"operationId":"whatsappSendText","summary":"Enviar mensagem de texto","tags":["WhatsApp: mensagens"],"description":"Escopo obrigatório: `whatsapp:write`. Envia uma mensagem de texto para um contato, grupo ou canal/newsletter. Espelha POST /send/text do provedor de conexão; campos e respostas seguem essa operação. Mídia (linkPreviewImage): envie base64, data URI ou a URL pública de um arquivo no storage Grapnel. Corpo máximo: 4 MiB. Exige instância conectada.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","description":"ID do chat para o qual a mensagem será enviada. Pode ser um número de telefone em formato internacional, um ID de grupo (`@g.us`), um ID de usuário (com `@s.whatsapp.net` ou `@lid`) ou um ID de canal/newsletter (`@newsletter`).","example":"5511999999999"},"text":{"type":"string","description":"Texto da mensagem (aceita placeholders)","example":"Olá {{name}}! Como posso ajudar?"},"linkPreview":{"type":"boolean","description":"Ativa/desativa preview de links. Se true, procura automaticamente um link no texto para gerar preview.\n\nComportamento:\n- Se apenas linkPreview=true: gera preview automático do primeiro link encontrado no texto\n- Se fornecidos campos personalizados (title, description, image): usa os valores fornecidos\n- Se campos personalizados parciais: combina com dados automáticos do link como fallback\n","example":true},"linkPreviewTitle":{"type":"string","description":"Define um título personalizado para o preview do link","example":"Título Personalizado"},"linkPreviewDescription":{"type":"string","description":"Define uma descrição personalizada para o preview do link","example":"Descrição personalizada do link"},"linkPreviewImage":{"type":"string","description":"URL ou Base64 da imagem para usar no preview do link","example":"https://exemplo.com/imagem.jpg"},"linkPreviewLarge":{"type":"boolean","description":"Se true, gera um preview grande com upload da imagem. Se false, gera um preview pequeno sem upload","example":true},"replyid":{"type":"string","description":"ID da mensagem para responder","example":"3EB0538DA65A59F6D8A251"},"mentions":{"type":"string","description":"Números para mencionar (separados por vírgula)","example":"5511999999999,5511888888888"},"readchat":{"type":"boolean","description":"Marca conversa como lida após envio","example":true},"readmessages":{"type":"boolean","description":"Marca últimas mensagens recebidas como lidas","example":true},"delay":{"type":"integer","description":"Atraso em milissegundos antes do envio, durante o atraso apacerá 'Digitando...'","example":1000},"forward":{"type":"boolean","description":"Marca a mensagem como encaminhada no WhatsApp","example":true},"track_source":{"type":"string","description":"Origem do rastreamento da mensagem","example":"chatwoot"},"track_id":{"type":"string","description":"ID para rastreamento da mensagem (aceita valores duplicados)","example":"msg_123456789"},"async":{"type":"boolean","description":"Se true, envia a mensagem de forma assíncrona via fila interna. Útil para alto volume de mensagens.","example":false}},"required":["number","text"]},"example":{"number":"5511999999999","text":"Olá! Como posso ajudar?"}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/send/media":{"post":{"operationId":"whatsappSendMedia","summary":"Enviar mídia (imagem, vídeo, áudio ou documento)","tags":["WhatsApp: mensagens"],"description":"Escopo obrigatório: `whatsapp:write`. Envia diferentes tipos de mídia para um contato, grupo ou canal/newsletter. Suporta URLs ou arquivos base64. Espelha POST /send/media do provedor de conexão; campos e respostas seguem essa operação. Mídia (file, thumbnail): envie base64, data URI ou a URL pública de um arquivo no storage Grapnel. Corpo máximo: 4 MiB. Exige instância conectada.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","description":"ID do chat para o qual a mensagem será enviada. Pode ser um número de telefone em formato internacional, um ID de grupo (`@g.us`), um ID de usuário (com `@s.whatsapp.net` ou `@lid`) ou um ID de canal/newsletter (`@newsletter`).","example":"5511999999999"},"type":{"type":"string","description":"Tipo de mídia (image, video, document, audio, myaudio, ptt, ptv, sticker)","enum":["image","video","document","audio","myaudio","ptt","ptv","sticker"],"example":"image"},"file":{"type":"string","description":"URL ou base64 do arquivo","example":"https://exemplo.com/imagem.jpg"},"text":{"type":"string","description":"Texto descritivo (caption) - aceita placeholders","example":"Veja esta foto!"},"docName":{"type":"string","description":"Nome do arquivo (apenas para documents)","example":"relatorio.pdf"},"thumbnail":{"type":"string","description":"URL ou base64 de thumbnail personalizado para vídeos e documentos","example":"https://exemplo.com/thumb.jpg"},"mimetype":{"type":"string","description":"MIME type do arquivo (opcional, detectado automaticamente)","example":"application/pdf"},"replyid":{"type":"string","description":"ID da mensagem para responder","example":"3EB0538DA65A59F6D8A251"},"mentions":{"type":"string","description":"Números para mencionar (separados por vírgula)","example":"5511999999999,5511888888888"},"readchat":{"type":"boolean","description":"Marca conversa como lida após envio","example":true},"readmessages":{"type":"boolean","description":"Marca últimas mensagens recebidas como lidas","example":true},"delay":{"type":"integer","description":"Atraso em milissegundos antes do envio, durante o atraso apacerá 'Digitando...' ou 'Gravando áudio...'","example":1000},"forward":{"type":"boolean","description":"Marca a mensagem como encaminhada no WhatsApp","example":true},"track_source":{"type":"string","description":"Origem do rastreamento da mensagem","example":"chatwoot"},"track_id":{"type":"string","description":"ID para rastreamento da mensagem (aceita valores duplicados)","example":"msg_123456789"},"async":{"type":"boolean","description":"Se true, envia a mensagem de forma assíncrona via fila interna","example":false}},"required":["number","type","file"]},"example":{"number":"5511999999999","type":"image","file":"https://ayeqsyapebwelhipmmyv.supabase.co/storage/v1/object/public/assets/exemplo/foto.jpg"}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/send/contact":{"post":{"operationId":"whatsappSendContact","summary":"Enviar cartão de contato (vCard)","tags":["WhatsApp: mensagens"],"description":"Escopo obrigatório: `whatsapp:write`. Envia um cartão de contato (vCard) para um contato ou grupo. Espelha POST /send/contact do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","description":"ID do chat para o qual a mensagem será enviada. Pode ser um número de telefone em formato internacional, um ID de grupo (`@g.us`), um ID de usuário (com `@s.whatsapp.net` ou `@lid`).","example":"5511999999999"},"fullName":{"type":"string","description":"Nome completo do contato","example":"João Silva"},"phoneNumber":{"type":"string","description":"Números de telefone (separados por vírgula)","example":"5511999999999,5511888888888"},"organization":{"type":"string","description":"Nome da organização/empresa","example":"Empresa XYZ"},"email":{"type":"string","description":"Endereço de email","example":"joao@empresa.com"},"url":{"type":"string","description":"URL pessoal ou da empresa","example":"https://empresa.com/joao"},"replyid":{"type":"string","description":"ID da mensagem para responder","example":"3EB0538DA65A59F6D8A251"},"mentions":{"type":"string","description":"Números para mencionar (separados por vírgula)","example":"5511999999999,5511888888888"},"readchat":{"type":"boolean","description":"Marca conversa como lida após envio","example":true},"readmessages":{"type":"boolean","description":"Marca últimas mensagens recebidas como lidas","example":true},"delay":{"type":"integer","description":"Atraso em milissegundos antes do envio, durante o atraso apacerá 'Digitando...'","example":1000},"forward":{"type":"boolean","description":"Marca a mensagem como encaminhada no WhatsApp","example":true},"track_source":{"type":"string","description":"Origem do rastreamento da mensagem","example":"chatwoot"},"track_id":{"type":"string","description":"ID para rastreamento da mensagem (aceita valores duplicados)","example":"msg_123456789"},"async":{"type":"boolean","description":"Se true, envia a mensagem de forma assíncrona via fila interna","example":false}},"required":["number","fullName","phoneNumber"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/send/location":{"post":{"operationId":"whatsappSendLocation","summary":"Enviar localização geográfica","tags":["WhatsApp: mensagens"],"description":"Escopo obrigatório: `whatsapp:write`. Envia uma localização geográfica para um contato ou grupo. Espelha POST /send/location do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","description":"ID do chat para o qual a mensagem será enviada. Pode ser um número de telefone em formato internacional, um ID de grupo (`@g.us`), um ID de usuário (com `@s.whatsapp.net` ou `@lid`).","example":"5511999999999"},"name":{"type":"string","description":"Nome do local","example":"MASP"},"address":{"type":"string","description":"Endereço do local","example":"Av. Paulista, 1578 - Bela Vista, São Paulo - SP"},"latitude":{"type":"number","description":"Latitude (-90 a 90)","example":-23.5616},"longitude":{"type":"number","description":"Longitude (-180 a 180)","example":-46.6562},"replyid":{"type":"string","description":"ID da mensagem para responder","example":"3EB0538DA65A59F6D8A251"},"mentions":{"type":"string","description":"Números para mencionar (separados por vírgula)","example":"5511999999999,5511888888888"},"readchat":{"type":"boolean","description":"Marca conversa como lida após envio","example":true},"readmessages":{"type":"boolean","description":"Marca últimas mensagens recebidas como lidas","example":true},"delay":{"type":"integer","description":"Atraso em milissegundos antes do envio, durante o atraso apacerá 'Digitando...'","example":1000},"forward":{"type":"boolean","description":"Marca a mensagem como encaminhada no WhatsApp","example":true},"track_source":{"type":"string","description":"Origem do rastreamento da mensagem","example":"chatwoot"},"track_id":{"type":"string","description":"ID para rastreamento da mensagem (aceita valores duplicados)","example":"msg_123456789"},"async":{"type":"boolean","description":"Se true, envia a mensagem de forma assíncrona via fila interna","example":false}},"required":["number","latitude","longitude"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/message/presence":{"post":{"operationId":"whatsappMessagePresence","summary":"Enviar atualização de presença","tags":["WhatsApp: mensagens"],"description":"Escopo obrigatório: `whatsapp:write`. Envia uma atualização de presença para um contato ou grupo de forma **assíncrona**. Espelha POST /message/presence do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","description":"Número do destinatário no formato internacional (ex: 5511999999999)","example":"5511999999999"},"presence":{"type":"string","description":"Tipo de presença a ser enviada","enum":["composing","recording","paused"],"example":"composing"},"delay":{"type":"integer","description":"Duração em milissegundos que a presença ficará ativa (máximo 5 minutos = 300000ms).\nSe não informado ou valor maior que 5 minutos, usa o limite padrão de 5 minutos.\nA presença é reenviada a cada 10 segundos durante este período.\n","maximum":300000,"example":30000}},"required":["number","presence"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/send/status":{"post":{"operationId":"whatsappSendStatus","summary":"Enviar Stories (Status)","tags":["WhatsApp: mensagens"],"description":"Escopo obrigatório: `whatsapp:write`. Envia um story (status) com suporte para texto, imagem, vídeo e áudio. Espelha POST /send/status do provedor de conexão; campos e respostas seguem essa operação. Mídia (file, thumbnail): envie base64, data URI ou a URL pública de um arquivo no storage Grapnel. Corpo máximo: 4 MiB. Exige instância conectada.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["text","image","video","audio","myaudio","ptt"],"description":"Tipo do status","example":"text"},"text":{"type":"string","description":"Texto principal ou legenda","example":"Novidades chegando!"},"background_color":{"type":"integer","minimum":1,"maximum":19,"description":"Código da cor de fundo","example":7},"font":{"type":"integer","minimum":0,"maximum":8,"description":"Estilo da fonte (apenas para type=text)","example":1},"file":{"type":"string","description":"URL ou Base64 do arquivo de mídia","example":"https://example.com/video.mp4"},"thumbnail":{"type":"string","description":"URL ou Base64 da miniatura (opcional para vídeos)","example":"https://example.com/thumb.jpg"},"mimetype":{"type":"string","description":"MIME type do arquivo (opcional)","example":"video/mp4"},"replyid":{"type":"string","description":"ID da mensagem para responder","example":"3EB0538DA65A59F6D8A251"},"mentions":{"type":"string","description":"Números para mencionar (separados por vírgula)","example":"5511999999999,5511888888888"},"readchat":{"type":"boolean","description":"Marca conversa como lida após envio","example":true},"readmessages":{"type":"boolean","description":"Marca últimas mensagens recebidas como lidas","example":true},"delay":{"type":"integer","description":"Atraso em milissegundos antes do envio","example":1000},"forward":{"type":"boolean","description":"Marca a mensagem como encaminhada no WhatsApp","example":false},"async":{"type":"boolean","description":"Se true, envia a mensagem de forma assíncrona via fila interna","example":false},"track_source":{"type":"string","description":"Origem do rastreamento da mensagem","example":"chatwoot"},"track_id":{"type":"string","description":"ID para rastreamento da mensagem (aceita valores duplicados)","example":"msg_123456789"}},"required":["type"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/send/menu":{"post":{"operationId":"whatsappSendMenu","summary":"Enviar menu interativo (botões, carrosel, lista ou enquete)","tags":["WhatsApp: mensagens"],"description":"Escopo obrigatório: `whatsapp:write`. Este endpoint oferece uma interface unificada para envio de quatro tipos principais de mensagens interativas: - Botões: Para ações rápidas e diretas - Carrosel de Botões: Para uma lista horizontal de botões com imagens - Listas: Para menus organizados em seções - Enquetes: Para coleta de opiniões e votações Espelha POST /send/menu do provedor de conexão; campos e respostas seguem essa operação. Mídia (imageButton): envie base64, data URI ou a URL pública de um arquivo no storage Grapnel. Corpo máximo: 4 MiB. Exige instância conectada.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","description":"ID do chat para o qual a mensagem será enviada. Pode ser um número de telefone em formato internacional, um ID de grupo (`@g.us`), um ID de usuário (com `@s.whatsapp.net` ou `@lid`).","example":"5511999999999"},"type":{"type":"string","description":"Tipo do menu (button, list, poll, carousel)","enum":["button","list","poll","carousel"],"example":"list"},"text":{"type":"string","description":"Texto principal (aceita placeholders)","example":"Escolha uma opção:"},"footerText":{"type":"string","description":"Texto do rodapé (opcional)","example":"Menu de serviços"},"listButton":{"type":"string","description":"Texto do botão principal","example":"Ver opções"},"selectableCount":{"type":"integer","description":"Número máximo de opções selecionáveis (para enquetes)","example":1},"choices":{"type":"array","description":"Lista de opções. Use [Título] para seções em listas","items":{"type":"string"},"example":["[Eletrônicos]","Smartphones|phones|Últimos lançamentos","Notebooks|notes|Modelos 2024","[Acessórios]","Fones|fones|Bluetooth e com fio","Capas|cases|Proteção para seu device"]},"imageButton":{"type":"string","description":"URL da imagem para botões (recomendado para type: button)","example":"https://exemplo.com/imagem-botao.jpg"},"replyid":{"type":"string","description":"ID da mensagem para responder","example":"3EB0538DA65A59F6D8A251"},"mentions":{"type":"string","description":"Números para mencionar (separados por vírgula)","example":"5511999999999,5511888888888"},"readchat":{"type":"boolean","description":"Marca conversa como lida após envio","example":true},"readmessages":{"type":"boolean","description":"Marca últimas mensagens recebidas como lidas","example":true},"delay":{"type":"integer","description":"Atraso em milissegundos antes do envio, durante o atraso apacerá 'Digitando...'","example":1000},"track_source":{"type":"string","description":"Origem do rastreamento da mensagem","example":"chatwoot"},"track_id":{"type":"string","description":"ID para rastreamento da mensagem (aceita valores duplicados)","example":"msg_123456789"},"async":{"type":"boolean","description":"Se true, envia a mensagem de forma assíncrona via fila interna","example":false}},"required":["number","type","text","choices"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/send/carousel":{"post":{"operationId":"whatsappSendCarousel","summary":"Enviar carrossel de mídia com botões","tags":["WhatsApp: mensagens"],"description":"Escopo obrigatório: `whatsapp:write`. Este endpoint permite enviar um carrossel com imagens e botões interativos. Funciona de maneira igual ao endpoint `/send/menu` com type: carousel, porém usando outro formato de payload. Espelha POST /send/carousel do provedor de conexão; campos e respostas seguem essa operação. Mídia (carousel[].image, carousel[].video, carousel[].document): envie base64, data URI ou a URL pública de um arquivo no storage Grapnel. Corpo máximo: 4 MiB. Exige instância conectada.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","description":"ID do chat para o qual a mensagem será enviada. Pode ser um número de telefone em formato internacional, um ID de grupo (`@g.us`), um ID de usuário (com `@s.whatsapp.net` ou `@lid`).","example":"5511999999999"},"text":{"type":"string","description":"Texto principal da mensagem","example":"Nossos Produtos em Destaque"},"carousel":{"type":"array","description":"Array de cartões do carrossel","items":{"type":"object","properties":{"text":{"type":"string","description":"Texto do cartão","example":"Smartphone XYZ\nO mais avançado smartphone da linha"},"image":{"type":"string","description":"URL da imagem (opcional)","example":"https://exemplo.com/produto1.jpg"},"video":{"type":"string","description":"URL do vídeo (alternativa à imagem)","example":"https://exemplo.com/produto1.mp4"},"document":{"type":"string","description":"URL do documento (alternativa à imagem)","example":"https://exemplo.com/catalogo.pdf"},"filename":{"type":"string","description":"Nome do arquivo para documentos","example":"Catalogo.pdf"},"buttons":{"type":"array","description":"Array de botões do cartão","items":{"type":"object","properties":{"id":{"type":"string","description":"ID do botão","example":"buy_xyz"},"text":{"type":"string","description":"Texto exibido no botão","example":"Comprar Agora"},"type":{"type":"string","description":"Tipo do botão:\n* REPLY - O id será enviado como resposta ao chat\n* URL - O id deve ser a URL completa que será aberta\n* COPY - O id será o texto copiado para área de transferência\n* CALL - O id deve ser o número de telefone para a chamada\n","enum":["REPLY","URL","CALL","COPY"],"example":"REPLY"}}}}},"required":["text","buttons"]}},"delay":{"type":"integer","description":"Atraso em milissegundos antes do envio","example":1000},"readchat":{"type":"boolean","description":"Marca conversa como lida após envio","example":true},"readmessages":{"type":"boolean","description":"Marca últimas mensagens recebidas como lidas","example":true},"replyid":{"type":"string","description":"ID da mensagem para responder","example":"3EB0538DA65A59F6D8A251"},"mentions":{"type":"string","description":"Números para mencionar (separados por vírgula)","example":"5511999999999,5511888888888"},"forward":{"type":"boolean","description":"Marca a mensagem como encaminhada no WhatsApp","example":false},"async":{"type":"boolean","description":"Se true, envia a mensagem de forma assíncrona via fila interna","example":false},"track_source":{"type":"string","description":"Origem do rastreamento da mensagem","example":"chatwoot"},"track_id":{"type":"string","description":"ID para rastreamento da mensagem (aceita valores duplicados)","example":"msg_123456789"}},"required":["number","text","carousel"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/send/location-button":{"post":{"operationId":"whatsappSendLocationButton","summary":"Solicitar localização do usuário","tags":["WhatsApp: mensagens"],"description":"Escopo obrigatório: `whatsapp:write`. Este endpoint envia uma mensagem com um botão que solicita a localização do usuário. Quando o usuário clica no botão, o WhatsApp abre a interface para compartilhar a localização atual. Espelha POST /send/location-button do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","description":"ID do chat para o qual a mensagem será enviada. Pode ser um número de telefone em formato internacional, um ID de grupo (`@g.us`), um ID de usuário (com `@s.whatsapp.net` ou `@lid`).","example":"5511999999999"},"text":{"type":"string","description":"Texto da mensagem que será exibida","example":"Por favor, compartilhe sua localização"},"delay":{"type":"integer","description":"Atraso em milissegundos antes do envio","example":0},"readchat":{"type":"boolean","description":"Se deve marcar a conversa como lida após envio","example":true},"readmessages":{"type":"boolean","description":"Marca últimas mensagens recebidas como lidas","example":true},"replyid":{"type":"string","description":"ID da mensagem para responder","example":"3EB0538DA65A59F6D8A251"},"mentions":{"type":"string","description":"Números para mencionar (separados por vírgula)","example":"5511999999999,5511888888888"},"async":{"type":"boolean","description":"Se true, envia a mensagem de forma assíncrona via fila interna","example":false},"track_source":{"type":"string","description":"Origem do rastreamento da mensagem","example":"chatwoot"},"track_id":{"type":"string","description":"ID para rastreamento da mensagem (aceita valores duplicados)","example":"msg_123456789"}},"required":["number","text"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/send/request-payment":{"post":{"operationId":"whatsappSendRequestPayment","summary":"Solicitar pagamento","tags":["WhatsApp: mensagens"],"description":"Escopo obrigatório: `whatsapp:write`. Envia uma solicitação de pagamento com o botão nativo **\"Revisar e pagar\"** do WhatsApp. O fluxo suporta PIX (estático, dinâmico ou desabilitado), boleto, link de pagamento e cartão, combinando tudo em uma única mensagem interativa. Espelha POST /send/request-payment do provedor de conexão; campos e respostas seguem essa operação. Mídia (fileUrl): envie base64, data URI ou a URL pública de um arquivo no storage Grapnel. Corpo máximo: 4 MiB. Exige instância conectada.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","description":"ID do chat para o qual a mensagem será enviada. Pode ser um número de telefone em formato internacional, um ID de grupo (`@g.us`), um ID de usuário (com `@s.whatsapp.net` ou `@lid`).","example":"5511999999999"},"title":{"type":"string","description":"Título que aparece no cabeçalho do fluxo","example":"Detalhes do pedido"},"text":{"type":"string","description":"Mensagem exibida no corpo do fluxo","example":"Pedido #123 pronto para pagamento"},"footer":{"type":"string","description":"Texto do rodapé da mensagem","example":"Loja Exemplo"},"itemName":{"type":"string","description":"Nome do item principal listado no fluxo","example":"Assinatura Plano Ouro"},"invoiceNumber":{"type":"string","description":"Identificador ou número da fatura","example":"PED-123"},"amount":{"type":"number","format":"float","description":"Valor da cobrança (em BRL por padrão)","example":199.9},"pixKey":{"type":"string","description":"Chave PIX estático (CPF/CNPJ/telefone/email/EVP)","example":"123e4567-e89b-12d3-a456-426614174000"},"pixType":{"type":"string","description":"Tipo da chave PIX (`CPF`, `CNPJ`, `PHONE`, `EMAIL`, `EVP`). Padrão `EVP`","example":"EVP"},"pixName":{"type":"string","description":"Nome do recebedor exibido no fluxo (padrão usa o nome do perfil da instância)","example":"Loja Exemplo"},"paymentLink":{"type":"string","description":"URL externa para checkout (somente dominios homologados; veja lista acima)","example":"https://pagamentos.exemplo.com/checkout/abc"},"fileUrl":{"type":"string","description":"URL ou caminho (base64) do documento a ser anexado (ex.: boleto PDF)","example":"https://cdn.exemplo.com/boleto-123.pdf"},"fileName":{"type":"string","description":"Nome do arquivo exibido no WhatsApp ao anexar `fileUrl`","example":"boleto-123.pdf"},"boletoCode":{"type":"string","description":"Linha digitável do boleto (habilita o método boleto automaticamente)","example":"34191.79001 01043.510047 91020.150008 5 91070026000"},"replyid":{"type":"string","description":"ID da mensagem que será respondida"},"mentions":{"type":"string","description":"Números mencionados separados por vírgula"},"delay":{"type":"integer","description":"Atraso em milissegundos antes do envio (exibe \"digitando...\" no WhatsApp)"},"readchat":{"type":"boolean","description":"Marca o chat como lido após enviar a mensagem"},"readmessages":{"type":"boolean","description":"Marca mensagens recentes como lidas após o envio"},"async":{"type":"boolean","description":"Enfileira o envio para processamento assíncrono"},"track_source":{"type":"string","description":"Origem de rastreamento (ex.: chatwoot, crm-interno)"},"track_id":{"type":"string","description":"Identificador de rastreamento (aceita valores duplicados)"}},"required":["number","amount"]},"example":{"number":"5511999999999","amount":199.9,"text":"Pedido #123 pronto para pagamento","pixKey":"123e4567-e89b-12d3-a456-426614174000","pixType":"EVP"}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/send/pix-button":{"post":{"operationId":"whatsappSendPixButton","summary":"Enviar botão PIX","tags":["WhatsApp: mensagens"],"description":"Escopo obrigatório: `whatsapp:write`. Envia um botão nativo do WhatsApp que abre para pagamento PIX com a chave informada. O usuário visualiza o detalhe do recebedor, nome e chave. Espelha POST /send/pix-button do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","description":"ID do chat para o qual a mensagem será enviada. Pode ser um número de telefone em formato internacional, um ID de grupo (`@g.us`), um ID de usuário (com `@s.whatsapp.net` ou `@lid`).","example":"5511999999999"},"pixType":{"type":"string","description":"Tipo da chave PIX. Valores aceitos: CPF, CNPJ, PHONE, EMAIL ou EVP","example":"EVP"},"pixKey":{"type":"string","description":"Valor da chave PIX (CPF/CNPJ/telefone/email/EVP)","example":"123e4567-e89b-12d3-a456-426614174000"},"pixName":{"type":"string","description":"Nome exibido como recebedor do PIX (padrão \"Pix\" se vazio)","example":"Loja Exemplo"},"async":{"type":"boolean","description":"Enfileira o envio para processamento assíncrono"},"delay":{"type":"integer","description":"Atraso em milissegundos antes do envio (exibe \"digitando...\" no WhatsApp)"},"readchat":{"type":"boolean","description":"Marca o chat como lido após enviar a mensagem"},"readmessages":{"type":"boolean","description":"Marca mensagens recentes como lidas após o envio"},"replyid":{"type":"string","description":"ID da mensagem que será respondida"},"mentions":{"type":"string","description":"Lista de números mencionados separados por vírgula"},"track_source":{"type":"string","description":"Origem de rastreamento (ex.: chatwoot, crm-interno)"},"track_id":{"type":"string","description":"Identificador de rastreamento (aceita valores duplicados)"}},"required":["number","pixType","pixKey"],"example":{"number":"5511999999999","pixType":"EVP","pixKey":"123e4567-e89b-12d3-a456-426614174000","pixName":"Loja Exemplo"}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/message/async":{"get":{"operationId":"whatsappMessageAsyncGet","summary":"Consultar fila async de envio direto","tags":["WhatsApp: mensagens"],"description":"Escopo obrigatório: `whatsapp:read`. Retorna um resumo simples da fila de envio `async=true` da instância atual autenticada. Espelha GET /message/async do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["whatsapp:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}},"delete":{"operationId":"whatsappMessageAsyncDelete","summary":"Limpar fila async de envio direto","tags":["WhatsApp: mensagens"],"description":"Escopo obrigatório: `whatsapp:write`. Cancela toda a fila de envio `async=true` da instância e marca as mensagens pendentes como `Canceled`. Espelha DELETE /message/async do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/message/download":{"post":{"operationId":"whatsappMessageDownload","summary":"Baixar arquivo de uma mensagem","tags":["WhatsApp: mensagens"],"description":"Escopo obrigatório: `chats:read`. Baixa o arquivo associado a uma mensagem de mídia (imagem, vídeo, áudio, documento ou sticker). Espelha POST /message/download do provedor de conexão; campos e respostas seguem essa operação. Somente leitura: não exige Idempotency-Key. Exige instância conectada.","x-required-scopes":["chats:read"],"x-read-only":true,"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID da mensagem contendo o arquivo","example":"7EB0F01D7244B421048F0706368376E0"},"return_base64":{"type":"boolean","description":"Se verdadeiro, retorna o conteúdo em base64","default":false},"generate_mp3":{"type":"boolean","description":"Para áudios, define formato de retorno (true=MP3, false=OGG)","default":true},"return_link":{"type":"boolean","description":"Salva e retorna URL pública do arquivo","default":true},"transcribe":{"type":"boolean","description":"Se verdadeiro, transcreve áudios para texto","default":false},"openai_apikey":{"type":"string","description":"Chave da API OpenAI para transcrição (opcional)","example":"sk-..."},"download_quoted":{"type":"boolean","description":"Se verdadeiro, baixa mídia da mensagem citada ao invés da mensagem principal","default":false}},"required":["id"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/message/find":{"post":{"operationId":"whatsappMessageFind","summary":"Buscar mensagens em um chat","tags":["WhatsApp: mensagens"],"description":"Escopo obrigatório: `chats:read`. Busca mensagens com múltiplos filtros disponíveis. Este endpoint permite: Espelha POST /message/find do provedor de conexão; campos e respostas seguem essa operação. Somente leitura: não exige Idempotency-Key. Exige instância conectada.","x-required-scopes":["chats:read"],"x-read-only":true,"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID específico da mensagem para busca exata","example":"user123:r3EB0538"},"chatid":{"type":"string","description":"ID do chat no formato internacional","example":"5511999999999@s.whatsapp.net"},"track_source":{"type":"string","description":"Origem do rastreamento para filtrar mensagens","example":"chatwoot"},"track_id":{"type":"string","description":"ID de rastreamento para filtrar mensagens","example":"msg_123456789"},"limit":{"type":"integer","description":"Numero maximo de mensagens a retornar (padrao 100)","minimum":1,"default":100,"example":20},"offset":{"type":"integer","description":"Deslocamento para paginacao (0 retorna as mensagens mais recentes)","default":0}}},"example":{"chatid":"5511999999999@s.whatsapp.net","limit":20,"offset":0}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/message/markread":{"post":{"operationId":"whatsappMessageMarkread","summary":"Marcar mensagens como lidas","tags":["WhatsApp: mensagens"],"description":"Escopo obrigatório: `chats:write`. Marca uma ou mais mensagens como lidas. Este endpoint permite: 1. Marcar múltiplas mensagens como lidas de uma vez 2. Atualizar o status de leitura no WhatsApp 3. Sincronizar o status de leitura entre dispositivos Espelha POST /message/markread do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["chats:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"array","description":"Lista de IDs das mensagens a serem marcadas como lidas","items":{"type":"string"},"example":["62AD1AD844E518180227BF68DA7ED710","ECB9DE48EB41F77BFA8491BFA8D6EF9B"]}},"required":["id"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/message/react":{"post":{"operationId":"whatsappMessageReact","summary":"Enviar reação a uma mensagem","tags":["WhatsApp: mensagens"],"description":"Escopo obrigatório: `whatsapp:write`. Envia uma reação (emoji) a uma mensagem específica. Este endpoint permite: Espelha POST /message/react do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","description":"Número do chat no formato internacional","example":"5511999999999@s.whatsapp.net"},"text":{"type":"string","description":"Emoji Unicode da reação (ou string vazia para remover reação)","example":"👍"},"id":{"type":"string","description":"ID da mensagem que receberá a reação","example":"3EB0538DA65A59F6D8A251"}},"required":["number","text","id"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/message/delete":{"post":{"operationId":"whatsappMessageDelete","summary":"Apagar Mensagem Para Todos","tags":["WhatsApp: mensagens"],"description":"Escopo obrigatório: `whatsapp:write`. Apaga uma mensagem para todos os participantes da conversa. Espelha POST /message/delete do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID da mensagem a ser apagada"}},"required":["id"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/message/edit":{"post":{"operationId":"whatsappMessageEdit","summary":"Edita uma mensagem enviada","tags":["WhatsApp: mensagens"],"description":"Escopo obrigatório: `whatsapp:write`. Edita o conteúdo de uma mensagem já enviada usando a funcionalidade nativa do WhatsApp. Espelha POST /message/edit do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","text"],"properties":{"id":{"type":"string","description":"ID único da mensagem que será editada (formato owner:messageid ou apenas messageid)","example":"3A12345678901234567890123456789012"},"text":{"type":"string","description":"Novo conteúdo de texto da mensagem","example":"Texto editado da mensagem"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/group/create":{"post":{"operationId":"whatsappGroupCreate","summary":"Criar um novo grupo","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Cria um novo grupo no WhatsApp com participantes iniciais. Espelha POST /group/create do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Nome do grupo","minLength":1,"maxLength":100,"example":"uazapiGO grupo"},"participants":{"type":"array","description":"Lista de números de telefone dos participantes iniciais","items":{"type":"string","description":"Número de telefone sem formatação"},"minItems":1,"maxItems":50,"example":["5521987905995","5511912345678"]}},"required":["name","participants"]},"example":{"name":"Meu Novo Grupo","participants":["5521987905995"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/group/info":{"post":{"operationId":"whatsappGroupInfo","summary":"Obter informações detalhadas de um grupo","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `whatsapp:read`. Recupera informações completas de um grupo do WhatsApp, incluindo: - Detalhes do grupo - Participantes - Configurações - Link de convite (opcional) Espelha POST /group/info do provedor de conexão; campos e respostas seguem essa operação. Somente leitura: não exige Idempotency-Key. Exige instância conectada.","x-required-scopes":["whatsapp:read"],"x-read-only":true,"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"groupjid":{"type":"string","description":"Identificador único do grupo (JID)","example":"120363153742561022@g.us"},"getInviteLink":{"type":"boolean","description":"Recuperar link de convite do grupo","default":false,"example":true},"getRequestsParticipants":{"type":"boolean","description":"Recuperar lista de solicitações pendentes de participação","default":false,"example":false},"force":{"type":"boolean","description":"Forçar atualização, ignorando cache","default":false,"example":false}},"required":["groupjid"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/group/invite-info":{"post":{"operationId":"whatsappGroupInviteInfo","summary":"Obter informações de um grupo pelo código de convite","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `whatsapp:read`. Retorna informações detalhadas de um grupo usando um código de convite ou URL completo do WhatsApp. Espelha POST /group/inviteInfo do provedor de conexão; campos e respostas seguem essa operação. Somente leitura: não exige Idempotency-Key. Exige instância conectada.","x-required-scopes":["whatsapp:read"],"x-read-only":true,"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invitecode":{"type":"string","description":"Código de convite ou URL completo do grupo.\nPode ser um código curto ou a URL completa do WhatsApp.\n","examples":["IYnl5Zg9bUcJD32rJrDzO7","https://chat.whatsapp.com/IYnl5Zg9bUcJD32rJrDzO7"]}},"required":["invitecode"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/group/join":{"post":{"operationId":"whatsappGroupJoin","summary":"Entrar em um grupo usando código de convite","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Permite entrar em um grupo do WhatsApp usando um código de convite ou URL completo. Espelha POST /group/join do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["invitecode"],"properties":{"invitecode":{"type":"string","description":"Código de convite ou URL completo do grupo. \nFormatos aceitos:\n- Código completo: \"IYnl5Zg9bUcJD32rJrDzO7\"\n- URL completa: \"https://chat.whatsapp.com/IYnl5Zg9bUcJD32rJrDzO7\"\n","example":"https://chat.whatsapp.com/IYnl5Zg9bUcJD32rJrDzO7","minLength":10,"maxLength":50}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/group/leave":{"post":{"operationId":"whatsappGroupLeave","summary":"Sair de um grupo","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Remove o usuário atual de um grupo específico do WhatsApp. Espelha POST /group/leave do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"groupjid":{"type":"string","description":"Identificador único do grupo (JID)\n- Formato: número@g.us\n- Exemplo válido: 120363324255083289@g.us\n","example":"120363324255083289@g.us","pattern":"^\\d+@g\\.us$"}},"required":["groupjid"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/group/list":{"get":{"operationId":"whatsappGroupListGet","summary":"Listar todos os grupos","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `whatsapp:read`. Retorna uma lista com todos os grupos disponíveis para a instância atual do WhatsApp. Espelha GET /group/list do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["whatsapp:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"force","in":"query","required":false,"schema":{"type":"boolean","default":false},"description":"Se definido como `true`, força a atualização do cache de grupos. Útil para garantir que as informações mais recentes sejam recuperadas."},{"name":"noparticipants","in":"query","required":false,"schema":{"type":"boolean","default":false},"description":"Se definido como `true`, retorna a lista de grupos sem incluir os participantes. Útil para otimizar a resposta quando não há necessidade dos dados dos participantes."}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}},"post":{"operationId":"whatsappGroupList","summary":"Listar todos os grupos com filtros e paginacao","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `whatsapp:read`. Retorna uma lista com todos os grupos disponiveis para a instancia atual do WhatsApp, com opcoes de filtros e paginacao via corpo (POST). A rota GET continua para quem prefere a listagem direta sem paginacao. Espelha POST /group/list do provedor de conexão; campos e respostas seguem essa operação. Somente leitura: não exige Idempotency-Key. Exige instância conectada.","x-required-scopes":["whatsapp:read"],"x-read-only":true,"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"page":{"type":"integer","description":"Numero da pagina para paginacao (padrao 1)","default":1},"pageSize":{"type":"integer","description":"Quantidade de resultados por pagina (padrao 50, maximo 1000)","default":50},"limit":{"type":"integer","description":"Alias opcional para `pageSize`"},"offset":{"type":"integer","description":"Deslocamento base zero; se informado recalcula a pagina","default":0},"search":{"type":"string","description":"Texto para filtrar grupos por nome/JID"},"force":{"type":"boolean","default":false,"description":"Se definido como `true`, forca a atualizacao do cache de grupos.\nUtil para garantir que as informacoes mais recentes sejam recuperadas.\n"},"noParticipants":{"type":"boolean","default":false,"description":"Se definido como `true`, retorna a lista de grupos sem incluir os participantes.\nUtil para otimizar a resposta quando nao ha necessidade dos dados dos participantes.\n"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/group/reset-invite-code":{"post":{"operationId":"whatsappGroupResetInviteCode","summary":"Resetar código de convite do grupo","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Gera um novo código de convite para o grupo, invalidando o código de convite anterior. Somente administradores do grupo podem realizar esta ação. Espelha POST /group/resetInviteCode do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"groupjid":{"type":"string","description":"Identificador único do grupo (JID)","example":"120363308883996631@g.us"}},"required":["groupjid"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/group/update-announce":{"post":{"operationId":"whatsappGroupUpdateAnnounce","summary":"Configurar permissões de envio de mensagens no grupo","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Define as permissões de envio de mensagens no grupo, permitindo restringir o envio apenas para administradores. Espelha POST /group/updateAnnounce do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"groupjid":{"type":"string","description":"Identificador único do grupo no formato xxxx@g.us","example":"120363339858396166@g.us"},"announce":{"type":"boolean","description":"Controla quem pode enviar mensagens no grupo","example":true}},"required":["groupjid","announce"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/group/update-description":{"post":{"operationId":"whatsappGroupUpdateDescription","summary":"Atualizar descrição do grupo","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Altera a descrição (tópico) do grupo WhatsApp especificado. Requer que o usuário seja administrador do grupo. A descrição aparece na tela de informações do grupo e pode ser visualizada por todos os participantes. Espelha POST /group/updateDescription do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["groupjid","description"],"properties":{"groupjid":{"type":"string","description":"JID (ID) do grupo no formato xxxxx@g.us","example":"120363339858396166@g.us","pattern":"^[0-9]+@g\\.us$"},"description":{"type":"string","description":"Nova descrição/tópico do grupo","example":"Grupo oficial de suporte","maxLength":512}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/group/update-image":{"post":{"operationId":"whatsappGroupUpdateImage","summary":"Atualizar imagem do grupo","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Altera a imagem do grupo especificado. A imagem pode ser enviada como URL ou como string base64. Espelha POST /group/updateImage do provedor de conexão; campos e respostas seguem essa operação. Mídia (image): envie base64, data URI ou a URL pública de um arquivo no storage Grapnel. Corpo máximo: 4 MiB. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"groupjid":{"type":"string","description":"JID do grupo","example":"120363308883996631@g.us"},"image":{"type":"string","description":"URL da imagem, string base64 ou \"remove\"/\"delete\" para remover.\nA imagem deve estar em formato JPEG e ter resolução máxima de 640x640.\n","examples":["https://example.com/image.jpg","data:image/jpeg;base64,/9j/4AAQSkZJRg...","remove"]}},"required":["groupjid","image"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/group/update-locked":{"post":{"operationId":"whatsappGroupUpdateLocked","summary":"Configurar permissão de edição do grupo","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Define se apenas administradores podem editar as informações do grupo. Quando bloqueado (locked=true), apenas administradores podem alterar nome, descrição, imagem e outras configurações do grupo. Quando desbloqueado (locked=false), qualquer participante pode editar as informações. Espelha POST /group/updateLocked do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"groupjid":{"type":"string","description":"Identificador único do grupo (JID)","example":"120363308883996631@g.us"},"locked":{"type":"boolean","description":"Define permissões de edição:\n- true = apenas admins podem editar infos do grupo\n- false = qualquer participante pode editar infos do grupo\n","example":true}},"required":["groupjid","locked"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/group/update-name":{"post":{"operationId":"whatsappGroupUpdateName","summary":"Atualizar nome do grupo","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Altera o nome de um grupo do WhatsApp. Apenas administradores do grupo podem realizar esta operação. O nome do grupo deve seguir as diretrizes do WhatsApp e ter entre 1 e 25 caracteres. Espelha POST /group/updateName do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["groupjid","name"],"properties":{"groupjid":{"type":"string","description":"Identificador único do grupo no formato JID","example":"120363339858396166@g.us"},"name":{"type":"string","description":"Novo nome para o grupo","example":"Grupo de Suporte","minLength":1,"maxLength":25}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/group/update-participants":{"post":{"operationId":"whatsappGroupUpdateParticipants","summary":"Gerenciar participantes do grupo","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Gerencia participantes do grupo através de diferentes ações: - Adicionar ou remover participantes - Promover ou rebaixar administradores - Aprovar ou rejeitar solicitações pendentes Espelha POST /group/updateParticipants do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"groupjid":{"type":"string","description":"JID (identificador) do grupo","example":"120363308883996631@g.us"},"action":{"type":"string","description":"Ação a ser executada:\n- add: Adicionar participantes ao grupo\n- remove: Remover participantes do grupo\n- promote: Promover participantes a administradores\n- demote: Remover privilégios de administrador\n- approve: Aprovar solicitações pendentes de entrada\n- reject: Rejeitar solicitações pendentes de entrada\n","enum":["add","remove","promote","demote","approve","reject"],"example":"promote"},"participants":{"type":"array","items":{"type":"string"},"description":"Lista de números de telefone ou JIDs dos participantes.\nPara números de telefone, use formato internacional sem '+' ou espaços.\n","example":["5521987654321","5511999887766"]}},"required":["groupjid","action","participants"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/community/create":{"post":{"operationId":"whatsappCommunityCreate","summary":"Criar uma comunidade","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Cria uma nova comunidade no WhatsApp. Uma comunidade é uma estrutura que permite agrupar múltiplos grupos relacionados sob uma única administração. Espelha POST /community/create do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Nome da comunidade","example":"Comunidade do Bairro"}},"required":["name"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/community/editgroups":{"post":{"operationId":"whatsappCommunityEditgroups","summary":"Gerenciar grupos em uma comunidade","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Adiciona ou remove grupos de uma comunidade do WhatsApp. Apenas administradores da comunidade podem executar estas operações. Espelha POST /community/editgroups do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["community","action","groupjids"],"properties":{"community":{"type":"string","description":"JID (identificador único) da comunidade","example":"120363153742561022@g.us"},"action":{"type":"string","enum":["add","remove"],"description":"Tipo de operação a ser realizada:\n* add - Adiciona grupos à comunidade\n* remove - Remove grupos da comunidade\n"},"groupjids":{"type":"array","items":{"type":"string","pattern":"^[0-9]+@g.us$"},"minItems":1,"description":"Lista de JIDs dos grupos para adicionar ou remover","example":["120363324255083289@g.us","120363308883996631@g.us"]}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/create":{"post":{"operationId":"whatsappNewsletterCreate","summary":"Criar canal","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Cria um novo canal/newsletter no WhatsApp. Espelha POST /newsletter/create do provedor de conexão; campos e respostas seguem essa operação. Mídia (picture): envie base64, data URI ou a URL pública de um arquivo no storage Grapnel. Corpo máximo: 4 MiB. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","example":"Canal de Promoções"},"description":{"type":"string","example":"Ofertas e novidades da loja"},"picture":{"type":"string","description":"URL, base64 puro ou data URI da imagem do canal.","example":"https://example.com/newsletter.png"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/list":{"get":{"operationId":"whatsappNewsletterListGet","summary":"Listar canais inscritos","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `whatsapp:read`. Retorna os canais/newsletters já inscritos na instância atual. Espelha GET /newsletter/list do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["whatsapp:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/info":{"post":{"operationId":"whatsappNewsletterInfo","summary":"Buscar informações de um canal","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `whatsapp:read`. Busca os detalhes de um canal/newsletter pelo `id` numérico ou pelo `jid`. Espelha POST /newsletter/info do provedor de conexão; campos e respostas seguem essa operação. Somente leitura: não exige Idempotency-Key. Exige instância conectada.","x-required-scopes":["whatsapp:read"],"x-read-only":true,"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID numérico do canal. Se informado sem domínio, será convertido para `@newsletter`.","example":"120363123456789012"},"jid":{"type":"string","description":"JID completo do canal.","example":"120363123456789012@newsletter"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/link":{"post":{"operationId":"whatsappNewsletterLink","summary":"Buscar canal por link-chave de convite","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `whatsapp:read`. Busca as informações de um canal a partir da chave de convite. Espelha POST /newsletter/link do provedor de conexão; campos e respostas seguem essa operação. Somente leitura: não exige Idempotency-Key. Exige instância conectada.","x-required-scopes":["whatsapp:read"],"x-read-only":true,"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["key"],"properties":{"key":{"type":"string","description":"Chave do convite do canal.","example":"AbCdEfGhIjKlMn"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/subscribe":{"post":{"operationId":"whatsappNewsletterSubscribe","summary":"Assinar live updates temporários de um canal","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `whatsapp:read`. Assina temporariamente os live updates internos do WhatsApp para um canal. Espelha POST /newsletter/subscribe do provedor de conexão; campos e respostas seguem essa operação. Somente leitura: não exige Idempotency-Key. Exige instância conectada.","x-required-scopes":["whatsapp:read"],"x-read-only":true,"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"120363123456789012"},"jid":{"type":"string","example":"120363123456789012@newsletter"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/messages":{"post":{"operationId":"whatsappNewsletterMessages","summary":"Buscar mensagens de um canal","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `whatsapp:read`. Busca diretamente no WhatsApp os posts/mensagens de um canal (newsletter). Espelha POST /newsletter/messages do provedor de conexão; campos e respostas seguem essa operação. Somente leitura: não exige Idempotency-Key. Exige instância conectada.","x-required-scopes":["whatsapp:read"],"x-read-only":true,"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID numérico do canal. Se informado sem domínio, será convertido para `@newsletter`.","example":"120363123456789012"},"jid":{"type":"string","description":"JID completo do canal.","example":"120363123456789012@newsletter"},"count":{"type":"integer","minimum":1,"description":"Quantidade de mensagens/posts a buscar.","example":20},"beforeid":{"type":"integer","minimum":1,"description":"Retorna mensagens anteriores ao `serverid` informado.\nUse para paginação retroativa.\n","example":12345},"beforeId":{"type":"integer","deprecated":true,"description":"Alias legado de `beforeid`.","example":12345}}},"example":{"id":"120363123456789012","count":20}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/messages/edit":{"post":{"operationId":"whatsappNewsletterMessagesEdit","summary":"Editar mensagem recente de um canal","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Edita o conteúdo de um post recente de newsletter diretamente no WhatsApp. Espelha POST /newsletter/messages/edit do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text"],"properties":{"id":{"type":"string","description":"ID numérico do canal. Se informado sem domínio, será convertido para `@newsletter`.","example":"120363123456789012"},"jid":{"type":"string","description":"JID completo do canal.","example":"120363123456789012@newsletter"},"messageid":{"type":"string","description":"ID lógico da mensagem no canal.","example":"3EB0B4302B3A8A52F7A1"},"messageId":{"type":"string","deprecated":true,"description":"Alias legado de `messageid`.","example":"3EB0B4302B3A8A52F7A1"},"serverid":{"type":"integer","minimum":1,"description":"Identificador sequencial do post no canal.","example":12345},"serverId":{"type":"integer","minimum":1,"deprecated":true,"description":"Alias legado de `serverid`.","example":12345},"text":{"type":"string","description":"Novo texto ou nova legenda do post.","example":"Post atualizado"},"count":{"type":"integer","minimum":1,"description":"Quantidade de mensagens buscadas por página ao localizar o post.","example":100},"maxpages":{"type":"integer","minimum":1,"description":"Quantidade máxima de páginas buscadas ao localizar o post.","example":5},"maxPages":{"type":"integer","minimum":1,"deprecated":true,"description":"Alias legado de `maxpages`.","example":5}}},"example":{"jid":"120363123456789012@newsletter","messageid":"3EB0B4302B3A8A52F7A1","text":"Post atualizado"}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/messages/delete":{"post":{"operationId":"whatsappNewsletterMessagesDelete","summary":"Deletar mensagem recente de um canal","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Apaga um post recente de newsletter diretamente no WhatsApp. Espelha POST /newsletter/messages/delete do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID numérico do canal. Se informado sem domínio, será convertido para `@newsletter`.","example":"120363123456789012"},"jid":{"type":"string","description":"JID completo do canal.","example":"120363123456789012@newsletter"},"messageid":{"type":"string","description":"ID lógico da mensagem no canal.","example":"3EB0B4302B3A8A52F7A1"},"messageId":{"type":"string","deprecated":true,"description":"Alias legado de `messageid`.","example":"3EB0B4302B3A8A52F7A1"},"serverid":{"type":"integer","minimum":1,"description":"Identificador sequencial do post no canal.","example":12345},"serverId":{"type":"integer","minimum":1,"deprecated":true,"description":"Alias legado de `serverid`.","example":12345},"count":{"type":"integer","minimum":1,"description":"Quantidade de mensagens buscadas por página ao localizar o post.","example":100},"maxpages":{"type":"integer","minimum":1,"description":"Quantidade máxima de páginas buscadas ao localizar o post.","example":5},"maxPages":{"type":"integer","minimum":1,"deprecated":true,"description":"Alias legado de `maxpages`.","example":5}}},"example":{"jid":"120363123456789012@newsletter","messageid":"3EB0B4302B3A8A52F7A1"}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/updates":{"post":{"operationId":"whatsappNewsletterUpdates","summary":"Buscar updates de mensagens de um canal","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `whatsapp:read`. Consulta diretamente no WhatsApp os updates de posts já existentes de um canal. Espelha POST /newsletter/updates do provedor de conexão; campos e respostas seguem essa operação. Somente leitura: não exige Idempotency-Key. Exige instância conectada.","x-required-scopes":["whatsapp:read"],"x-read-only":true,"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID numérico do canal. Se informado sem domínio, será convertido para `@newsletter`.","example":"120363123456789012"},"jid":{"type":"string","description":"JID completo do canal.","example":"120363123456789012@newsletter"},"count":{"type":"integer","minimum":1,"description":"Quantidade máxima de updates retornados.","example":50},"afterid":{"type":"integer","minimum":1,"description":"Retorna apenas updates posteriores ao `serverid` informado.","example":12345},"afterId":{"type":"integer","minimum":1,"deprecated":true,"description":"Alias legado de `afterid`.","example":12345},"since":{"type":"integer","description":"Timestamp de corte.\n- Se maior que `1000000000000`, é interpretado como milissegundos.\n- Caso contrário, é interpretado como segundos.\n","example":1710000000}}},"example":{"id":"120363123456789012","count":50,"afterid":12345}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/viewed":{"post":{"operationId":"whatsappNewsletterViewed","summary":"Marcar posts do canal como visualizados","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `chats:write`. Marca um ou mais posts do canal como visualizados usando `serverid`. Espelha POST /newsletter/viewed do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["chats:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"120363123456789012"},"jid":{"type":"string","example":"120363123456789012@newsletter"},"serverids":{"type":"array","items":{"type":"integer"},"example":[12345,12346]},"serverIds":{"type":"array","deprecated":true,"items":{"type":"integer"},"example":[12345,12346]}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/reaction":{"post":{"operationId":"whatsappNewsletterReaction","summary":"Reagir a um post do canal","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `whatsapp:write`. Envia, altera ou remove uma reação de um post do canal. Espelha POST /newsletter/reaction do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"120363123456789012"},"jid":{"type":"string","example":"120363123456789012@newsletter"},"serverid":{"type":"integer","example":12345},"serverId":{"type":"integer","deprecated":true,"example":12345},"reaction":{"type":"string","example":"🔥"},"reactionmessageid":{"type":"string","example":"3EB0AABBCCDD"},"reactionMessageId":{"type":"string","deprecated":true,"example":"3EB0AABBCCDD"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/follow":{"post":{"operationId":"whatsappNewsletterFollow","summary":"Seguir canal","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Segue um canal/newsletter. Espelha POST /newsletter/follow do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"120363123456789012"},"jid":{"type":"string","example":"120363123456789012@newsletter"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/unfollow":{"post":{"operationId":"whatsappNewsletterUnfollow","summary":"Deixar de seguir canal","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Deixa de seguir um canal/newsletter. Espelha POST /newsletter/unfollow do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"120363123456789012"},"jid":{"type":"string","example":"120363123456789012@newsletter"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/mute":{"post":{"operationId":"whatsappNewsletterMute","summary":"Silenciar canal","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Ativa o mute de um canal/newsletter. Espelha POST /newsletter/mute do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"120363123456789012"},"jid":{"type":"string","example":"120363123456789012@newsletter"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/unmute":{"post":{"operationId":"whatsappNewsletterUnmute","summary":"Remover mute do canal","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Remove o mute de um canal/newsletter. Espelha POST /newsletter/unmute do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"120363123456789012"},"jid":{"type":"string","example":"120363123456789012@newsletter"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/delete":{"post":{"operationId":"whatsappNewsletterDelete","summary":"Deletar canal","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Remove/deleta um canal/newsletter. Espelha POST /newsletter/delete do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"120363123456789012"},"jid":{"type":"string","example":"120363123456789012@newsletter"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/picture":{"post":{"operationId":"whatsappNewsletterPicture","summary":"Atualizar foto do canal","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Atualiza a imagem do canal/newsletter. Espelha POST /newsletter/picture do provedor de conexão; campos e respostas seguem essa operação. Mídia (picture): envie base64, data URI ou a URL pública de um arquivo no storage Grapnel. Corpo máximo: 4 MiB. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["picture"],"properties":{"id":{"type":"string","example":"120363123456789012"},"jid":{"type":"string","example":"120363123456789012@newsletter"},"picture":{"type":"string","example":"https://example.com/newsletter.png"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/name":{"post":{"operationId":"whatsappNewsletterName","summary":"Atualizar nome do canal","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Atualiza o nome do canal/newsletter. Espelha POST /newsletter/name do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"id":{"type":"string","example":"120363123456789012"},"jid":{"type":"string","example":"120363123456789012@newsletter"},"name":{"type":"string","example":"Canal de Promoções VIP"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/description":{"post":{"operationId":"whatsappNewsletterDescription","summary":"Atualizar descrição do canal","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Atualiza a descrição do canal/newsletter. Espelha POST /newsletter/description do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"120363123456789012"},"jid":{"type":"string","example":"120363123456789012@newsletter"},"description":{"type":"string","example":"Atualizações, ofertas e novidades"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/settings":{"post":{"operationId":"whatsappNewsletterSettings","summary":"Atualizar configurações do canal","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Atualiza configurações do canal/newsletter. Espelha POST /newsletter/settings do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["reactionCodes"],"properties":{"id":{"type":"string","example":"120363123456789012"},"jid":{"type":"string","example":"120363123456789012@newsletter"},"reactionCodes":{"type":"string","example":"basic"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/search":{"post":{"operationId":"whatsappNewsletterSearch","summary":"Pesquisar canais públicos","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `whatsapp:read`. Pesquisa canais/newsletters públicos no diretório do WhatsApp. Espelha POST /newsletter/search do provedor de conexão; campos e respostas seguem essa operação. Somente leitura: não exige Idempotency-Key. Exige instância conectada.","x-required-scopes":["whatsapp:read"],"x-read-only":true,"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"limit":{"type":"integer","example":20},"view":{"type":"string","example":"RECOMMENDED"},"countryCodes":{"type":"array","items":{"type":"string"},"example":["BR"]},"searchText":{"type":"string","example":"promo"},"cursor":{"type":"string","example":"YXJyYXljb25uZWN0aW9uOjE5"},"startCursor":{"type":"string","example":"YXJyYXljb25uZWN0aW9uOjE5"},"start_cursor":{"type":"string","example":"YXJyYXljb25uZWN0aW9uOjE5"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/admin/invite":{"post":{"operationId":"whatsappNewsletterAdminInvite","summary":"Convidar admin do canal","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Convida um telefone para virar administrador do canal. Espelha POST /newsletter/admin/invite do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["phone"],"properties":{"id":{"type":"string","example":"120363123456789012"},"jid":{"type":"string","example":"120363123456789012@newsletter"},"phone":{"type":"string","example":"5511999999999"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/admin/accept":{"post":{"operationId":"whatsappNewsletterAdminAccept","summary":"Aceitar convite de admin do canal","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Aceita um convite pendente de administrador do canal. Espelha POST /newsletter/admin/accept do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"120363123456789012"},"jid":{"type":"string","example":"120363123456789012@newsletter"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/admin/remove":{"post":{"operationId":"whatsappNewsletterAdminRemove","summary":"Remover admin do canal","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Remove um administrador do canal usando o telefone dele. Espelha POST /newsletter/admin/remove do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["phone"],"properties":{"id":{"type":"string","example":"120363123456789012"},"jid":{"type":"string","example":"120363123456789012@newsletter"},"phone":{"type":"string","example":"5511999999999"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/admin/revoke":{"post":{"operationId":"whatsappNewsletterAdminRevoke","summary":"Revogar convite de admin do canal","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Revoga um convite pendente de administrador do canal usando o telefone do convidado. Espelha POST /newsletter/admin/revoke do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["phone"],"properties":{"id":{"type":"string","example":"120363123456789012"},"jid":{"type":"string","example":"120363123456789012@newsletter"},"phone":{"type":"string","example":"5511999999999"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/newsletter/owner/transfer":{"post":{"operationId":"whatsappNewsletterOwnerTransfer","summary":"Transferir dono do canal","tags":["WhatsApp: grupos e canais"],"description":"Escopo obrigatório: `groups:write`. Transfere a propriedade do canal para outro telefone. Espelha POST /newsletter/owner/transfer do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["groups:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["phone"],"properties":{"id":{"type":"string","example":"120363123456789012"},"jid":{"type":"string","example":"120363123456789012@newsletter"},"phone":{"type":"string","example":"5511999999999"},"quitAdmin":{"type":"boolean","example":false}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/agent/edit":{"post":{"operationId":"whatsappAgentEdit","summary":"Criar/Editar Agente","tags":["WhatsApp: automação"],"description":"Escopo obrigatório: `settings:write`. # Documentação dos Campos de Configuração Espelha POST /agent/edit do provedor de conexão; campos e respostas seguem essa operação.","x-required-scopes":["settings:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","example":{"id":"","delete":false,"agent":{"name":"uazabot","provider":"openai","apikey":"sk-proj-HfXFgA","basePrompt":"Seu nome é Sara e você faz parte do time de suporte ao cliente da TechShop...","model":"gpt-4o-mini","maxTokens":2000,"temperature":70,"diversityLevel":50,"frequencyPenalty":30,"presencePenalty":30,"signMessages":true,"readMessages":true,"maxMessageLength":500,"typingDelay_seconds":3,"contextTimeWindow_hours":24,"contextMaxMessages":50,"contextMinMessages":3}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/agent/list":{"get":{"operationId":"whatsappAgentListGet","summary":"Todos os agentes","tags":["WhatsApp: automação"],"description":"Escopo obrigatório: `settings:read`. Espelha GET /agent/list do provedor de conexão; campos e respostas seguem essa operação.","x-required-scopes":["settings:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/trigger/edit":{"post":{"operationId":"whatsappTriggerEdit","summary":"Criar, atualizar ou excluir um trigger do chatbot","tags":["WhatsApp: automação"],"description":"Escopo obrigatório: `settings:write`. Endpoint para gerenciar triggers do chatbot. Suporta: - Criação de novos triggers - Atualização de triggers existentes - Exclusão de triggers por ID Espelha POST /trigger/edit do provedor de conexão; campos e respostas seguem essa operação.","x-required-scopes":["settings:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["trigger"],"properties":{"id":{"type":"string","description":"ID do trigger. Vazio para criação, obrigatório para atualização/exclusão"},"delete":{"type":"boolean","description":"Quando verdadeiro, exclui o trigger especificado pelo id","default":false},"trigger":{"type":"object","required":["type","agent_id"],"properties":{"id":{"type":"string","description":"Identificador único do trigger. Se definido, você irá editar ou deletar o trigger.\nSe vazio, um novo trigger será criado.\n"},"active":{"type":"boolean","default":true,"description":"Define se o trigger está ativo e disponível para uso.\nTriggers inativos não serão executados pelo sistema.\n"},"type":{"type":"string","enum":["agent","quickreply","flow"],"default":"agent","description":"Tipo do trigger:\n* agent - aciona um agente de IA\n* quickreply - aciona respostas rápidas predefinidas\n* flow - dispara um fluxo salvo\n"},"agent_id":{"type":"string","description":"ID do agente de IA. Obrigatório quando type='agent'"},"flow_id":{"type":"string","description":"ID do fluxo. Obrigatório quando type='flow'"},"quickReply_id":{"type":"string","description":"ID da resposta rápida. Obrigatório quando type='quickreply'"},"ignoreGroups":{"type":"boolean","default":true,"description":"Define se o trigger deve ignorar mensagens de grupos"},"lead_field":{"type":"string","enum":["lead_name","lead_fullName","lead_email","lead_personalid","lead_status","lead_tags","lead_notes","lead_isTicketOpen","lead_field01","lead_field02","lead_field03","lead_field04","lead_field05","lead_field06","lead_field07","lead_field08","lead_field09","lead_field10","lead_field11","lead_field12","lead_field13","lead_field14","lead_field15","lead_field16","lead_field17","lead_field18","lead_field19","lead_field20"],"description":"Campo do lead usado para condição do trigger"},"lead_operator":{"type":"string","enum":["equals","not_equals","contains","not_contains","greater","less","empty","not_empty"],"description":"Operador de comparação para condição do lead:\n* equals - igual a\n* not_equals - diferente de\n* contains - contém\n* not_contains - não contém\n* greater - maior que\n* less - menor que\n* empty - vazio\n* not_empty - não vazio\n"},"lead_value":{"type":"string","description":"Valor para comparação com o campo do lead. Usado em conjunto com lead_field e lead_operator"},"priority":{"type":"integer","format":"int64","default":0,"description":"Prioridade do trigger. Quando existem múltiplos triggers que poderiam ser acionados,\nAPENAS o trigger com maior prioridade será executado.\nSe houver múltiplos triggers com a mesma prioridade mais alta, um será escolhido aleatoriamente.\n"},"wordsToStart":{"type":"string","description":"Palavras-chave ou frases que ativam o trigger.\nMúltiplas entradas separadas por pipe (|).\nExemplo: olá|bom dia|qual seu nome\n"},"responseDelay_seconds":{"type":"integer","format":"int64","default":0,"description":"Tempo de espera em segundos antes de executar o trigger"},"owner":{"type":"string","description":"Identificador do proprietário do trigger"},"created":{"type":"string","format":"date-time","description":"Data e hora de criação"},"updated":{"type":"string","format":"date-time","description":"Data e hora da última atualização"}}}}},"example":{"id":"","delete":false,"trigger":{"active":true,"type":"agent","agent_id":"ref2ed7ab21d4ea","ignoreGroups":true,"lead_field":"lead_status","lead_operator":"equals","lead_value":"novo","priority":1,"wordsToStart":"ola|oi|iniciar","responseDelay_seconds":6}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/trigger/list":{"get":{"operationId":"whatsappTriggerListGet","summary":"Listar todos os triggers do chatbot","tags":["WhatsApp: automação"],"description":"Escopo obrigatório: `settings:read`. Retorna a lista completa de triggers configurados para a instância atual Espelha GET /trigger/list do provedor de conexão; campos e respostas seguem essa operação.","x-required-scopes":["settings:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/knowledge/edit":{"post":{"operationId":"whatsappKnowledgeEdit","summary":"Criar/Editar Conhecimento do Agente","tags":["WhatsApp: automação"],"description":"Escopo obrigatório: `settings:write`. Gerencia o conhecimento base usado pelos agentes de IA para responder consultas. O conhecimento pode ser fornecido como texto direto ou através de arquivos PDF/CSV. Espelha POST /knowledge/edit do provedor de conexão; campos e respostas seguem essa operação. Mídia (knowledge.content): envie base64, data URI ou a URL pública de um arquivo no storage Grapnel. Corpo máximo: 4 MiB.","x-required-scopes":["settings:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID do conhecimento (vazio para criar novo)"},"delete":{"type":"boolean","description":"Define se é uma operação de exclusão"},"knowledge":{"type":"object","properties":{"active":{"type":"boolean","description":"Status de ativação do conhecimento"},"tittle":{"type":"string","description":"Título identificador do conhecimento"},"content":{"type":"string","description":"Conteúdo textual, URL ou Base64"}}},"fileType":{"type":"string","enum":["pdf","txt","html","csv"],"description":"Tipo do arquivo quando não detectado automaticamente"}},"example":{"id":"","delete":false,"knowledge":{"active":true,"tittle":"Informações sobre a uazapi","content":"A uazapi foi originalmente desenvolvida..."}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/knowledge/list":{"get":{"operationId":"whatsappKnowledgeListGet","summary":"Listar Base de Conhecimento","tags":["WhatsApp: automação"],"description":"Escopo obrigatório: `settings:read`. Retorna todos os conhecimentos cadastrados para o agente de IA da instância. Estes conhecimentos são utilizados pelo chatbot para responder perguntas e interagir com os usuários de forma contextualizada. Espelha GET /knowledge/list do provedor de conexão; campos e respostas seguem essa operação.","x-required-scopes":["settings:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/function/edit":{"post":{"operationId":"whatsappFunctionEdit","summary":"Criar/Editar função para integração com APIs externas","tags":["WhatsApp: automação"],"description":"Escopo obrigatório: `settings:write`. # Configuração de Funções de API para Agentes IA Espelha POST /function/edit do provedor de conexão; campos e respostas seguem essa operação.","x-required-scopes":["settings:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","delete","function"],"properties":{"id":{"type":"string","description":"ID da função. Vazio para criar nova, preenchido para editar existente."},"delete":{"type":"boolean","description":"Se true, deleta a função especificada pelo ID."},"function":{"type":"object","required":["name","description","method","endpoint"],"properties":{"name":{"type":"string","description":"Nome da função","example":"createProduct"},"active":{"type":"boolean","description":"Status de ativação da função","default":false},"description":{"type":"string","description":"Descrição detalhada da função e seu propósito","example":"Cria um novo produto no catálogo"},"method":{"type":"string","description":"Método HTTP da requisição","enum":["GET","POST","PUT","DELETE","PATCH"],"example":"POST"},"endpoint":{"type":"string","description":"URL do endpoint da API","example":"https://api.example.com/products"},"headers":{"type":"object","description":"Cabeçalhos da requisição. Suporta placeholders no formato {{variavel}}","example":{"Authorization":"Bearer {{apiKey}}","Content-Type":"application/json"}},"body":{"type":"object","description":"Corpo da requisição. Suporta placeholders no formato {{variavel}}","example":{"name":"{{productName}}","price":"{{price}}","category":"{{category}}"}},"parameters":{"type":"array","description":"Lista de parâmetros aceitos pela função","items":{"type":"object","required":["name","type","description"],"properties":{"name":{"type":"string","description":"Nome do parâmetro"},"type":{"type":"string","enum":["string","number","integer","boolean","array","object"],"description":"Tipo do parâmetro"},"description":{"type":"string","description":"Descrição do parâmetro"},"required":{"type":"boolean","description":"Indica se o parâmetro é obrigatório"},"enum":{"type":"string","description":"Lista de valores permitidos para parâmetros do tipo string, separados por vírgula"},"minimum":{"type":"number","description":"Valor mínimo para parâmetros numéricos"},"maximum":{"type":"number","description":"Valor máximo para parâmetros numéricos"}}},"example":[{"name":"apiKey","type":"string","description":"Chave de API para autenticação","required":true},{"name":"price","type":"number","description":"Preço do produto","minimum":0.01,"maximum":999999.99,"required":true}]}}}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/function/list":{"get":{"operationId":"whatsappFunctionListGet","summary":"Lista todas as funções de API","tags":["WhatsApp: automação"],"description":"Escopo obrigatório: `settings:read`. Retorna todas as funções de API configuradas para a instância atual Espelha GET /function/list do provedor de conexão; campos e respostas seguem essa operação.","x-required-scopes":["settings:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/quickreply/edit":{"post":{"operationId":"whatsappQuickreplyEdit","summary":"Criar, atualizar ou excluir resposta rápida","tags":["WhatsApp: automação"],"description":"Escopo obrigatório: `settings:write`. Gerencia templates de respostas rápidas para agilizar o atendimento. Suporta mensagens de texto e mídia. Espelha POST /quickreply/edit do provedor de conexão; campos e respostas seguem essa operação. Mídia (file): envie base64, data URI ou a URL pública de um arquivo no storage Grapnel. Corpo máximo: 4 MiB.","x-required-scopes":["settings:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["shortCut","type"],"properties":{"id":{"type":"string","description":"Necessário para atualizações/exclusões, omitir para criação","example":"rb9da9c03637452"},"delete":{"type":"boolean","description":"Definir como true para excluir o template","default":false},"shortCut":{"type":"string","description":"Atalho para acesso rápido ao template","example":"saudacao1"},"type":{"type":"string","enum":["text","audio","myaudio","ptt","document","video","image"],"description":"Tipo da mensagem"},"text":{"type":"string","description":"Obrigatório para mensagens do tipo texto","example":"Olá! Como posso ajudar hoje?"},"file":{"type":"string","description":"URL ou Base64 para tipos de mídia","example":"https://exemplo.com/arquivo.pdf"},"docName":{"type":"string","description":"Nome do arquivo opcional para tipo documento","example":"apresentacao.pdf"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/quickreply/showall":{"get":{"operationId":"whatsappQuickreplyShowallGet","summary":"Listar todas as respostas rápidas","tags":["WhatsApp: automação"],"description":"Escopo obrigatório: `settings:read`. Retorna todas as respostas rápidas cadastradas para a instância autenticada Espelha GET /quickreply/showall do provedor de conexão; campos e respostas seguem essa operação.","x-required-scopes":["settings:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/chatwoot/config":{"get":{"operationId":"whatsappChatwootConfigGet","summary":"Obter configuração do Chatwoot","tags":["WhatsApp: automação"],"description":"Escopo obrigatório: `settings:read`. Retorna a configuração atual da integração com Chatwoot para a instância. Espelha GET /chatwoot/config do provedor de conexão; campos e respostas seguem essa operação.","x-required-scopes":["settings:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}},"put":{"operationId":"whatsappChatwootConfigPut","summary":"Atualizar configuração do Chatwoot","tags":["WhatsApp: automação"],"description":"Escopo obrigatório: `settings:write`. Atualiza a configuração da integração com Chatwoot para a instância. Espelha PUT /chatwoot/config do provedor de conexão; campos e respostas seguem essa operação.","x-required-scopes":["settings:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Habilitar/desabilitar integração com Chatwoot","example":true},"url":{"type":"string","description":"URL base da instância Chatwoot (sem barra final)","example":"https://app.chatwoot.com"},"access_token":{"type":"string","description":"Token de acesso da API Chatwoot (obtido em Profile Settings > Access Token)","example":"pXXGHHHyJPYHYgWHJHYHgJjj"},"account_id":{"type":"integer","format":"int64","description":"ID da conta no Chatwoot (visível na URL da conta)","example":1},"inbox_id":{"type":"integer","format":"int64","description":"ID da inbox no Chatwoot (obtido nas configurações da inbox)","example":5},"ignore_groups":{"type":"boolean","description":"Ignorar mensagens de grupos do WhatsApp na sincronização","example":false},"sign_messages":{"type":"boolean","description":"Assinar mensagens enviadas para WhatsApp com identificação do agente","example":true},"create_new_conversation":{"type":"boolean","description":"Sempre criar nova conversa ao invés de reutilizar conversas existentes","example":false}},"required":["enabled","url","access_token","account_id","inbox_id"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/sender/simple":{"post":{"operationId":"whatsappSenderSimple","summary":"Criar nova campanha (Simples)","tags":["WhatsApp: campanhas"],"description":"Escopo obrigatório: `campaigns:write`. Cria uma nova campanha de envio com configurações básicas Espelha POST /sender/simple do provedor de conexão; campos e respostas seguem essa operação. Mídia (linkPreviewImage, file, imageButton): envie base64, data URI ou a URL pública de um arquivo no storage Grapnel. Corpo máximo: 4 MiB. Exige instância conectada.","x-required-scopes":["campaigns:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["numbers","type","delayMin","delayMax","scheduled_for"],"properties":{"numbers":{"type":"array","description":"Lista de números para envio","items":{"type":"string"},"example":["5511999999999@s.whatsapp.net"]},"type":{"type":"string","description":"Tipo da mensagem","enum":["text","image","video","audio","document","contact","location","list","button","poll","carousel"]},"folder":{"type":"string","description":"Nome da campanha de envio","example":"Campanha Janeiro"},"delayMin":{"type":"integer","description":"Delay mínimo entre mensagens em segundos","minimum":1,"example":10},"delayMax":{"type":"integer","description":"Delay máximo entre mensagens em segundos","minimum":1,"example":30},"scheduled_for":{"type":"integer","description":"Timestamp em milissegundos ou minutos a partir de agora para agendamento","example":1706198400000},"info":{"type":"string","description":"Informações adicionais sobre a campanha"},"delay":{"type":"integer","description":"Delay fixo entre mensagens (opcional)"},"mentions":{"type":"string","description":"Menções na mensagem em formato JSON"},"text":{"type":"string","description":"Texto da mensagem"},"linkPreview":{"type":"boolean","description":"Habilitar preview de links em mensagens de texto. O preview será gerado automaticamente a partir da URL contida no texto."},"linkPreviewTitle":{"type":"string","description":"Título personalizado para o preview do link (opcional)"},"linkPreviewDescription":{"type":"string","description":"Descrição personalizada para o preview do link (opcional)"},"linkPreviewImage":{"type":"string","description":"URL ou dados base64 da imagem para o preview do link (opcional)"},"linkPreviewLarge":{"type":"boolean","description":"Se deve usar preview grande ou pequeno (opcional, padrão false)"},"file":{"type":"string","description":"URL da mídia ou arquivo (quando type é image, video, audio, document, etc.)"},"docName":{"type":"string","description":"Nome do arquivo (quando type é document)"},"fullName":{"type":"string","description":"Nome completo (quando type é contact)"},"phoneNumber":{"type":"string","description":"Número do telefone (quando type é contact)"},"organization":{"type":"string","description":"Organização (quando type é contact)"},"email":{"type":"string","description":"Email (quando type é contact)"},"url":{"type":"string","description":"URL (quando type é contact)"},"latitude":{"type":"number","description":"Latitude (quando type é location)"},"longitude":{"type":"number","description":"Longitude (quando type é location)"},"name":{"type":"string","description":"Nome do local (quando type é location)"},"address":{"type":"string","description":"Endereço (quando type é location)"},"footerText":{"type":"string","description":"Texto do rodapé (quando type é list, button, poll ou carousel)"},"buttonText":{"type":"string","description":"Texto do botão (quando type é list, button, poll ou carousel)"},"listButton":{"type":"string","description":"Texto do botão da lista (quando type é list)"},"selectableCount":{"type":"integer","description":"Quantidade de opções selecionáveis (quando type é poll)"},"choices":{"type":"array","items":{"type":"string"},"description":"Lista de opções (quando type é list, button, poll ou carousel). Para carousel, use formato específico com [texto], {imagem} e botões"},"imageButton":{"type":"string","description":"URL da imagem para o botão (quando type é button)"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/sender/advanced":{"post":{"operationId":"whatsappSenderAdvanced","summary":"Criar envio em massa avançado","tags":["WhatsApp: campanhas"],"description":"Escopo obrigatório: `campaigns:write`. Cria um novo envio em massa com configurações avançadas, permitindo definir múltiplos destinatários e mensagens com delays personalizados. Espelha POST /sender/advanced do provedor de conexão; campos e respostas seguem essa operação. Mídia (messages[].file, messages[].linkPreviewImage, messages[].imageButton): envie base64, data URI ou a URL pública de um arquivo no storage Grapnel. Corpo máximo: 4 MiB. Exige instância conectada.","x-required-scopes":["campaigns:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"delayMin":{"type":"integer","description":"Delay mínimo entre mensagens (segundos)","minimum":0,"example":3},"delayMax":{"type":"integer","description":"Delay máximo entre mensagens (segundos)","minimum":0,"example":6},"info":{"type":"string","description":"Descrição ou informação sobre o envio em massa","example":"Campanha de lançamento"},"scheduled_for":{"type":"integer","description":"Timestamp em milissegundos (date unix) ou minutos a partir de agora para agendamento","example":1},"messages":{"type":"array","description":"Lista de mensagens a serem enviadas","items":{"type":"object","required":["number","type"],"properties":{"number":{"type":"string","description":"ID do chat ou número do destinatário.","example":"5511999999999"},"type":{"type":"string","enum":["text","image","document","audio","ptt","myaudio","sticker","video","contact","location","poll","list","button","carousel"],"description":"Tipo da mensagem:\n- text: Mensagem de texto\n- image: Imagem\n- document: Documento/arquivo\n- audio: Áudio\n- ptt: Mensagem de voz\n- myaudio: Áudio (opção alternativa)\n- sticker: Figurinha\n- video: Vídeo\n- contact: Contato\n- location: Localização\n- poll: Enquete\n- list: Lista de opções\n- button: Botões interativos\n- carousel: Carrossel de cartões com imagens e botões\n"},"text":{"type":"string","description":"Texto da mensagem (quando type é \"text\") ou legenda para mídia"},"file":{"type":"string","description":"URL da mídia (quando type é image, video, audio, document, etc)"},"docName":{"type":"string","description":"Nome do arquivo (quando type é document)"},"linkPreview":{"type":"boolean","description":"Se deve gerar preview de links (quando type é text). O preview será gerado automaticamente a partir da URL contida no texto."},"linkPreviewTitle":{"type":"string","description":"Título personalizado para o preview do link (opcional)"},"linkPreviewDescription":{"type":"string","description":"Descrição personalizada para o preview do link (opcional)"},"linkPreviewImage":{"type":"string","description":"URL ou dados base64 da imagem para o preview do link (opcional)"},"linkPreviewLarge":{"type":"boolean","description":"Se deve usar preview grande ou pequeno (opcional, padrão false)"},"fullName":{"type":"string","description":"Nome completo (quando type é contact)"},"phoneNumber":{"type":"string","description":"Número do telefone (quando type é contact)"},"organization":{"type":"string","description":"Organização (quando type é contact)"},"email":{"type":"string","description":"Email (quando type é contact)"},"url":{"type":"string","description":"URL (quando type é contact)"},"latitude":{"type":"number","description":"Latitude (quando type é location)"},"longitude":{"type":"number","description":"Longitude (quando type é location)"},"name":{"type":"string","description":"Nome do local (quando type é location)"},"address":{"type":"string","description":"Endereço (quando type é location)"},"footerText":{"type":"string","description":"Texto do rodapé (quando type é list, button, poll ou carousel)"},"buttonText":{"type":"string","description":"Texto do botão (quando type é list, button, poll ou carousel)"},"listButton":{"type":"string","description":"Texto do botão da lista (quando type é list)"},"selectableCount":{"type":"integer","description":"Quantidade de opções selecionáveis (quando type é poll)"},"choices":{"type":"array","items":{"type":"string"},"description":"Lista de opções (quando type é list, button, poll ou carousel). Para carousel, use formato específico com [texto], {imagem} e botões"},"imageButton":{"type":"string","description":"URL da imagem para o botão (quando type é button)"}}}}},"required":["messages"],"example":{"delayMin":3,"delayMax":6,"info":"teste avançado","scheduled_for":1,"messages":[{"number":"5511999999999","type":"text","text":"First message"},{"number":"5511999999999","type":"button","text":"Promoção Especial!\nConfira nossas ofertas incríveis","footerText":"Válido até 31/12/2024","imageButton":"https://exemplo.com/banner-promocao.jpg","choices":["Ver Ofertas|https://loja.exemplo.com/ofertas","Falar com Vendedor|reply:vendedor","Copiar Cupom|copy:PROMO2024"]},{"number":"5511999999999","type":"list","text":"Escolha sua categoria preferida:","listButton":"Ver Categorias","choices":["[Eletrônicos]","Smartphones|eletronicos_smartphones","Notebooks|eletronicos_notebooks","[Roupas]","Camisetas|roupas_camisetas","Sapatos|roupas_sapatos"]},{"number":"5511999999999","type":"document","file":"https://example.com/doc.pdf","docName":"Documento.pdf"},{"number":"5511999999999","type":"carousel","text":"Conheça nossos produtos","choices":["[Smartphone XYZ\nO mais avançado smartphone da linha]","{https://exemplo.com/produto1.jpg}","Copiar Código|copy:PROD123","Ver no Site|https://exemplo.com/xyz","[Notebook ABC\nO notebook ideal para profissionais]","{https://exemplo.com/produto2.jpg}","Copiar Código|copy:NOTE456","Comprar Online|https://exemplo.com/abc"]}]}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/sender/edit":{"post":{"operationId":"whatsappSenderEdit","summary":"Controlar campanha de envio em massa","tags":["WhatsApp: campanhas"],"description":"Escopo obrigatório: `campaigns:write`. Permite controlar campanhas de envio de mensagens em massa através de diferentes ações: Espelha POST /sender/edit do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["campaigns:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"folder_id":{"type":"string","description":"Identificador único da campanha de envio","example":"folder_123"},"action":{"type":"string","enum":["stop","continue","delete"],"description":"Ação a ser executada na campanha:\n- **stop**: Pausa a campanha (muda para status \"paused\")\n- **continue**: Retoma campanha pausada (muda para status \"scheduled\") \n- **delete**: Remove campanha e mensagens não enviadas (assíncrono)\n","example":"stop"}},"required":["folder_id","action"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/sender/cleardone":{"post":{"operationId":"whatsappSenderCleardone","summary":"Limpar mensagens enviadas","tags":["WhatsApp: campanhas"],"description":"Escopo obrigatório: `campaigns:write`. Inicia processo de limpeza de mensagens antigas em lote que já foram enviadas com sucesso. Por padrão, remove mensagens mais antigas que 7 dias. Espelha POST /sender/cleardone do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["campaigns:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"hours":{"type":"integer","description":"Quantidade de horas para manter mensagens. Mensagens mais antigas que esse valor serão removidas.","example":168,"default":168}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/sender/clearall":{"delete":{"operationId":"whatsappSenderClearallDelete","summary":"Limpar toda fila de mensagens","tags":["WhatsApp: campanhas"],"description":"Escopo obrigatório: `campaigns:write`. Remove todas as mensagens da fila de envio em massa, incluindo mensagens pendentes e já enviadas. Esta é uma operação irreversível. Espelha DELETE /sender/clearall do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["campaigns:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/sender/listfolders":{"get":{"operationId":"whatsappSenderListfoldersGet","summary":"Listar campanhas de envio","tags":["WhatsApp: campanhas"],"description":"Escopo obrigatório: `whatsapp:read`. Retorna as campanhas de envio em massa da instância atual, ordenadas das mais recentes para as mais antigas. Espelha GET /sender/listfolders do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["whatsapp:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["Active","Archived"]},"description":"Filtro de status desejado. O backend atual retorna todas as pastas do owner e pode ignorar esse parâmetro dependendo da implementação da fila."}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/sender/listmessages":{"post":{"operationId":"whatsappSenderListmessages","summary":"Listar mensagens de uma campanha","tags":["WhatsApp: campanhas"],"description":"Escopo obrigatório: `whatsapp:read`. Retorna a lista de mensagens de uma campanha específica, com opções de filtro por status e paginação Espelha POST /sender/listmessages do provedor de conexão; campos e respostas seguem essa operação. Somente leitura: não exige Idempotency-Key. Exige instância conectada.","x-required-scopes":["whatsapp:read"],"x-read-only":true,"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"folder_id":{"type":"string","description":"ID da campanha a ser consultada"},"messageStatus":{"type":"string","enum":["Scheduled","Sent","Failed"],"description":"Status das mensagens para filtrar"},"page":{"type":"integer","minimum":1,"default":1,"description":"Número da página para paginação"},"pageSize":{"type":"integer","minimum":1,"maximum":1000,"default":1000,"description":"Quantidade de itens por página"}},"required":["folder_id"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/chat/find":{"post":{"operationId":"whatsappChatFind","summary":"Busca chats com filtros","tags":["WhatsApp: conversas e contatos"],"description":"Escopo obrigatório: `chats:read`. Busca chats com diversos filtros e ordenação. Suporta filtros em todos os campos do chat, paginação e ordenação customizada. Espelha POST /chat/find do provedor de conexão; campos e respostas seguem essa operação. Somente leitura: não exige Idempotency-Key. Exige instância conectada.","x-required-scopes":["chats:read"],"x-read-only":true,"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"operator":{"type":"string","enum":["AND","OR"],"default":"AND","description":"Operador lógico entre os filtros"},"sort":{"type":"string","description":"Campo para ordenação (+/-campo). Ex -wa_lastMsgTimestamp"},"limit":{"type":"integer","description":"Quantidade máxima de resultados a retornar","default":20},"offset":{"type":"integer","description":"Número de registros a pular (para paginação)","default":0},"wa_fastid":{"type":"string"},"wa_chatid":{"type":"string"},"wa_archived":{"type":"boolean"},"wa_contactName":{"type":"string"},"wa_name":{"type":"string"},"name":{"type":"string"},"wa_isBlocked":{"type":"boolean"},"wa_isGroup":{"type":"boolean"},"wa_isGroup_admin":{"type":"boolean"},"wa_isGroup_announce":{"type":"boolean"},"wa_isGroup_member":{"type":"boolean"},"wa_isPinned":{"type":"boolean"},"wa_label":{"type":"string"},"lead_tags":{"type":"string"},"lead_isTicketOpen":{"type":"boolean"},"lead_assignedAttendant_id":{"type":"string"},"lead_status":{"type":"string"}},"example":{"operator":"AND","sort":"-wa_lastMsgTimestamp","limit":50,"offset":0,"wa_isGroup":true,"lead_status":"~novo","wa_label":"~importante"}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/chat/details":{"post":{"operationId":"whatsappChatDetails","summary":"Obter Detalhes Completos","tags":["WhatsApp: conversas e contatos"],"description":"Escopo obrigatório: `chats:read`. Retorna informações **completas** sobre um contato ou chat, incluindo **todos os campos disponíveis** do modelo Chat. Espelha POST /chat/details do provedor de conexão; campos e respostas seguem essa operação. Somente leitura: não exige Idempotency-Key. Exige instância conectada.","x-required-scopes":["chats:read"],"x-read-only":true,"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","description":"Número do telefone ou ID do grupo","example":"5511999999999"},"preview":{"type":"boolean","description":"Controla o tamanho da imagem de perfil retornada:\n- `true`: Retorna imagem em tamanho preview (menor, otimizada para listagens)\n- `false` (padrão): Retorna imagem em tamanho full (resolução original, maior qualidade)\n","default":false}},"required":["number"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/chat/check":{"post":{"operationId":"whatsappChatCheck","summary":"Verificar Números no WhatsApp","tags":["WhatsApp: conversas e contatos"],"description":"Escopo obrigatório: `whatsapp:read`. Verifica se números fornecidos estão registrados no WhatsApp e retorna informações detalhadas. Espelha POST /chat/check do provedor de conexão; campos e respostas seguem essa operação. Somente leitura: não exige Idempotency-Key. Exige instância conectada.","x-required-scopes":["whatsapp:read"],"x-read-only":true,"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"numbers":{"type":"array","items":{"type":"string"},"description":"Lista de números ou IDs de grupo para verificar","example":["5511999999999","123456789@g.us"]}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/chat/delete":{"post":{"operationId":"whatsappChatDelete","summary":"Deleta chat","tags":["WhatsApp: conversas e contatos"],"description":"Escopo obrigatório: `chats:write`. Deleta ou limpa um chat e/ou suas mensagens do WhatsApp e/ou banco de dados. Você pode escolher: - Deletar o chat do WhatsApp - Limpar a conversa no WhatsApp - Deletar o chat do banco de dados - Deletar apenas as mensagens do banco de dados - Qualquer combinação das opções acima Observação: - Se clearChatWhatsApp e deleteChatWhatsApp forem true, o clear tem prioridade. Espelha POST /chat/delete do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["chats:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","description":"Número do chat no formato internacional.\nPara grupos use o ID completo do grupo.\n","example":"5511999999999"},"deleteChatDB":{"type":"boolean","description":"Se true, deleta o chat do banco de dados","default":false,"example":true},"deleteMessagesDB":{"type":"boolean","description":"Se true, deleta todas as mensagens do chat do banco de dados","default":false,"example":true},"deleteChatWhatsApp":{"type":"boolean","description":"Se true, deleta o chat do WhatsApp.\nPara grupos, esta operação não é permitida e o chat será apenas limpo.\n","default":false,"example":true},"clearChatWhatsApp":{"type":"boolean","description":"Se true, limpa a conversa do chat no WhatsApp (sem sair do chat).\nFunciona para grupos e conversas individuais.\n","default":false,"example":true}},"required":["number"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/chat/archive":{"post":{"operationId":"whatsappChatArchive","summary":"Arquivar/desarquivar chat","tags":["WhatsApp: conversas e contatos"],"description":"Escopo obrigatório: `chats:write`. Altera o estado de arquivamento de um chat do WhatsApp. - Quando arquivado, o chat é movido para a seção de arquivados no WhatsApp - A ação é sincronizada entre todos os dispositivos conectados - Não afeta as mensagens ou o conteúdo do chat Espelha POST /chat/archive do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["chats:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["number","archive"],"properties":{"number":{"type":"string","description":"Número do telefone (formato E.164) ou ID do grupo","example":"5511999999999"},"archive":{"type":"boolean","description":"true para arquivar, false para desarquivar","example":true}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/chat/read":{"post":{"operationId":"whatsappChatRead","summary":"Marcar chat como lido/não lido","tags":["WhatsApp: conversas e contatos"],"description":"Escopo obrigatório: `chats:write`. Atualiza o status de leitura de um chat no WhatsApp. Espelha POST /chat/read do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["chats:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["number","read"],"properties":{"number":{"type":"string","description":"Identificador do chat no formato:\n- Para usuários: [número]@s.whatsapp.net (ex: 5511999999999@s.whatsapp.net)\n- Para grupos: [id-grupo]@g.us (ex: 123456789-987654321@g.us)\n","example":"5511999999999@s.whatsapp.net"},"read":{"type":"boolean","description":"- true: marca o chat como lido\n- false: marca o chat como não lido\n"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/chat/mute":{"post":{"operationId":"whatsappChatMute","summary":"Silenciar chat","tags":["WhatsApp: conversas e contatos"],"description":"Escopo obrigatório: `chats:write`. Silencia notificações de um chat por um período específico. As opções de silenciamento são: * 0 - Remove o silenciamento * 8 - Silencia por 8 horas * 168 - Silencia por 1 semana (168 horas) * -1 - Silencia permanentemente Espelha POST /chat/mute do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["chats:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["number","muteEndTime"],"properties":{"number":{"type":"string","description":"ID do chat no formato 123456789@s.whatsapp.net ou 123456789-123456@g.us","example":"5511999999999@s.whatsapp.net"},"muteEndTime":{"type":"integer","description":"Duração do silenciamento:\n* 0 = Remove silenciamento\n* 8 = Silencia por 8 horas\n* 168 = Silencia por 1 semana\n* -1 = Silencia permanentemente\n","enum":[0,8,168,-1],"example":8}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/chat/pin":{"post":{"operationId":"whatsappChatPin","summary":"Fixar/desafixar chat","tags":["WhatsApp: conversas e contatos"],"description":"Escopo obrigatório: `chats:write`. Fixa ou desafixa um chat no topo da lista de conversas. Chats fixados permanecem no topo mesmo quando novas mensagens são recebidas em outros chats. Espelha POST /chat/pin do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["chats:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","description":"Número do chat no formato internacional completo (ex: \"5511999999999\") \nou ID do grupo (ex: \"123456789-123456@g.us\")\n","example":"5511999999999"},"pin":{"type":"boolean","description":"Define se o chat deve ser fixado (true) ou desafixado (false)\n","example":true}},"required":["number","pin"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/chat/edit-lead":{"post":{"operationId":"whatsappChatEditLead","summary":"Edita informações de lead","tags":["WhatsApp: automação"],"description":"Escopo obrigatório: `chats:write`. Atualiza as informações de lead associadas a um chat. Permite modificar status do ticket, atribuição de atendente, posição no kanban, tags e outros campos customizados. Espelha POST /chat/editLead do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["chats:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string","description":"Identificador do chat. Pode ser:\n- wa_chatid (ex: \"5511999999999@s.whatsapp.net\")\n- wa_fastid (ex: \"5511888888888:5511999999999\")\n","example":"5511999999999@s.whatsapp.net"},"chatbot_disableUntil":{"type":"integer","format":"int64","description":"Timestamp UTC até quando o chatbot deve ficar desativado para este chat.\nUse 0 para reativar imediatamente.\n","example":1735686000},"lead_isTicketOpen":{"type":"boolean","description":"Status do ticket associado ao lead.\n- true: Ticket está aberto/em atendimento\n- false: Ticket está fechado/resolvido\n","example":true},"lead_assignedAttendant_id":{"type":"string","description":"ID do atendente atribuído ao lead.\nUse string vazia (\"\") para remover a atribuição.\n","example":"att_123456"},"lead_kanbanOrder":{"type":"integer","format":"int64","description":"Posição do card no quadro kanban.\nValores maiores aparecem primeiro.\n","example":1000},"lead_tags":{"type":"array","items":{"type":"string"},"description":"Lista de tags associadas ao lead.\nTags inexistentes são criadas automaticamente.\nEnvie array vazio ([]) para remover todas as tags.\n","example":["vip","suporte","prioridade-alta"]},"lead_name":{"type":"string","description":"Nome principal do lead","example":"João Silva"},"lead_fullName":{"type":"string","description":"Nome completo do lead","example":"João Silva Pereira"},"lead_email":{"type":"string","format":"email","description":"Email do lead","example":"joao@exemplo.com"},"lead_personalid":{"type":"string","description":"Documento de identificação (CPF/CNPJ)\nApenas números ou formatado\n","example":"123.456.789-00"},"lead_status":{"type":"string","description":"Status do lead no funil de vendas","example":"qualificado"},"lead_notes":{"type":"string","description":"Anotações sobre o lead","example":"Cliente interessado em plano premium"},"lead_field01":{"type":"string","description":"Campo personalizado 1"},"lead_field02":{"type":"string","description":"Campo personalizado 2"},"lead_field03":{"type":"string","description":"Campo personalizado 3"},"lead_field04":{"type":"string","description":"Campo personalizado 4"},"lead_field05":{"type":"string","description":"Campo personalizado 5"},"lead_field06":{"type":"string","description":"Campo personalizado 6"},"lead_field07":{"type":"string","description":"Campo personalizado 7"},"lead_field08":{"type":"string","description":"Campo personalizado 8"},"lead_field09":{"type":"string","description":"Campo personalizado 9"},"lead_field10":{"type":"string","description":"Campo personalizado 10"},"lead_field11":{"type":"string","description":"Campo personalizado 11"},"lead_field12":{"type":"string","description":"Campo personalizado 12"},"lead_field13":{"type":"string","description":"Campo personalizado 13"},"lead_field14":{"type":"string","description":"Campo personalizado 14"},"lead_field15":{"type":"string","description":"Campo personalizado 15"},"lead_field16":{"type":"string","description":"Campo personalizado 16"},"lead_field17":{"type":"string","description":"Campo personalizado 17"},"lead_field18":{"type":"string","description":"Campo personalizado 18"},"lead_field19":{"type":"string","description":"Campo personalizado 19"},"lead_field20":{"type":"string","description":"Campo personalizado 20"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/chat/labels":{"post":{"operationId":"whatsappChatLabels","summary":"Gerencia labels de um chat","tags":["WhatsApp: conversas e contatos"],"description":"Escopo obrigatório: `chats:write`. Atualiza as labels associadas a um chat específico. Este endpoint oferece três modos de operação: Espelha POST /chat/labels do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["chats:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","description":"Número do chat ou grupo","example":"5511999999999"},"labelids":{"type":"array","items":{"type":"string"},"description":"Lista de IDs das labels a serem aplicadas ao chat (define todas as labels)","example":["10","20"]},"add_labelid":{"type":"string","description":"ID da label a ser adicionada ao chat","example":"10"},"remove_labelid":{"type":"string","description":"ID da label a ser removida do chat","example":"20"}},"required":["number"],"oneOf":[{"required":["labelids"]},{"required":["add_labelid"]},{"required":["remove_labelid"]}]},"example":{"number":"5511999999999","labelids":["10","20","30"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/chat/block":{"post":{"operationId":"whatsappChatBlock","summary":"Bloqueia ou desbloqueia contato do WhatsApp","tags":["WhatsApp: conversas e contatos"],"description":"Escopo obrigatório: `chats:write`. Bloqueia ou desbloqueia um contato do WhatsApp. Contatos bloqueados não podem enviar mensagens para a instância e a instância não pode enviar mensagens para eles. Espelha POST /chat/block do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["chats:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","description":"Número do WhatsApp no formato internacional (ex. 5511999999999)","example":"5511999999999"},"block":{"type":"boolean","description":"True para bloquear, False para desbloquear","example":true}},"required":["number","block"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/chat/blocklist":{"get":{"operationId":"whatsappChatBlocklistGet","summary":"Lista contatos bloqueados","tags":["WhatsApp: conversas e contatos"],"description":"Escopo obrigatório: `chats:read`. Retorna a lista completa de contatos que foram bloqueados pela instância. Esta lista é atualizada em tempo real conforme contatos são bloqueados/desbloqueados. Espelha GET /chat/blocklist do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["chats:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/label/edit":{"post":{"operationId":"whatsappLabelEdit","summary":"Editar etiqueta","tags":["WhatsApp: conversas e contatos"],"description":"Escopo obrigatório: `chats:write`. Edita uma etiqueta existente na instância. Permite alterar nome, cor ou deletar a etiqueta. Espelha POST /label/edit do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["chats:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"labelid":{"type":"string","description":"ID da etiqueta a ser editada","example":"25"},"name":{"type":"string","description":"Novo nome da etiqueta","example":"responder editado"},"color":{"type":"integer","description":"Código numérico da nova cor (0-19)","minimum":0,"maximum":19,"example":2},"delete":{"type":"boolean","description":"Indica se a etiqueta deve ser deletada","example":false}},"required":["labelid"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/labels":{"get":{"operationId":"whatsappLabelsGet","summary":"Buscar todas as etiquetas","tags":["WhatsApp: conversas e contatos"],"description":"Escopo obrigatório: `chats:read`. Retorna a lista completa de etiquetas da instância. Espelha GET /labels do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["chats:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/contacts":{"get":{"operationId":"whatsappContactsGet","summary":"Retorna lista de contatos do WhatsApp","tags":["WhatsApp: conversas e contatos"],"description":"Escopo obrigatório: `chats:read`. Retorna a lista de contatos salvos na agenda do celular e que estão no WhatsApp. Espelha GET /contacts do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["chats:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/contacts/list":{"post":{"operationId":"whatsappContactsList","summary":"Listar todos os contatos com paginacao","tags":["WhatsApp: conversas e contatos"],"description":"Escopo obrigatório: `chats:read`. Retorna uma lista paginada de contatos da instancia do WhatsApp. Use este endpoint (POST) para controlar pagina, tamanho e offset via corpo da requisicao. A rota GET `/contacts` continua disponivel para quem prefere a lista completa sem paginacao. Espelha POST /contacts/list do provedor de conexão; campos e respostas seguem essa operação. Somente leitura: não exige Idempotency-Key. Exige instância conectada.","x-required-scopes":["chats:read"],"x-read-only":true,"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"page":{"type":"integer","description":"Numero da pagina para paginacao (padrao 1)","default":1},"pageSize":{"type":"integer","description":"Quantidade de resultados por pagina (padrao 100, maximo 1000)","default":100},"limit":{"type":"integer","description":"Alias opcional para `pageSize`"},"offset":{"type":"integer","description":"Deslocamento base zero para paginacao; se informado recalcula a pagina","default":0}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/contact/add":{"post":{"operationId":"whatsappContactAdd","summary":"Adiciona um contato à agenda","tags":["WhatsApp: conversas e contatos"],"description":"Escopo obrigatório: `chats:write`. Adiciona um novo contato à agenda do celular. Espelha POST /contact/add do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["chats:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["phone","name"],"properties":{"phone":{"type":"string","description":"Número de telefone no formato internacional com código do país obrigatório. \nPara Brasil, deve começar com 55. Aceita variações com/sem símbolo +, \ncom/sem parênteses, com/sem hífen e com/sem espaços. Também aceita formato \nJID do WhatsApp (@s.whatsapp.net). Não aceita contatos comerciais (@lid) \nnem grupos (@g.us).\n","examples":["+55 (21) 99999-9999","+55 21 99999-9999","+55 21 999999999","+5521999999999","5521999999999","5521999999999@s.whatsapp.net"]},"name":{"type":"string","description":"Nome completo do contato (será usado como primeiro nome e nome completo)","example":"João Silva"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/contact/remove":{"post":{"operationId":"whatsappContactRemove","summary":"Remove um contato da agenda","tags":["WhatsApp: conversas e contatos"],"description":"Escopo obrigatório: `chats:write`. Remove um contato da agenda do celular. Espelha POST /contact/remove do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["chats:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["phone"],"properties":{"phone":{"type":"string","description":"Número de telefone no formato internacional com código do país obrigatório. \nPara Brasil, deve começar com 55. Aceita variações com/sem símbolo +, \ncom/sem parênteses, com/sem hífen e com/sem espaços. Também aceita formato \nJID do WhatsApp (@s.whatsapp.net). Não aceita contatos comerciais (@lid) \nnem grupos (@g.us).\n","examples":["+55 (21) 99999-9999","+55 21 99999-9999","+55 21 999999999","+5521999999999","5521999999999","5521999999999@s.whatsapp.net"]}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/call/make":{"post":{"operationId":"whatsappCallMake","summary":"Iniciar chamada de voz","tags":["WhatsApp: mensagens"],"description":"Escopo obrigatório: `whatsapp:write`. Inicia uma chamada de voz para um contato específico. Este endpoint permite: 1. Iniciar chamadas de voz para contatos 2. Funciona apenas com números válidos do WhatsApp 3. O contato receberá uma chamada de voz Espelha POST /call/make do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","description":"Número do contato no formato internacional (ex: 5511999999999)","example":"5511999999999"},"call_duration":{"type":"integer","description":"Duração da chamada em segundos (opcional). Após esse tempo a chamada é encerrada automaticamente.","example":15}},"required":["number"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/call/reject":{"post":{"operationId":"whatsappCallReject","summary":"Rejeitar chamada recebida","tags":["WhatsApp: mensagens"],"description":"Escopo obrigatório: `whatsapp:write`. Rejeita uma chamada recebida do WhatsApp. Espelha POST /call/reject do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["whatsapp:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","example":{},"properties":{"number":{"type":"string","description":"(Opcional) Número do contato no formato internacional (ex: 5511999999999)"},"id":{"type":"string","description":"(Opcional) ID único da chamada a ser rejeitada"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/business/get/profile":{"post":{"operationId":"whatsappBusinessGetProfile","summary":"Obter o perfil comercial","tags":["WhatsApp: perfil e configurações"],"description":"Escopo obrigatório: `whatsapp:read`. Retorna o perfil comercial da instância do WhatsApp. Espelha POST /business/get/profile do provedor de conexão; campos e respostas seguem essa operação. Somente leitura: não exige Idempotency-Key. Exige instância conectada.","x-required-scopes":["whatsapp:read"],"x-read-only":true,"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"jid":{"type":"string","description":"JID do perfil comercial a consultar","example":"5511999999999@s.whatsapp.net"}}}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/business/get/categories":{"get":{"operationId":"whatsappBusinessGetCategoriesGet","summary":"Obter as categorias de negócios","tags":["WhatsApp: perfil e configurações"],"description":"Escopo obrigatório: `whatsapp:read`. Retorna as categorias de negócios disponíveis. Espelha GET /business/get/categories do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["whatsapp:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/business/update/profile":{"post":{"operationId":"whatsappBusinessUpdateProfile","summary":"Atualizar o perfil comercial","tags":["WhatsApp: perfil e configurações"],"description":"Escopo obrigatório: `settings:write`. Atualiza os dados do perfil comercial da instância do WhatsApp. Todos os campos são opcionais; apenas os enviados serão atualizados. Espelha POST /business/update/profile do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["settings:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","description":"Nova descrição do perfil comercial.","example":"Loja de eletrônicos e acessórios"},"address":{"type":"string","description":"Novo endereço do perfil comercial.","example":"Rua das Flores, 123 - Centro"},"email":{"type":"string","description":"Novo email do perfil comercial.","example":"contato@empresa.com"}}},"example":{"description":"Loja de eletrônicos e acessórios","address":"Rua das Flores, 123 - Centro","email":"contato@empresa.com"}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/business/catalog/list":{"post":{"operationId":"whatsappBusinessCatalogList","summary":"Listar os produtos do catálogo","tags":["WhatsApp: perfil e configurações"],"description":"Escopo obrigatório: `whatsapp:read`. Lista uma página de produtos do catálogo de um perfil comercial no WhatsApp. Espelha POST /business/catalog/list do provedor de conexão; campos e respostas seguem essa operação. Somente leitura: não exige Idempotency-Key. Exige instância conectada.","x-required-scopes":["whatsapp:read"],"x-read-only":true,"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"jid":{"type":"string","description":"JID do catálogo a consultar","example":"5511999999999@s.whatsapp.net"},"cursor":{"type":"string","description":"Cursor da próxima página. Use o valor retornado em `response.Paging.After`.","example":"Q1VSU09SX1BST1hJTUFfUEFHSU5B"},"after":{"type":"string","deprecated":true,"description":"Alias de compatibilidade para `cursor`.","example":"Q1VSU09SX1BST1hJTUFfUEFHSU5B"}},"required":["jid"]},"example":{"jid":"5511999999999@s.whatsapp.net"}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/business/catalog/info":{"post":{"operationId":"whatsappBusinessCatalogInfo","summary":"Obter informações de um produto do catálogo","tags":["WhatsApp: perfil e configurações"],"description":"Escopo obrigatório: `whatsapp:read`. Retorna as informações de um produto específico do catálogo. Espelha POST /business/catalog/info do provedor de conexão; campos e respostas seguem essa operação. Somente leitura: não exige Idempotency-Key. Exige instância conectada.","x-required-scopes":["whatsapp:read"],"x-read-only":true,"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"jid":{"type":"string","description":"JID do catálogo a consultar","example":"5511999999999@s.whatsapp.net"},"id":{"type":"string","description":"O ID do produto."}},"required":["jid","id"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/business/catalog/delete":{"post":{"operationId":"whatsappBusinessCatalogDelete","summary":"Deletar um produto do catálogo","tags":["WhatsApp: perfil e configurações"],"description":"Escopo obrigatório: `settings:write`. Deleta um produto específico do catálogo. Espelha POST /business/catalog/delete do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["settings:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"O ID do produto."}},"required":["id"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/business/catalog/show":{"post":{"operationId":"whatsappBusinessCatalogShow","summary":"Mostrar um produto do catálogo","tags":["WhatsApp: perfil e configurações"],"description":"Escopo obrigatório: `settings:write`. Mostra um produto específico do catálogo. Espelha POST /business/catalog/show do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["settings:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"O ID do produto."}},"required":["id"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}},"/instances/{id}/whatsapp/business/catalog/hide":{"post":{"operationId":"whatsappBusinessCatalogHide","summary":"Ocultar um produto do catálogo","tags":["WhatsApp: perfil e configurações"],"description":"Escopo obrigatório: `settings:write`. Oculta um produto específico do catálogo. Espelha POST /business/catalog/hide do provedor de conexão; campos e respostas seguem essa operação. Exige instância conectada.","x-required-scopes":["settings:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"UUID do recurso da sua conta.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Identificador único por operação. Reenvie a mesma chave com método, URL e corpo idênticos para recuperar a resposta em até 24 horas. Nunca reutilize para outra operação, nem após expirar.","schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"example":"pedido-20260914-0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"O ID do produto."}},"required":["id"]}}}},"responses":{"200":{"description":"Operação concluída.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}},"Idempotency-Replayed":{"description":"true quando a resposta persistida é reutilizada.","schema":{"type":"boolean"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"405":{"description":"Método não permitido neste recurso.","headers":{"Allow":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"$ref":"#/components/responses/Problem"},"413":{"$ref":"#/components/responses/Problem"},"415":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"description":"Limite de requisições atingido. Aguarde Retry-After.","headers":{"Retry-After":{"description":"Segundos até uma nova tentativa permitida.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"$ref":"#/components/responses/Problem"},"502":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"},"504":{"$ref":"#/components/responses/Problem"}}}}},"components":{"securitySchemes":{"ApiKeyBearer":{"type":"http","scheme":"bearer","bearerFormat":"Grapnel API key","description":"Gere uma chave no painel (WhatsApp Manager → Agentes de IA) e cole somente seu valor. Use exclusivamente no servidor e com os menores escopos necessários. A chave pode valer para todas as instâncias ou só para algumas: as demais respondem 404 e não aparecem nas listas."}},"schemas":{"Problem":{"type":"object","properties":{"type":{"type":"string","const":"about:blank"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string","description":"Caminho da requisição."},"code":{"type":"string","description":"Código estável para tratamento programático."},"request_id":{"type":"string","format":"uuid"}},"required":["type","title","status","detail","instance","code","request_id"],"additionalProperties":false},"Success":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"CreateLink":{"type":"object","properties":{"folderId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"slug":{"type":"string","minLength":3,"maxLength":50,"pattern":"^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$","description":"3 a 50 caracteres: letras minúsculas, números e hífens. O slug é imutável após a criação. Na criação, omita para gerar automaticamente."},"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"destinationType":{"type":"string","enum":["whatsapp","custom_url","instances"]},"conversionRefLabel":{"type":"string","minLength":1,"maxLength":50,"pattern":"^[^\\r\\n]+$"},"customUrl":{"type":["string","null"],"description":"URL HTTP(S). Quando o protocolo é omitido, https:// é adicionado. Obrigatória para destinationType=custom_url."},"isActive":{"default":true,"type":"boolean"},"utmSource":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"utmMedium":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"utmCampaign":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"utmContent":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"utmTerm":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"messagePoolIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"phonePoolId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"pixelPoolId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"pixelEvents":{"maxItems":100,"type":"array","items":{"type":"string","enum":["PageView","Lead","Contact","WhatsAppClick"]}},"fallbackPhone":{"type":["string","null"],"description":"Telefone com DDI, de 10 a 15 dígitos após remover a formatação. Números de atendimento 0800/0300/0500/0900 e 400x são rejeitados."},"pinInstanceNumbers":{"type":"boolean"},"instanceConfigs":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"instanceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"phoneNumber":{"type":["string","null"]},"weight":{"default":1,"type":"integer","minimum":1,"maximum":100},"isActive":{"default":true,"type":"boolean"}},"required":["instanceId"],"additionalProperties":false},"description":"Somente instâncias da sua conta. Até 100 configurações."},"destinations":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"sourceType":{"type":"string","enum":["instance","manual"]},"instanceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"phoneNumber":{"type":"string"},"displayName":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"weight":{"default":1,"type":"integer","minimum":1,"maximum":100},"message":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"isActive":{"default":true,"type":"boolean"}},"required":["sourceType","phoneNumber"],"additionalProperties":false},"description":"Para destinationType=whatsapp, informe pelo menos um destino ou phonePoolId. sourceType=instance exige instanceId da sua conta."},"messages":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":1000},"weight":{"default":1,"type":"integer","minimum":1,"maximum":100},"isActive":{"default":true,"type":"boolean"}},"required":["message"],"additionalProperties":false}},"products":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"productName":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"},"productSlug":{"type":"string","minLength":1,"maxLength":50,"pattern":"^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$"},"productMessage":{"type":"string","minLength":1,"maxLength":1000,"pattern":"\\S"},"isActive":{"default":true,"type":"boolean"}},"required":["productName","productSlug","productMessage"],"additionalProperties":false}}},"required":["name","destinationType"],"additionalProperties":false},"UpdateLink":{"type":"object","properties":{"folderId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"slug":{"type":"string","minLength":3,"maxLength":50,"pattern":"^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$","description":"3 a 50 caracteres: letras minúsculas, números e hífens. O slug é imutável após a criação. Na criação, omita para gerar automaticamente."},"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"destinationType":{"type":"string","enum":["whatsapp","custom_url","instances"]},"conversionRefLabel":{"type":"string","minLength":1,"maxLength":50,"pattern":"^[^\\r\\n]+$"},"customUrl":{"type":["string","null"],"description":"URL HTTP(S). Quando o protocolo é omitido, https:// é adicionado. Obrigatória para destinationType=custom_url."},"isActive":{"type":"boolean"},"utmSource":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"utmMedium":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"utmCampaign":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"utmContent":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"utmTerm":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"defaultMessage":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"messagePoolIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"phonePoolId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"pixelPoolId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"pixelEvents":{"maxItems":100,"type":"array","items":{"type":"string","enum":["PageView","Lead","Contact","WhatsAppClick"]}},"fallbackPhone":{"type":["string","null"],"description":"Telefone com DDI, de 10 a 15 dígitos após remover a formatação. Números de atendimento 0800/0300/0500/0900 e 400x são rejeitados."},"pinInstanceNumbers":{"type":"boolean"},"instanceConfigs":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"instanceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"phoneNumber":{"type":["string","null"]},"weight":{"default":1,"type":"integer","minimum":1,"maximum":100},"isActive":{"default":true,"type":"boolean"}},"required":["instanceId"],"additionalProperties":false},"description":"Somente instâncias da sua conta. Até 100 configurações."},"destinations":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"sourceType":{"type":"string","enum":["instance","manual"]},"instanceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"phoneNumber":{"type":"string"},"displayName":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"weight":{"default":1,"type":"integer","minimum":1,"maximum":100},"message":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"isActive":{"default":true,"type":"boolean"}},"required":["sourceType","phoneNumber"],"additionalProperties":false},"description":"Para destinationType=whatsapp, informe pelo menos um destino ou phonePoolId. sourceType=instance exige instanceId da sua conta."},"messages":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":1000},"weight":{"default":1,"type":"integer","minimum":1,"maximum":100},"isActive":{"default":true,"type":"boolean"}},"required":["message"],"additionalProperties":false}}},"additionalProperties":false,"minProperties":1},"CreateFolder":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"parentId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"color":{"anyOf":[{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},{"type":"null"}]}},"required":["name"],"additionalProperties":false},"UpdateFolder":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"parentId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"color":{"anyOf":[{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},{"type":"null"}]}},"additionalProperties":false,"minProperties":1},"CreateDestination":{"type":"object","properties":{"sourceType":{"type":"string","enum":["instance","manual"]},"instanceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"phoneNumber":{"type":"string"},"displayName":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"weight":{"default":1,"type":"integer","minimum":1,"maximum":100},"message":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"isActive":{"default":true,"type":"boolean"}},"required":["sourceType","phoneNumber"],"additionalProperties":false},"UpdateDestination":{"type":"object","properties":{"sourceType":{"type":"string","enum":["instance","manual"]},"instanceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"phoneNumber":{"type":"string"},"displayName":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"weight":{"type":"integer","minimum":1,"maximum":100},"message":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"isActive":{"type":"boolean"}},"additionalProperties":false,"minProperties":1},"CreateMessage":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":1000},"weight":{"default":1,"type":"integer","minimum":1,"maximum":100},"isActive":{"default":true,"type":"boolean"}},"required":["message"],"additionalProperties":false},"CreateProduct":{"type":"object","properties":{"productName":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"},"productSlug":{"type":"string","minLength":1,"maxLength":50,"pattern":"^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$"},"productMessage":{"type":"string","minLength":1,"maxLength":1000,"pattern":"\\S"},"isActive":{"default":true,"type":"boolean"}},"required":["productName","productSlug","productMessage"],"additionalProperties":false},"UpdateProduct":{"type":"object","properties":{"productName":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"},"productSlug":{"type":"string","minLength":1,"maxLength":50,"pattern":"^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$"},"productMessage":{"type":"string","minLength":1,"maxLength":1000,"pattern":"\\S"},"isActive":{"type":"boolean"}},"additionalProperties":false,"minProperties":1},"UpdateMessage":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":1000},"weight":{"type":"integer","minimum":1,"maximum":100},"isActive":{"type":"boolean"}},"additionalProperties":false,"minProperties":1},"Folder":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"parent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"color":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"_count":{"type":"object","properties":{"links":{"type":"integer","minimum":0}},"required":["links"],"additionalProperties":false}},"required":["id","name"],"additionalProperties":false},"Destination":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"link_id":{"type":"string","format":"uuid"},"source_type":{"type":"string","enum":["instance","manual"]},"instance_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"phone_number":{"type":"string"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"weight":{"anyOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}]},"message":{"anyOf":[{"type":"string"},{"type":"null"}]},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id"],"additionalProperties":false},"Message":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"link_id":{"type":"string","format":"uuid"},"message":{"type":"string"},"weight":{"anyOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}]},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","link_id","message"],"additionalProperties":false},"Product":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"link_id":{"type":"string","format":"uuid"},"product_name":{"type":"string"},"product_slug":{"type":"string"},"product_message":{"type":"string"},"action":{"type":"string","enum":["updated","cloned"]},"previous_product_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","link_id","product_name","product_slug","product_message"],"additionalProperties":false},"Link":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"folder_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"slug":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"destination_type":{"type":"string","enum":["whatsapp","custom_url","instances"]},"custom_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"conversion_ref_label":{"type":"string"},"default_message":{"anyOf":[{"type":"string"},{"type":"null"}]},"utm_source":{"anyOf":[{"type":"string"},{"type":"null"}]},"utm_medium":{"anyOf":[{"type":"string"},{"type":"null"}]},"utm_campaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"utm_content":{"anyOf":[{"type":"string"},{"type":"null"}]},"utm_term":{"anyOf":[{"type":"string"},{"type":"null"}]},"message_pool_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"message_pool_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"phone_pool_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"pixel_pool_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"pixel_events":{"type":"array","items":{"type":"string"}},"fallback_phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"pin_instance_numbers":{"type":"boolean"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"url":{"type":"string","format":"uri","description":"URL pública pronta para compartilhar. Use este valor sem montar o endereço manualmente."},"owner_code":{"type":"string","description":"Código público da conta usado no endereço do link."},"qr_code_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"display_order":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"phone_pool_number_count":{"type":"integer","minimum":0},"instance_config_count":{"type":"integer","minimum":0},"connected_instance_count":{"type":"integer"},"destinations":{"type":"array","items":{"$ref":"#/components/schemas/Destination"}},"messages":{"type":"array","items":{"$ref":"#/components/schemas/Message"}},"products":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"folder":{"anyOf":[{"$ref":"#/components/schemas/Folder"},{"type":"null"}]},"_count":{"type":"object","properties":{"clicks":{"type":"integer","minimum":0},"uniqueClicks":{"type":"integer","minimum":0}},"required":["clicks","uniqueClicks"],"additionalProperties":false},"instance_configs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"instance_id":{"type":"string","format":"uuid"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}]},"weight":{"type":"integer","minimum":1,"maximum":100},"is_active":{"type":"boolean"}},"required":["id","instance_id","phone_number","weight","is_active"],"additionalProperties":false}}},"required":["id","slug","name"],"additionalProperties":false},"LinkPage":{"type":"object","properties":{"links":{"type":"array","items":{"$ref":"#/components/schemas/Link"}},"nextCursor":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"hasMore":{"type":"boolean"},"total":{"type":"integer","minimum":0}},"required":["links","nextCursor","hasMore","total"],"additionalProperties":false},"Analytics":{"type":"object","properties":{"clicks":{"type":"integer","minimum":0,"description":"Cliques no período, excluindo prévias automáticas reconhecidas."},"uniqueVisitors":{"type":"integer","minimum":0,"description":"Visitantes únicos no período."},"trackableClicks":{"type":"integer","minimum":0,"description":"Cliques elegíveis para atribuição de conversão."},"attributedConversions":{"type":"integer","minimum":0,"description":"Conversões atribuídas aos cliques elegíveis."},"conversionsInPeriod":{"type":"integer","minimum":0,"description":"Conversões ocorridas no período selecionado."},"uniqueContacts":{"type":"integer","minimum":0,"description":"Contatos únicos convertidos."},"conversionRate":{"type":"number","minimum":0,"description":"Percentual: attributedConversions / trackableClicks × 100; zero quando não há cliques elegíveis."},"clicksByDay":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer","minimum":0}},"required":["date","count"],"additionalProperties":false}},"conversionsByDay":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer","minimum":0}},"required":["date","count"],"additionalProperties":false}},"clicksByHour":{"type":"array","items":{"type":"object","properties":{"hour":{"type":"integer","minimum":0,"maximum":23},"count":{"type":"integer","minimum":0}},"required":["hour","count"],"additionalProperties":false}},"clicksByDayHour":{"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"hour":{"type":"integer","minimum":0,"maximum":23},"count":{"type":"integer","minimum":0}},"required":["day","hour","count"],"additionalProperties":false}},"clicksByDevice":{"type":"array","items":{"type":"object","properties":{"device":{"type":"string"},"count":{"type":"integer","minimum":0}},"required":["device","count"],"additionalProperties":false}},"clicksByOS":{"type":"array","items":{"type":"object","properties":{"os":{"type":"string"},"count":{"type":"integer","minimum":0}},"required":["os","count"],"additionalProperties":false}},"clicksByBrowser":{"type":"array","items":{"type":"object","properties":{"browser":{"type":"string"},"count":{"type":"integer","minimum":0}},"required":["browser","count"],"additionalProperties":false}},"clicksByCountry":{"type":"array","items":{"type":"object","properties":{"country":{"type":"string"},"count":{"type":"integer","minimum":0}},"required":["country","count"],"additionalProperties":false}},"clicksByDestination":{"type":"array","items":{"type":"object","properties":{"phone":{"type":"string"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"count":{"type":"integer","minimum":0}},"required":["phone","displayName","count"],"additionalProperties":false}},"clicksByDestinationId":{"type":"array","items":{"type":"object","properties":{"destinationId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"destinationKind":{"type":"string","enum":["custom_url","link_destination","phone_pool_number","instance","fallback","unknown"]},"destinationLabel":{"anyOf":[{"type":"string"},{"type":"null"}]},"destinationPhone":{"anyOf":[{"type":"string"},{"type":"null"}]},"count":{"type":"integer","minimum":0}},"required":["destinationId","destinationKind","destinationLabel","destinationPhone","count"],"additionalProperties":false}},"topReferrers":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"count":{"type":"integer","minimum":0}},"required":["domain","count"],"additionalProperties":false}},"linkPerformance":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string","enum":["active","inactive","trashed","removed"]},"clicks":{"type":"integer","minimum":0,"description":"Cliques no período, excluindo prévias automáticas reconhecidas."},"uniqueVisitors":{"type":"integer","minimum":0,"description":"Visitantes únicos no período."},"trackableClicks":{"type":"integer","minimum":0,"description":"Cliques elegíveis para atribuição de conversão."},"attributedConversions":{"type":"integer","minimum":0,"description":"Conversões atribuídas aos cliques elegíveis."},"conversionsInPeriod":{"type":"integer","minimum":0,"description":"Conversões ocorridas no período selecionado."},"uniqueContacts":{"type":"integer","minimum":0,"description":"Contatos únicos convertidos."},"conversionRate":{"type":"number","minimum":0,"description":"Percentual: attributedConversions / trackableClicks × 100; zero quando não há cliques elegíveis."}},"required":["id","name","slug","status","clicks","uniqueVisitors","trackableClicks","attributedConversions","conversionsInPeriod","uniqueContacts","conversionRate"],"additionalProperties":false}},"utmBreakdown":{"type":"object","properties":{"sources":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"count":{"type":"integer","minimum":0}},"required":["source","count"],"additionalProperties":false}},"mediums":{"type":"array","items":{"type":"object","properties":{"medium":{"type":"string"},"count":{"type":"integer","minimum":0}},"required":["medium","count"],"additionalProperties":false}},"campaigns":{"type":"array","items":{"type":"object","properties":{"campaign":{"type":"string"},"count":{"type":"integer","minimum":0}},"required":["campaign","count"],"additionalProperties":false}},"contents":{"type":"array","items":{"type":"object","properties":{"content":{"type":"string"},"count":{"type":"integer","minimum":0}},"required":["content","count"],"additionalProperties":false}},"terms":{"type":"array","items":{"type":"object","properties":{"term":{"type":"string"},"count":{"type":"integer","minimum":0}},"required":["term","count"],"additionalProperties":false}}},"required":["sources","mediums","campaigns","contents","terms"],"additionalProperties":false}},"required":["clicks","uniqueVisitors","trackableClicks","attributedConversions","conversionsInPeriod","uniqueContacts","conversionRate"],"additionalProperties":false},"AnalyticsComparison":{"type":"object","properties":{"prevPeriod":{"type":"object","properties":{"startDate":{"type":"string","format":"date-time"},"endDate":{"type":"string","format":"date-time"}},"required":["startDate","endDate"],"additionalProperties":false},"prevTotalClicks":{"type":"integer","minimum":0},"prevUniqueClicks":{"type":"integer","minimum":0},"totalTrend":{"type":"number"},"uniqueTrend":{"type":"number"}},"required":["prevPeriod","prevTotalClicks","prevUniqueClicks","totalTrend","uniqueTrend"],"additionalProperties":false},"AnalyticsReport":{"type":"object","properties":{"analytics":{"$ref":"#/components/schemas/Analytics"},"comparison":{"anyOf":[{"$ref":"#/components/schemas/AnalyticsComparison"},{"type":"null"}]},"links":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"folder_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"status":{"type":"string","enum":["active","inactive","trashed","removed"]}},"required":["id","name","slug","folder_id","is_active","status"],"additionalProperties":false}},"folders":{"type":"array","items":{"$ref":"#/components/schemas/Folder"}}},"required":["analytics","comparison","links","folders"],"additionalProperties":false},"LinkAnalyticsReport":{"type":"object","properties":{"link":{"$ref":"#/components/schemas/Link"},"analytics":{"$ref":"#/components/schemas/Analytics"},"comparison":{"anyOf":[{"$ref":"#/components/schemas/AnalyticsComparison"},{"type":"null"}]}},"required":["link","analytics","comparison"],"additionalProperties":false},"Lead":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"contact_phone":{"type":"string"},"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"vendor_phone":{"type":"string"},"vendor_instance_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"vendor_instance_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"type":"string"},"first_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"last_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}},"required":["id","contact_phone","contact_name","vendor_phone","vendor_instance_id","vendor_instance_name","source","first_message_at","last_message_at","created_at"],"additionalProperties":false},"LeadPage":{"type":"object","properties":{"leads":{"type":"array","items":{"$ref":"#/components/schemas/Lead"}},"total":{"type":"integer","minimum":0},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["leads","total","nextCursor"],"additionalProperties":false},"LeadStats":{"type":"object","properties":{"totalLeads":{"type":"integer","minimum":0,"description":"Total de contatos em todo o histórico, independente do período."},"newLeads":{"type":"integer","minimum":0},"reassigned":{"type":"integer","minimum":0},"byVendor":{"type":"array","items":{"type":"object","properties":{"phone":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"count":{"type":"integer","minimum":0}},"required":["phone","name","count"],"additionalProperties":false}},"byDay":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"count":{"type":"integer","minimum":0}},"required":["date","count"],"additionalProperties":false}},"byDayOfWeek":{"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"label":{"type":"string"},"count":{"type":"integer","minimum":0}},"required":["day","label","count"],"additionalProperties":false}},"byCity":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"count":{"type":"integer","minimum":0}},"required":["name","count"],"additionalProperties":false}},"byDevice":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"count":{"type":"integer","minimum":0}},"required":["name","count"],"additionalProperties":false}},"clicksVsMessages":{"type":"object","properties":{"messages":{"type":"integer","minimum":0},"clicks":{"type":"integer","minimum":0}},"required":["messages","clicks"],"additionalProperties":false}},"required":["totalLeads","newLeads","reassigned","byVendor","byDay","byDayOfWeek","byCity","byDevice","clicksVsMessages"],"additionalProperties":false},"Instance":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["connected","connecting","disconnected","error"]},"created_at":{"type":"string","format":"date-time"}},"required":["id","name","phone","status","created_at"],"additionalProperties":false},"InstanceStatus":{"type":"object","properties":{"status":{"type":"string","enum":["connected","connecting","disconnected","error"]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"profileName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["status"],"additionalProperties":false},"ConnectInstance":{"type":"object","properties":{"method":{"type":"string","enum":["qr","paircode"],"default":"qr"},"phone":{"type":"string","maxLength":40,"description":"Obrigatório com method=paircode: número do WhatsApp que será pareado, com DDI e DDD (ex.: 5562999999999). Espaços, +, parênteses e traços são ignorados; um número brasileiro sem DDI recebe 55.","example":"5562999999999"}},"required":[],"additionalProperties":false},"InstanceConnection":{"type":"object","properties":{"status":{"type":"string","enum":["connected","connecting","disconnected","error"]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"profileName":{"anyOf":[{"type":"string"},{"type":"null"}]},"qrcode":{"type":"string","description":"QR de pareamento temporário. Exiba somente ao proprietário; não registre nem compartilhe."},"paircode":{"type":"string","description":"Código temporário de pareamento; não registre nem compartilhe."}},"required":[],"additionalProperties":false},"EmptyBody":{"type":"object","properties":{},"required":[],"additionalProperties":false},"Group":{"type":"object","properties":{"jid":{"type":"string","maxLength":64,"pattern":"^\\d{5,25}(?:-\\d{5,20})?@g\\.us$","description":"JID retornado pela consulta de grupos."},"name":{"type":"string"},"owner_can_send_message":{"type":"boolean"}},"required":["name"],"additionalProperties":false},"GroupInfo":{"type":"object","properties":{"groupjid":{"type":"string","maxLength":64,"pattern":"^\\d{5,25}(?:-\\d{5,20})?@g\\.us$","description":"JID retornado pela consulta de grupos."}},"required":["groupjid"],"additionalProperties":false},"WhatsAppGroupMessage":{"type":"object","properties":{"id":{"type":"string"},"messageid":{"type":"string","minLength":1,"maxLength":255},"chatid":{"type":"string","maxLength":64,"pattern":"^\\d{5,25}(?:-\\d{5,20})?@g\\.us$","description":"JID retornado pela consulta de grupos."},"sender":{"anyOf":[{"type":"string"},{"type":"null"}]},"senderName":{"anyOf":[{"type":"string"},{"type":"null"}]},"isGroup":{"type":"boolean","const":true},"fromMe":{"type":"boolean"},"messageType":{"anyOf":[{"type":"string"},{"type":"null"}]},"messageTimestamp":{"type":"integer","minimum":0,"description":"Horário original em milissegundos desde Unix epoch, quando informado pelo provedor. Zero indica horário indisponível."},"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"text":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["messageid","chatid","isGroup","fromMe"],"additionalProperties":false},"GroupMessagePage":{"type":"object","properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/WhatsAppGroupMessage"}},"pagination":{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":100},"offset":{"type":"integer","minimum":0,"maximum":100000},"next_offset":{"type":"integer","minimum":0},"has_more":{"type":"boolean"}},"required":["limit","offset","next_offset","has_more"],"additionalProperties":false}},"required":["messages","pagination"],"additionalProperties":false},"GroupWebhook":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"event":{"type":"string","const":"whatsapp.group.message.received"}},"required":["url","event"],"additionalProperties":false},"ConfigureGroupWebhook":{"type":"object","properties":{"url":{"type":"string","format":"uri","maxLength":2048,"description":"URL HTTPS pública na porta 443, sem credenciais ou fragmento. IPs privados, reservados e redirecionamentos são bloqueados."},"secret":{"type":"string","minLength":32,"maxLength":256,"writeOnly":true,"description":"Segredo aleatório gerado e guardado no seu servidor. Usado para validar a assinatura HMAC SHA-256. Armazenado cifrado e nunca devolvido pela Grapnel."}},"required":["url","secret"],"additionalProperties":false},"GroupWebhookEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"event":{"type":"string","const":"whatsapp.group.message.received"},"instance_id":{"type":"string","format":"uuid"},"message":{"$ref":"#/components/schemas/WhatsAppGroupMessage"}},"required":["id","event","instance_id","message"],"additionalProperties":false},"WhatsAppDirectMessage":{"type":"object","properties":{"id":{"type":"string"},"messageid":{"type":"string","minLength":1,"maxLength":255},"chatid":{"type":"string","maxLength":64,"pattern":"^\\d{5,25}@(?:s\\.whatsapp\\.net|lid)$","description":"JID da conversa individual, retornado em GET /instances/{id}/chats."},"sender":{"anyOf":[{"type":"string"},{"type":"null"}]},"senderName":{"anyOf":[{"type":"string"},{"type":"null"}]},"isGroup":{"type":"boolean","const":false},"fromMe":{"type":"boolean"},"messageType":{"anyOf":[{"type":"string"},{"type":"null"}]},"messageTimestamp":{"type":"integer","minimum":0,"description":"Horário original em milissegundos desde Unix epoch, quando informado pelo provedor. Zero indica horário indisponível."},"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"text":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["messageid","chatid","isGroup","fromMe"],"additionalProperties":false},"DirectMessagePage":{"type":"object","properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/WhatsAppDirectMessage"}},"pagination":{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":100},"offset":{"type":"integer","minimum":0,"maximum":100000},"next_offset":{"type":"integer","minimum":0},"has_more":{"type":"boolean"}},"required":["limit","offset","next_offset","has_more"],"additionalProperties":false}},"required":["messages","pagination"],"additionalProperties":false},"Chat":{"type":"object","properties":{"chatid":{"type":"string","maxLength":64},"lid":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"is_group":{"type":"boolean"},"archived":{"type":"boolean"},"pinned":{"type":"boolean"},"blocked":{"type":"boolean"},"unread_count":{"type":"integer","minimum":0},"last_message_at":{"type":["integer","null"],"description":"Última mensagem, em milissegundos desde Unix epoch."},"last_message_type":{"anyOf":[{"type":"string"},{"type":"null"}]},"last_message_sender":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["chatid","lid","name","is_group","archived","pinned","blocked","unread_count","last_message_at","last_message_type","last_message_sender"],"additionalProperties":false},"ChatPage":{"type":"object","properties":{"chats":{"type":"array","items":{"$ref":"#/components/schemas/Chat"}},"pagination":{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":100},"offset":{"type":"integer","minimum":0,"maximum":100000},"total":{"type":["integer","null"],"minimum":0},"has_more":{"type":"boolean"}},"required":["limit","offset","total","has_more"],"additionalProperties":false}},"required":["chats","pagination"],"additionalProperties":false},"MessageWebhook":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"direct_messages":{"type":"boolean"},"events":{"type":"array","items":{"type":"string","enum":["whatsapp.group.message.received","whatsapp.message.received"]}}},"required":["url","direct_messages","events"],"additionalProperties":false},"ConfigureMessageWebhook":{"type":"object","properties":{"url":{"type":"string","format":"uri","maxLength":2048,"description":"URL HTTPS pública na porta 443, sem credenciais ou fragmento. IPs privados, reservados e redirecionamentos são bloqueados."},"secret":{"type":"string","minLength":32,"maxLength":256,"writeOnly":true,"description":"Segredo aleatório gerado e guardado no seu servidor. Usado para validar a assinatura HMAC SHA-256. Armazenado cifrado e nunca devolvido pela Grapnel."},"direct_messages":{"type":"boolean","default":false,"description":"Também entrega mensagens de conversas individuais (evento whatsapp.message.received). Exige a permissão chats:read na chave."}},"required":["url","secret"],"additionalProperties":false},"MessageWebhookEvent":{"oneOf":[{"$ref":"#/components/schemas/GroupWebhookEvent"},{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"event":{"type":"string","const":"whatsapp.message.received"},"instance_id":{"type":"string","format":"uuid"},"message":{"$ref":"#/components/schemas/WhatsAppDirectMessage"}},"required":["id","event","instance_id","message"],"additionalProperties":false}]},"MessageWebhookInstance":{"type":"object","properties":{"instance_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["connected","connecting","disconnected","error"]},"webhook":{"anyOf":[{"$ref":"#/components/schemas/MessageWebhook"},{"type":"null"}]}},"required":["instance_id","name","phone","status","webhook"],"additionalProperties":false},"ConfigureMessageWebhooks":{"type":"object","properties":{"instance_ids":{"description":"\"all\" para todas as instâncias que a chave pode usar ou uma lista de 1 a 100 IDs.","anyOf":[{"type":"string","const":"all"},{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":100,"uniqueItems":true}]},"url":{"type":"string","format":"uri","maxLength":2048,"description":"URL HTTPS pública na porta 443, sem credenciais ou fragmento. IPs privados, reservados e redirecionamentos são bloqueados."},"secret":{"type":"string","minLength":32,"maxLength":256,"writeOnly":true,"description":"Segredo aleatório gerado e guardado no seu servidor, o mesmo para todas as instâncias escolhidas. Armazenado cifrado e nunca devolvido pela Grapnel."},"direct_messages":{"type":"boolean","default":false,"description":"Também entrega mensagens de conversas individuais (evento whatsapp.message.received). Exige a permissão chats:read na chave."}},"required":["instance_ids","url","secret"],"additionalProperties":false},"DisableMessageWebhooks":{"type":"object","properties":{"instance_ids":{"description":"\"all\" para todas as instâncias que a chave pode usar ou uma lista de 1 a 100 IDs.","anyOf":[{"type":"string","const":"all"},{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":100,"uniqueItems":true}]}},"required":["instance_ids"],"additionalProperties":false},"MessageWebhookBulkResult":{"type":"object","properties":{"results":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"instance_id":{"type":"string","format":"uuid"},"status":{"type":"string","const":"configured"},"webhook":{"$ref":"#/components/schemas/MessageWebhook"}},"required":["instance_id","status","webhook"],"additionalProperties":false},{"type":"object","properties":{"instance_id":{"type":"string","format":"uuid"},"status":{"type":"string","const":"disabled"}},"required":["instance_id","status"],"additionalProperties":false},{"type":"object","properties":{"instance_id":{"type":"string","format":"uuid"},"status":{"type":"string","const":"failed"},"error":{"type":"object","properties":{"code":{"type":"string"},"detail":{"type":"string"}},"required":["code","detail"],"additionalProperties":false}},"required":["instance_id","status","error"],"additionalProperties":false}]}},"summary":{"type":"object","properties":{"requested":{"type":"integer","minimum":0},"succeeded":{"type":"integer","minimum":0},"failed":{"type":"integer","minimum":0}},"required":["requested","succeeded","failed"],"additionalProperties":false}},"required":["results","summary"],"additionalProperties":false},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Mesmo valor do id do evento e de X-Grapnel-Event-Id."},"status":{"type":"string","enum":["pending","sending","delivered","failed"]},"attempts":{"type":"integer","minimum":0,"maximum":8},"created_at":{"type":"string","format":"date-time"},"next_attempt_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Próxima tentativa, enquanto pending ou sending."}},"required":["id","status","attempts","created_at","next_attempt_at"],"additionalProperties":false},"WebhookDeliveryPage":{"type":"object","properties":{"deliveries":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"pagination":{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":100},"offset":{"type":"integer","minimum":0,"maximum":100000},"has_more":{"type":"boolean"}},"required":["limit","offset","has_more"],"additionalProperties":false}},"required":["deliveries","pagination"],"additionalProperties":false},"SendText":{"type":"object","properties":{"number":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{7,14}$","description":"DDI e número, somente dígitos, de 8 a 15 caracteres; exemplo: 5511999999999."},{"type":"string","maxLength":64,"pattern":"^\\d{5,25}(?:-\\d{5,20})?@g\\.us$","description":"JID retornado pela consulta de grupos."}],"description":"Telefone com DDI ou JID do grupo."},"text":{"type":"string","minLength":1,"maxLength":4096,"pattern":"\\S","description":"Texto com pelo menos um caractere que não seja espaço."}},"required":["number","text"],"additionalProperties":false},"SendContact":{"type":"object","properties":{"number":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{7,14}$","description":"DDI e número, somente dígitos, de 8 a 15 caracteres; exemplo: 5511999999999."},{"type":"string","maxLength":64,"pattern":"^\\d{5,25}(?:-\\d{5,20})?@g\\.us$","description":"JID retornado pela consulta de grupos."}],"description":"Telefone com DDI ou JID do grupo."},"fullName":{"type":"string","minLength":1,"maxLength":100},"phoneNumber":{"type":"string","pattern":"^[1-9]\\d{7,14}$","description":"DDI e número, somente dígitos, de 8 a 15 caracteres; exemplo: 5511999999999."},"organization":{"type":"string","maxLength":100},"email":{"type":"string","format":"email","maxLength":254}},"required":["number","fullName","phoneNumber"],"additionalProperties":false},"SendLocation":{"type":"object","properties":{"number":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{7,14}$","description":"DDI e número, somente dígitos, de 8 a 15 caracteres; exemplo: 5511999999999."},{"type":"string","maxLength":64,"pattern":"^\\d{5,25}(?:-\\d{5,20})?@g\\.us$","description":"JID retornado pela consulta de grupos."}],"description":"Telefone com DDI ou JID do grupo."},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"name":{"type":"string","maxLength":200},"address":{"type":"string","maxLength":500}},"required":["number","latitude","longitude"],"additionalProperties":false},"SendMedia":{"type":"object","properties":{"number":{"anyOf":[{"type":"string","pattern":"^[1-9]\\d{7,14}$","description":"DDI e número, somente dígitos, de 8 a 15 caracteres; exemplo: 5511999999999."},{"type":"string","maxLength":64,"pattern":"^\\d{5,25}(?:-\\d{5,20})?@g\\.us$","description":"JID retornado pela consulta de grupos."}],"description":"Telefone com DDI ou JID do grupo."},"type":{"type":"string","enum":["image","video","audio","document"]},"file":{"type":"string","format":"uri","maxLength":2048,"description":"URL HTTPS de arquivo público já enviado ao storage Grapnel, no caminho /storage/v1/object/public/{bucket}/{arquivo}. Somente o domínio do storage Grapnel é aceito, sem porta personalizada, credenciais, query, fragmento, segmentos vazios, % ou barra invertida. URLs externas e links assinados são rejeitados."},"text":{"type":"string","minLength":1,"maxLength":4096,"pattern":"\\S","description":"Texto com pelo menos um caractere que não seja espaço."},"docName":{"type":"string","minLength":1,"maxLength":120}},"required":["number","type","file"],"additionalProperties":false},"MessageAccepted":{"type":"object","properties":{"accepted":{"type":"boolean","const":true}},"required":["accepted"],"additionalProperties":false},"WhatsAppResult":{"description":"Resposta do WhatsApp para a operação, sem credenciais do provedor. O formato segue a operação espelhada.","anyOf":[{"type":"object"},{"type":"array"}]},"InstanceMetrics":{"type":"object","properties":{"metrics":{"type":"object","properties":{"dates":{"type":"array","items":{"type":"string","format":"date"}},"messagesReceived":{"type":"array","items":{"type":"integer","minimum":0}},"messagesSent":{"type":"array","items":{"type":"integer","minimum":0}},"connections":{"type":"array","items":{"type":"integer","minimum":0}},"disconnections":{"type":"array","items":{"type":"integer","minimum":0}}},"required":["dates","messagesReceived","messagesSent","connections","disconnections"],"additionalProperties":false}},"required":["metrics"],"additionalProperties":false},"AccountLog":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"action":{"type":"string"},"entity_type":{"anyOf":[{"type":"string"},{"type":"null"}]},"request":{"type":"object","properties":{"method":{"type":"string"},"path":{"type":"string","description":"Rota sem IDs ou parâmetros de consulta."},"status":{"type":"integer","minimum":200,"maximum":599},"request_id":{"type":"string","format":"uuid"},"duration_ms":{"type":"integer","minimum":0},"replayed":{"type":"boolean"}},"required":["method","path","status","request_id","duration_ms","replayed"],"additionalProperties":false}},"required":["id","created_at","action","entity_type"],"additionalProperties":false},"AccountLogPage":{"type":"object","properties":{"logs":{"type":"array","items":{"$ref":"#/components/schemas/AccountLog"}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":1},"limit":{"type":"integer","minimum":1,"maximum":100},"total":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0}},"required":["page","limit","total","totalPages"],"additionalProperties":false}},"required":["logs","pagination"],"additionalProperties":false}},"responses":{"Problem":{"description":"Requisição não concluída. Consulte code e detail e guarde request_id para suporte.","headers":{"X-Request-Id":{"description":"Identificador desta requisição para diagnóstico.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"example":{"type":"about:blank","title":"Bad Request","status":400,"detail":"Confira os campos enviados.","instance":"/api/v1/links","code":"invalid_request","request_id":"01993fa0-1000-7000-8000-000000000001"}}}}}}}