{
  "openapi": "3.0.3",
  "info": {
    "title": "OneClick Sales — API pública",
    "version": "1.0.0",
    "description": "Versão estável v1. Mudanças que quebram integrações só numa nova versão (/v2), anunciadas com 90 dias de antecedência; campos novos podem aparecer nas respostas a qualquer momento. Todo erro vem como { error, message }. Cada chave tem os MÉTODOS que pode chamar (x-ocs-method em cada operação), uma lista opcional de IPs e um ambiente: produção (ocs_live_pk_) ou sandbox (ocs_test_pk_: lê os dados reais da conta, simula o que enviaria, gravaria ou cobraria). Toda resposta traz X-OCS-Environment, X-Request-Id e os limites em X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset e X-RateLimit-Daily-Remaining."
  },
  "servers": [
    {
      "url": "/"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "components": {
    "responses": {
      "E400": {
        "description": "invalid_request: Campo obrigatório ausente ou com valor fora do aceito. | invalid_json: O corpo não é um JSON válido. | invalid_idempotency_key: Idempotency-Key com mais de 200 caracteres ou com espaço. | invalid_contact: O contato não é um e-mail válido nem um telefone com DDD (opt-in e envio para um contato), ou o canal não atende esse número (ligação só para o Brasil). | invalid_collected_at: Opt-in: \"collectedAt\" não é data ISO 8601 ou está no futuro. | LGPD_CONSENT_HEADER_MISSING: Disparo sem o cabeçalho X-LGPD-Consent-Logged: true. | INVALID_CHANNELS: Disparo sem canal ou com canal desconhecido. | MESSAGE_REQUIRED: Disparo sem \"message\". | MESSAGE_TOO_LONG: Mensagem acima de 1.000 caracteres. | CONTACTS_REQUIRED: Disparo sem contatos. | TOO_MANY_CONTACTS: Mais de 30 mil contatos numa chamada. | PHONE_REQUIRED: Canal de telefone escolhido e nenhum contato com \"phone\". | EMAIL_REQUIRED: Canal de e-mail escolhido e nenhum contato com \"email\". | SMS_TOO_LONG: A mensagem ocuparia mais de 10 SMS.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "invalid_request",
              "message": "…"
            }
          }
        }
      },
      "E401": {
        "description": "unauthorized: Chave ausente, inválida ou revogada.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "unauthorized",
              "message": "…"
            }
          }
        }
      },
      "E402": {
        "description": "CREDITOS_INSUFICIENTES: Saldo insuficiente; \"missing\" diz quanto falta por carteira.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "CREDITOS_INSUFICIENTES",
              "message": "…"
            }
          }
        }
      },
      "E403": {
        "description": "account_suspended: A conta da chave está suspensa. | insufficient_scope: A chave não tem o método desta rota (\"method\" diz qual). Edite a chave em Minha Conta › Integrações e marque o método. | key_suspended: A chave foi suspensa pela equipe OneClick Sales. | plan_feature_api: O plano da conta não inclui a API (Minha Conta › Plano). A chave continua salva e volta a funcionar num plano com API e webhooks. | api_disabled: A API foi desligada para a conta pela equipe OneClick Sales (o motivo vem na mensagem). | ip_not_allowed: A chave tem lista de IPs e a chamada veio de outro (\"ip\" diz qual). | email_unverified: O e-mail de login da conta ainda não foi confirmado (link enviado no cadastro). Nada é enviado nem cobrado. | CADASTRO_INCOMPLETO: O cadastro da empresa (CNPJ, endereço) está incompleto; \"missing\" lista o que falta. | test_key_not_allowed: Chave de teste numa operação que cobra ou conecta número. | contact_blocked: Envio para um contato: o contato está na lista de bloqueio (pediu para sair); \"suppressionLevel\" diz qual lista. Nada é cobrado. | contact_opt_out: Lista de bloqueio: o contato pediu para sair (SAIR) — o bloqueio só sai se ele voltar a autorizar. | platform_block: Lista de bloqueio: o bloqueio foi aplicado pela equipe OneClick Sales e só sai pelo suporte. | plan_inactive: Envio para um contato: o plano da conta não está ativo.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "account_suspended",
              "message": "…"
            }
          }
        }
      },
      "E404": {
        "description": "not_found: O disparo, envio ou pagamento não existe nesta conta. | not_implemented: O endpoint não existe na API.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "not_found",
              "message": "…"
            }
          }
        }
      },
      "E409": {
        "description": "outside_send_window: Fora da janela de envio (08:00–12:00 e 13:30–22:00, Brasília); \"nextOpen\" diz quando abre. | idempotency_in_progress: Outra chamada com a mesma Idempotency-Key ainda está em andamento. | daily_outreach_limit: Envio para um contato: ele já foi abordado hoje neste canal (uma abordagem por dia). | channel_not_configured: Envio para um contato: o canal não tem provedor configurado nesta conta. | whatsapp_not_connected: Envio de WhatsApp: nenhum número da conta está conectado (veja GET /v1/channels). | template_required: WhatsApp Oficial: passou de 24 h desde a última mensagem do contato; só modelo aprovado (\"template\"). | human_mode: Ligação ou vídeo: a conta está no modo atendente humano (Minha Conta › Ligações e vídeo). | dispatch_in_progress: Um envio para este contato ainda está em andamento; tente depois do Retry-After. | conflict: Envio para um contato: o envio não pôde ser feito agora (o motivo vem em \"message\").",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "outside_send_window",
              "message": "…"
            }
          }
        }
      },
      "E422": {
        "description": "content_blocked: O texto tem termo proibido pela política de conteúdo (apostas, jogos de azar, ameaças, ofensas, golpes, drogas, armas, conteúdo adulto, propaganda eleitoral); \"categories\" e \"terms\" dizem o quê. Link encurtado (bit.ly, tinyurl...) também é recusado (categoria \"link_encurtado\"): use o link completo. Nada é enviado nem cobrado.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "content_blocked",
              "message": "…"
            }
          }
        }
      },
      "E413": {
        "description": "payload_too_large: Corpo acima do limite da rota (1 MB no disparo em massa).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "payload_too_large",
              "message": "…"
            }
          }
        }
      },
      "E429": {
        "description": "too_many_active_dispatches: Já há 3 disparos em andamento nesta conta. | rate_limited: Requisições demais: o limite por minuto da chave no tipo da chamada (\"kind\": leitura, alteração ou envio; padrão 60, 60 e 120 — veja GET /v1/account/limits), 600/min por IP, ou o limite anti-bloqueio do número de WhatsApp. Respeite o Retry-After e os cabeçalhos X-RateLimit-*. | account_send_daily_limit: Envio para um contato: a conta chegou ao limite diário de envios do canal que ela mesma definiu em Segurança (WhatsApp ou SMS); \"resumeAt\" diz quando volta. Nada é enviado nem cobrado. O ritmo por hora da conta responde como \"rate_limited\". | daily_quota_exceeded: A conta chegou ao limite de chamadas do dia (todas as chaves do mesmo ambiente somadas). Volta à meia-noite de Brasília (Retry-After).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "too_many_active_dispatches",
              "message": "…"
            }
          }
        }
      },
      "E500": {
        "description": "internal_error: Erro inesperado do servidor (a equipe é avisada).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "internal_error",
              "message": "…"
            }
          }
        }
      },
      "E502": {
        "description": "charge_failed: O gateway não gerou a cobrança. | status_failed: O gateway não respondeu o status do pagamento. | pairing_failed: Não foi possível iniciar o pareamento do número. | provider_failed: Envio para um contato: o provedor do canal recusou ou falhou. Nada foi cobrado.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "charge_failed",
              "message": "…"
            }
          }
        }
      },
      "E503": {
        "description": "unavailable: Banco de dados indisponível no momento; tente de novo (Retry-After). | charge_mark_failed: Envio para um contato: não foi possível registrar a cobrança do envio (banco de dados instável). Nada foi enviado e o crédito foi devolvido; tente de novo (Retry-After).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "unavailable",
              "message": "…"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Authorization: Bearer ocs_live_pk_… (produção) ou ocs_test_pk_… (sandbox: dados reais, ações simuladas)."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error",
          "message"
        ],
        "properties": {
          "error": {
            "type": "string",
            "enum": [
              "invalid_request",
              "invalid_json",
              "invalid_idempotency_key",
              "invalid_contact",
              "invalid_collected_at",
              "LGPD_CONSENT_HEADER_MISSING",
              "INVALID_CHANNELS",
              "MESSAGE_REQUIRED",
              "MESSAGE_TOO_LONG",
              "CONTACTS_REQUIRED",
              "TOO_MANY_CONTACTS",
              "PHONE_REQUIRED",
              "EMAIL_REQUIRED",
              "SMS_TOO_LONG",
              "unauthorized",
              "CREDITOS_INSUFICIENTES",
              "account_suspended",
              "insufficient_scope",
              "key_suspended",
              "plan_feature_api",
              "api_disabled",
              "ip_not_allowed",
              "email_unverified",
              "CADASTRO_INCOMPLETO",
              "test_key_not_allowed",
              "contact_blocked",
              "contact_opt_out",
              "platform_block",
              "plan_inactive",
              "not_found",
              "not_implemented",
              "outside_send_window",
              "idempotency_in_progress",
              "daily_outreach_limit",
              "channel_not_configured",
              "whatsapp_not_connected",
              "template_required",
              "human_mode",
              "dispatch_in_progress",
              "conflict",
              "content_blocked",
              "payload_too_large",
              "too_many_active_dispatches",
              "rate_limited",
              "account_send_daily_limit",
              "daily_quota_exceeded",
              "internal_error",
              "charge_failed",
              "status_failed",
              "pairing_failed",
              "provider_failed",
              "unavailable",
              "charge_mark_failed"
            ]
          },
          "message": {
            "type": "string"
          }
        }
      }
    }
  },
  "paths": {
    "/v1/dispatches/mass": {
      "post": {
        "tags": [
          "Disparo em massa"
        ],
        "x-ocs-method": "dispatches.create",
        "x-ocs-rate-kind": "send",
        "x-ocs-sandbox": "simulated",
        "description": "Método da chave: dispatches.create. Limite por minuto: envio. Sandbox: confere tudo e responde sem enviar, gravar nem cobrar (dryRun).",
        "operationId": "dispatches_mass",
        "parameters": [
          {
            "name": "X-LGPD-Consent-Logged",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Repetir a chamada com o mesmo valor (24 h) devolve o mesmo resultado, sem criar outro.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "channels": [
                  "whatsapp",
                  "sms"
                ],
                "campaignName": "Prospecção B2B Direct",
                "contacts": [
                  {
                    "phone": "5511987654321",
                    "name": "Carlos Silva"
                  }
                ],
                "message": "Olá {nome}, preparamos uma proposta exclusiva."
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "dispatchId": "DISP-M1ABC2-9F3E1A",
                  "status": "queued",
                  "contacts": 1,
                  "channels": [
                    "whatsapp",
                    "sms"
                  ],
                  "total": 2,
                  "creditsRequired": {
                    "wa": 1,
                    "sms": 1
                  },
                  "statusUrl": "/v1/dispatches/DISP-M1ABC2-9F3E1A"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/dispatches/{dispatchId}": {
      "get": {
        "tags": [
          "Disparo em massa"
        ],
        "x-ocs-method": "dispatches.get",
        "x-ocs-rate-kind": "read",
        "x-ocs-sandbox": "real",
        "description": "Método da chave: dispatches.get. Limite por minuto: leitura. Sandbox: devolve o dado real da conta.",
        "operationId": "dispatches_status",
        "parameters": [
          {
            "name": "dispatchId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "id": "DISP-M1ABC2-9F3E1A",
                  "campaignName": "Prospecção B2B Direct",
                  "channels": [
                    "whatsapp",
                    "sms"
                  ],
                  "status": "done",
                  "total": 2,
                  "processed": 2,
                  "counts": {
                    "sent": 2,
                    "failed": 0,
                    "blocked": 0,
                    "no_credits": 0,
                    "skipped": 0
                  },
                  "recent": [
                    {
                      "contact": "5511987654321",
                      "channel": "sms",
                      "outcome": "sent"
                    },
                    {
                      "contact": "5511987654321",
                      "channel": "whatsapp",
                      "outcome": "sent"
                    }
                  ],
                  "createdAt": "2026-09-18T14:02:11.000Z",
                  "updatedAt": "2026-09-18T14:02:23.000Z",
                  "finishedAt": "2026-09-18T14:02:23.000Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      },
      "delete": {
        "tags": [
          "Disparo em massa"
        ],
        "x-ocs-method": "dispatches.cancel",
        "x-ocs-rate-kind": "write",
        "x-ocs-sandbox": "simulated",
        "description": "Método da chave: dispatches.cancel. Limite por minuto: alteração. Sandbox: confere tudo e responde sem enviar, gravar nem cobrar (dryRun).",
        "summary": "Pede a parada do disparo antes do próximo envio.",
        "parameters": [
          {
            "name": "dispatchId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "dispatchId": "DISP-M1ABC2-9F3E1A",
                  "stopRequested": true,
                  "message": "O disparo para antes do próximo envio."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/account/credits": {
      "get": {
        "tags": [
          "Conta, plano e limites"
        ],
        "x-ocs-method": "account.credits",
        "x-ocs-rate-kind": "read",
        "x-ocs-sandbox": "real",
        "description": "Método da chave: account.credits. Limite por minuto: leitura. Sandbox: devolve o dado real da conta.",
        "operationId": "account_credits",
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "environment": "live",
                  "balances": {
                    "wa": 1250,
                    "sms": 300,
                    "email": 800,
                    "voice": 288,
                    "video_ia": 72,
                    "robot_form": 0,
                    "ocs_conector": 0,
                    "video_avatar": 0,
                    "robot_captcha": 0,
                    "robot_extract": 0,
                    "contatos": 9.9
                  },
                  "valueChannels": [
                    "voice",
                    "video_ia",
                    "contatos"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/billing/recharge-credits": {
      "post": {
        "tags": [
          "Cobrança"
        ],
        "x-ocs-method": "billing.rechargeCredits",
        "x-ocs-rate-kind": "write",
        "x-ocs-sandbox": "refused",
        "description": "Método da chave: billing.rechargeCredits. Limite por minuto: alteração. Sandbox: recusado (403 test_key_not_allowed).",
        "operationId": "billing_recharge",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Repetir a chamada com o mesmo valor (24 h) devolve o mesmo resultado, sem criar outro.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "items": [
                  {
                    "channel": "whatsapp",
                    "qty": 1000
                  },
                  {
                    "channel": "sms",
                    "qty": 500
                  },
                  {
                    "channel": "voice",
                    "qty": 10
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "paymentId": "1325678955",
                  "status": "pending",
                  "method": "pix",
                  "amountBrl": 732,
                  "pix": {
                    "copyPaste": "00020126…(Pix copia e cola)",
                    "qrCodeBase64": "iVBORw0KGgo…",
                    "expiresAt": "2026-09-19T18:00:00.000-03:00"
                  },
                  "statusUrl": "/v1/billing/payments/1325678955",
                  "message": "Pague o Pix; o plano/créditos são liberados quando o pagamento for confirmado (consulte statusUrl)."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/billing/renew-plan": {
      "post": {
        "tags": [
          "Cobrança"
        ],
        "x-ocs-method": "billing.renewPlan",
        "x-ocs-rate-kind": "write",
        "x-ocs-sandbox": "refused",
        "description": "Método da chave: billing.renewPlan. Limite por minuto: alteração. Sandbox: recusado (403 test_key_not_allowed).",
        "operationId": "billing_renew",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Repetir a chamada com o mesmo valor (24 h) devolve o mesmo resultado, sem criar outro.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "plan": "mensal",
                "tier": "profissional"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "paymentId": "1325678901",
                  "status": "pending",
                  "method": "pix",
                  "amountBrl": 499.9,
                  "pix": {
                    "copyPaste": "00020126…(Pix copia e cola)",
                    "qrCodeBase64": "iVBORw0KGgo…",
                    "expiresAt": "2026-09-19T18:00:00.000-03:00"
                  },
                  "statusUrl": "/v1/billing/payments/1325678901",
                  "message": "Pague o Pix; o plano/créditos são liberados quando o pagamento for confirmado (consulte statusUrl)."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/channels/add-number": {
      "post": {
        "tags": [
          "Números de WhatsApp"
        ],
        "x-ocs-method": "channels.addNumber",
        "x-ocs-rate-kind": "write",
        "x-ocs-sandbox": "refused",
        "description": "Método da chave: channels.addNumber. Limite por minuto: alteração. Sandbox: recusado (403 test_key_not_allowed).",
        "operationId": "channels_add",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "mode": "qr"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "instanceName": "api_4f9c2b1e",
                  "status": "WAITING_SCAN",
                  "mode": "qr",
                  "qrCode": "2@Xy7…(conteúdo do QR para exibir)",
                  "message": "Escaneie o QR (ou digite o código) no WhatsApp do número em até alguns minutos. Consulte GET /v1/channels para ver quando conectar."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/lgpd/opt-in-log": {
      "post": {
        "tags": [
          "LGPD"
        ],
        "x-ocs-method": "lgpd.optIn",
        "x-ocs-rate-kind": "write",
        "x-ocs-sandbox": "simulated",
        "description": "Método da chave: lgpd.optIn. Limite por minuto: alteração. Sandbox: confere tudo e responde sem enviar, gravar nem cobrar (dryRun).",
        "operationId": "lgpd_optin",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "contact": "5511987654321",
                "channel": "whatsapp",
                "source": "formulario-site",
                "evidence": "Checkbox marcado em 18/09/2026 no formulário de contato.",
                "collectedAt": "2026-09-18T14:02:11Z"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revogação registrada (`revoked: true`, com `reason` e `revokedAt` opcionais), ou prova guardada só no histórico: depois de uma revogação, a coleta sem `collectedAt` ou com data anterior à revogação mais recente não reativa o consentimento (`reactivated: false`). Para voltar a valer, informe em `collectedAt` a data da nova coleta.",
            "content": {
              "application/json": {
                "examples": {
                  "revogacao": {
                    "summary": "revoked: true",
                    "value": {
                      "id": "Kx83hQ2mPz",
                      "contact": "5511987654321",
                      "normalizedContact": "5511987654321",
                      "channel": "whatsapp",
                      "status": "revoked",
                      "revokedAt": "2026-10-05T12:00:00.000Z",
                      "revocationSource": "api",
                      "revocationReason": "Pediu para sair por telefone",
                      "historyCount": 2
                    }
                  },
                  "provaAnterior": {
                    "summary": "reactivated: false",
                    "value": {
                      "id": "Kx83hQ2mPz",
                      "contact": "5511987654321",
                      "status": "revoked",
                      "revokedAt": "2026-10-05T12:00:00.000Z",
                      "historyCount": 3,
                      "reactivated": false,
                      "message": "Prova guardada no histórico, mas o consentimento continua revogado: para voltar a valer, informe em \"collectedAt\" a data da nova coleta, posterior à revogação."
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "id": "Kx83hQ2mPz",
                  "contact": "5511987654321",
                  "normalizedContact": "5511987654321",
                  "channel": "whatsapp",
                  "source": "formulario-site",
                  "evidence": "Checkbox marcado em 18/09/2026 no formulário de contato.",
                  "collectedAt": "2026-09-18T14:02:11.000Z",
                  "registeredAt": "2026-09-18T14:02:12.345Z",
                  "firstRegisteredAt": "2026-09-18T14:02:12.345Z",
                  "ipPrefix": "200.150.88.x",
                  "status": "active",
                  "revokedAt": null,
                  "historyCount": 1
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/whatsapp/messages": {
      "post": {
        "tags": [
          "Envio para um contato"
        ],
        "x-ocs-method": "messages.whatsapp.send",
        "x-ocs-rate-kind": "send",
        "x-ocs-sandbox": "simulated",
        "description": "Método da chave: messages.whatsapp.send. Limite por minuto: envio. Sandbox: confere tudo e responde sem enviar, gravar nem cobrar (dryRun).",
        "operationId": "messages_whatsapp",
        "parameters": [
          {
            "name": "X-LGPD-Consent-Logged",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Repetir a chamada com o mesmo valor (24 h) devolve o mesmo resultado, sem criar outro.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "to": "5511987654321",
                "text": "Olá Carlos, preparamos uma proposta exclusiva para a sua empresa.",
                "contactName": "Carlos Silva",
                "reference": "pedido-4521"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "id": "MSG-MG1ABC2-7F3E1A",
                  "channel": "whatsapp",
                  "status": "sent",
                  "to": "5511987654321",
                  "reference": "pedido-4521",
                  "creditsUsed": 1,
                  "createdAt": "2026-09-18T14:02:11.000Z",
                  "statusUrl": "/v1/messages/MSG-MG1ABC2-7F3E1A"
                }
              }
            }
          },
          "202": {
            "description": "O provedor não confirmou o envio: status \"unknown\" (pode ter saído; não é repetido sozinho).",
            "content": {
              "application/json": {
                "example": {
                  "id": "MSG-MG1ABC2-7F3E1A",
                  "channel": "whatsapp",
                  "status": "unknown",
                  "to": "5511987654321",
                  "reference": "pedido-4521",
                  "creditsUsed": 1,
                  "createdAt": "2026-09-18T14:02:11.000Z",
                  "statusUrl": "/v1/messages/MSG-MG1ABC2-7F3E1A"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/whatsapp-official/messages": {
      "post": {
        "tags": [
          "Envio para um contato"
        ],
        "x-ocs-method": "messages.whatsappOfficial.send",
        "x-ocs-rate-kind": "send",
        "x-ocs-sandbox": "simulated",
        "description": "Método da chave: messages.whatsappOfficial.send. Limite por minuto: envio. Sandbox: confere tudo e responde sem enviar, gravar nem cobrar (dryRun).",
        "operationId": "messages_whatsapp_official",
        "parameters": [
          {
            "name": "X-LGPD-Consent-Logged",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Repetir a chamada com o mesmo valor (24 h) devolve o mesmo resultado, sem criar outro.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "to": "5511987654321",
                "template": {
                  "name": "proposta_comercial",
                  "language": "pt_BR",
                  "params": [
                    "Carlos"
                  ]
                },
                "reference": "pedido-4521"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "id": "MSG-MG1ABC2-7F3E1A",
                  "channel": "whatsapp_official",
                  "status": "sent",
                  "to": "5511987654321",
                  "reference": "pedido-4521",
                  "creditsUsed": 1,
                  "createdAt": "2026-09-18T14:02:11.000Z",
                  "statusUrl": "/v1/messages/MSG-MG1ABC2-7F3E1A"
                }
              }
            }
          },
          "202": {
            "description": "O provedor não confirmou o envio: status \"unknown\" (pode ter saído; não é repetido sozinho).",
            "content": {
              "application/json": {
                "example": {
                  "id": "MSG-MG1ABC2-7F3E1A",
                  "channel": "whatsapp_official",
                  "status": "unknown",
                  "to": "5511987654321",
                  "reference": "pedido-4521",
                  "creditsUsed": 1,
                  "createdAt": "2026-09-18T14:02:11.000Z",
                  "statusUrl": "/v1/messages/MSG-MG1ABC2-7F3E1A"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/sms/messages": {
      "post": {
        "tags": [
          "Envio para um contato"
        ],
        "x-ocs-method": "messages.sms.send",
        "x-ocs-rate-kind": "send",
        "x-ocs-sandbox": "simulated",
        "description": "Método da chave: messages.sms.send. Limite por minuto: envio. Sandbox: confere tudo e responde sem enviar, gravar nem cobrar (dryRun).",
        "operationId": "messages_sms",
        "parameters": [
          {
            "name": "X-LGPD-Consent-Logged",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Repetir a chamada com o mesmo valor (24 h) devolve o mesmo resultado, sem criar outro.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "to": "5511987654321",
                "text": "Olá Carlos, sua proposta está pronta. Confira no e-mail que enviamos hoje.",
                "reference": "pedido-4521"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "id": "MSG-MG1ABC2-7F3E1A",
                  "channel": "sms",
                  "status": "sent",
                  "to": "5511987654321",
                  "reference": "pedido-4521",
                  "segments": 2,
                  "creditsUsed": 2,
                  "createdAt": "2026-09-18T14:02:11.000Z",
                  "statusUrl": "/v1/messages/MSG-MG1ABC2-7F3E1A"
                }
              }
            }
          },
          "202": {
            "description": "O provedor não confirmou o envio: status \"unknown\" (pode ter saído; não é repetido sozinho).",
            "content": {
              "application/json": {
                "example": {
                  "id": "MSG-MG1ABC2-7F3E1A",
                  "channel": "sms",
                  "status": "unknown",
                  "to": "5511987654321",
                  "reference": "pedido-4521",
                  "segments": 2,
                  "creditsUsed": 2,
                  "createdAt": "2026-09-18T14:02:11.000Z",
                  "statusUrl": "/v1/messages/MSG-MG1ABC2-7F3E1A"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/email/messages": {
      "post": {
        "tags": [
          "Envio para um contato"
        ],
        "x-ocs-method": "messages.email.send",
        "x-ocs-rate-kind": "send",
        "x-ocs-sandbox": "simulated",
        "description": "Método da chave: messages.email.send. Limite por minuto: envio. Sandbox: confere tudo e responde sem enviar, gravar nem cobrar (dryRun).",
        "operationId": "messages_email",
        "parameters": [
          {
            "name": "X-LGPD-Consent-Logged",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Repetir a chamada com o mesmo valor (24 h) devolve o mesmo resultado, sem criar outro.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "to": "carlos@empresa.example",
                "subject": "Proposta exclusiva",
                "text": "Olá Carlos,\npreparamos uma proposta exclusiva para a sua empresa.",
                "reference": "pedido-4521"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "id": "MSG-MG1ABC2-7F3E1A",
                  "channel": "email",
                  "status": "sent",
                  "to": "carlos@empresa.example",
                  "reference": "pedido-4521",
                  "creditsUsed": 1,
                  "createdAt": "2026-09-18T14:02:11.000Z",
                  "statusUrl": "/v1/messages/MSG-MG1ABC2-7F3E1A"
                }
              }
            }
          },
          "202": {
            "description": "O provedor não confirmou o envio: status \"unknown\" (pode ter saído; não é repetido sozinho).",
            "content": {
              "application/json": {
                "example": {
                  "id": "MSG-MG1ABC2-7F3E1A",
                  "channel": "email",
                  "status": "unknown",
                  "to": "carlos@empresa.example",
                  "reference": "pedido-4521",
                  "creditsUsed": 1,
                  "createdAt": "2026-09-18T14:02:11.000Z",
                  "statusUrl": "/v1/messages/MSG-MG1ABC2-7F3E1A"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/voice/calls": {
      "post": {
        "tags": [
          "Envio para um contato"
        ],
        "x-ocs-method": "calls.voice.create",
        "x-ocs-rate-kind": "send",
        "x-ocs-sandbox": "simulated",
        "description": "Método da chave: calls.voice.create. Limite por minuto: envio. Sandbox: confere tudo e responde sem enviar, gravar nem cobrar (dryRun).",
        "operationId": "calls_voice",
        "parameters": [
          {
            "name": "X-LGPD-Consent-Logged",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Repetir a chamada com o mesmo valor (24 h) devolve o mesmo resultado, sem criar outro.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "to": "5511987654321",
                "script": "Olá, aqui é a Ana, da Empresa Exemplo. Preparamos uma proposta para a sua empresa. Posso enviar os detalhes pelo WhatsApp?",
                "reference": "pedido-4521"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "id": "MSG-MG1ABC2-7F3E1A",
                  "channel": "voice",
                  "status": "calling",
                  "to": "5511987654321",
                  "reference": "pedido-4521",
                  "createdAt": "2026-09-18T14:02:11.000Z",
                  "statusUrl": "/v1/messages/MSG-MG1ABC2-7F3E1A"
                }
              }
            }
          },
          "202": {
            "description": "O provedor não confirmou o envio: status \"unknown\" (pode ter saído; não é repetido sozinho).",
            "content": {
              "application/json": {
                "example": {
                  "id": "MSG-MG1ABC2-7F3E1A",
                  "channel": "voice",
                  "status": "unknown",
                  "to": "5511987654321",
                  "reference": "pedido-4521",
                  "createdAt": "2026-09-18T14:02:11.000Z",
                  "statusUrl": "/v1/messages/MSG-MG1ABC2-7F3E1A"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/video/messages": {
      "post": {
        "tags": [
          "Envio para um contato"
        ],
        "x-ocs-method": "messages.video.send",
        "x-ocs-rate-kind": "send",
        "x-ocs-sandbox": "simulated",
        "description": "Método da chave: messages.video.send. Limite por minuto: envio. Sandbox: confere tudo e responde sem enviar, gravar nem cobrar (dryRun).",
        "operationId": "messages_video",
        "parameters": [
          {
            "name": "X-LGPD-Consent-Logged",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Repetir a chamada com o mesmo valor (24 h) devolve o mesmo resultado, sem criar outro.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "to": "5511987654321",
                "script": "Olá Carlos! Gravei este vídeo para apresentar a proposta que preparamos para você.",
                "reference": "pedido-4521"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "id": "MSG-MG1ABC2-7F3E1A",
                  "channel": "video",
                  "status": "processing",
                  "to": "5511987654321",
                  "reference": "pedido-4521",
                  "createdAt": "2026-09-18T14:02:11.000Z",
                  "statusUrl": "/v1/messages/MSG-MG1ABC2-7F3E1A"
                }
              }
            }
          },
          "202": {
            "description": "O provedor não confirmou o envio: status \"unknown\" (pode ter saído; não é repetido sozinho).",
            "content": {
              "application/json": {
                "example": {
                  "id": "MSG-MG1ABC2-7F3E1A",
                  "channel": "video",
                  "status": "unknown",
                  "to": "5511987654321",
                  "reference": "pedido-4521",
                  "createdAt": "2026-09-18T14:02:11.000Z",
                  "statusUrl": "/v1/messages/MSG-MG1ABC2-7F3E1A"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/messages/{messageId}": {
      "get": {
        "tags": [
          "Envio para um contato"
        ],
        "x-ocs-method": "messages.get",
        "x-ocs-rate-kind": "read",
        "x-ocs-sandbox": "real",
        "description": "Método da chave: messages.get. Limite por minuto: leitura. Sandbox: devolve o dado real da conta.",
        "operationId": "messages_status",
        "parameters": [
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "id": "MSG-MG1ABC2-7F3E1A",
                  "channel": "whatsapp",
                  "status": "read",
                  "to": "5511987654321",
                  "reference": "pedido-4521",
                  "creditsUsed": 1,
                  "deliveredAt": "2026-09-18T14:02:14.000Z",
                  "readAt": "2026-09-18T14:05:40.000Z",
                  "createdAt": "2026-09-18T14:02:11.000Z",
                  "statusUrl": "/v1/messages/MSG-MG1ABC2-7F3E1A"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/webhook": {
      "put": {
        "tags": [
          "Webhooks de eventos"
        ],
        "x-ocs-method": "webhook.set",
        "x-ocs-rate-kind": "write",
        "x-ocs-sandbox": "refused",
        "description": "Método da chave: webhook.set. Limite por minuto: alteração. Sandbox: recusado (403 test_key_not_allowed).",
        "operationId": "webhook_set",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "url": "https://suaempresa.example/oneclick/webhook",
                "events": [
                  "message.delivered",
                  "message.read",
                  "message.replied",
                  "contact.blocked"
                ],
                "enabled": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "configured": true,
                  "url": "https://suaempresa.example/oneclick/webhook",
                  "events": [
                    "message.delivered",
                    "message.read",
                    "message.replied",
                    "contact.blocked"
                  ],
                  "enabled": true,
                  "secretHint": "••••Qx7f",
                  "availableEvents": [
                    "message.sent",
                    "message.delivered",
                    "message.read",
                    "message.replied",
                    "message.failed",
                    "message.blocked",
                    "call.completed",
                    "contact.blocked",
                    "payment.confirmed"
                  ],
                  "createdAt": "2026-09-18T14:02:11.000Z",
                  "updatedAt": "2026-09-18T14:02:11.000Z",
                  "secret": "ocs_whsec_9fK2…(guarde: aparece uma vez)Qx7f"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      },
      "get": {
        "tags": [
          "Webhooks de eventos"
        ],
        "x-ocs-method": "webhook.get",
        "x-ocs-rate-kind": "read",
        "x-ocs-sandbox": "real",
        "description": "Método da chave: webhook.get. Limite por minuto: leitura. Sandbox: devolve o dado real da conta.",
        "summary": "Configuração do webhook de eventos da conta (sem o segredo). Escopo \"webhooks\".",
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "configured": true,
                  "url": "https://suaempresa.example/oneclick/webhook",
                  "events": [
                    "message.delivered",
                    "message.read"
                  ],
                  "enabled": true,
                  "secretHint": "••••Qx7f",
                  "availableEvents": [
                    "message.sent",
                    "message.delivered",
                    "message.read",
                    "message.replied",
                    "message.failed",
                    "message.blocked",
                    "call.completed",
                    "contact.blocked",
                    "payment.confirmed"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      },
      "delete": {
        "tags": [
          "Webhooks de eventos"
        ],
        "x-ocs-method": "webhook.delete",
        "x-ocs-rate-kind": "write",
        "x-ocs-sandbox": "refused",
        "description": "Método da chave: webhook.delete. Limite por minuto: alteração. Sandbox: recusado (403 test_key_not_allowed).",
        "summary": "Remove o webhook: os avisos param na hora.",
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "deleted": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/webhook/test": {
      "post": {
        "tags": [
          "Webhooks de eventos"
        ],
        "x-ocs-method": "webhook.test",
        "x-ocs-rate-kind": "write",
        "x-ocs-sandbox": "refused",
        "description": "Método da chave: webhook.test. Limite por minuto: alteração. Sandbox: recusado (403 test_key_not_allowed).",
        "operationId": "webhook_test",
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "deliveryId": "dlv_5c1e9a7b20d4f8e61a3c",
                  "delivered": true,
                  "statusCode": 200,
                  "latencyMs": 182
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/webhook/deliveries": {
      "get": {
        "tags": [
          "Webhooks de eventos"
        ],
        "x-ocs-method": "webhook.deliveries",
        "x-ocs-rate-kind": "read",
        "x-ocs-sandbox": "real",
        "description": "Método da chave: webhook.deliveries. Limite por minuto: leitura. Sandbox: devolve o dado real da conta.",
        "operationId": "webhook_deliveries",
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "deliveries": [
                    {
                      "id": "dlv_5c1e9a7b20d4f8e61a3c",
                      "eventId": "evt_7a0d2c9e41f3b8a5d6e1",
                      "type": "message.read",
                      "status": "delivered",
                      "attempts": 1,
                      "lastStatusCode": 200,
                      "createdAt": "2026-09-18T14:05:41.000Z",
                      "deliveredAt": "2026-09-18T14:05:41.000Z"
                    },
                    {
                      "id": "dlv_0e4b7d2a91c6f3e85b17",
                      "eventId": "evt_1f8c3a6d2b9e47c05a2d",
                      "type": "message.delivered",
                      "status": "pending",
                      "attempts": 2,
                      "lastStatusCode": 503,
                      "lastError": "O seu sistema respondeu HTTP 503.",
                      "createdAt": "2026-09-18T14:02:15.000Z",
                      "nextAttemptAt": "2026-09-18T14:08:15.000Z"
                    }
                  ],
                  "limit": 20
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/blocklist": {
      "post": {
        "tags": [
          "Contatos e lista de bloqueio"
        ],
        "x-ocs-method": "blocklist.add",
        "x-ocs-rate-kind": "write",
        "x-ocs-sandbox": "refused",
        "description": "Método da chave: blocklist.add. Limite por minuto: alteração. Sandbox: recusado (403 test_key_not_allowed).",
        "operationId": "blocklist_add",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "contact": "5511987654321",
                "reason": "Pediu pelo nosso atendimento para não ser mais contatado."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "id": "CB-MG1ABD0-7C21",
                  "contact": "5511987654321",
                  "type": "phone",
                  "reason": "Pediu pelo nosso atendimento para não ser mais contatado.",
                  "createdAt": "2026-09-18 14:12:40",
                  "contactOptOut": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      },
      "get": {
        "tags": [
          "Contatos e lista de bloqueio"
        ],
        "x-ocs-method": "blocklist.list",
        "x-ocs-rate-kind": "read",
        "x-ocs-sandbox": "real",
        "description": "Método da chave: blocklist.list. Limite por minuto: leitura. Sandbox: devolve o dado real da conta.",
        "summary": "Lista de bloqueio da conta, 500 por página (?page=1). Escopo \"contatos\". \"contactOptOut\": o contato pediu para sair (não se desfaz pela API).",
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "page": 1,
                  "pageSize": 500,
                  "totalPages": 1,
                  "total": 1,
                  "blocks": [
                    {
                      "id": "CB-MG1ABD0-7C21",
                      "contact": "5511987654321",
                      "type": "phone",
                      "reason": "O contato respondeu SAIR ao SMS.",
                      "createdAt": "2026-09-18 14:12:40",
                      "contactOptOut": true
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/blocklist/check": {
      "post": {
        "tags": [
          "Contatos e lista de bloqueio"
        ],
        "x-ocs-method": "blocklist.check",
        "x-ocs-rate-kind": "read",
        "x-ocs-sandbox": "real",
        "description": "Método da chave: blocklist.check. Limite por minuto: leitura. Sandbox: devolve o dado real da conta.",
        "operationId": "blocklist_check",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "contact": "5511987654321"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "contact": "5511987654321",
                  "blocked": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/blocklist/{blockId}": {
      "delete": {
        "tags": [
          "Contatos e lista de bloqueio"
        ],
        "x-ocs-method": "blocklist.remove",
        "x-ocs-rate-kind": "write",
        "x-ocs-sandbox": "refused",
        "description": "Método da chave: blocklist.remove. Limite por minuto: alteração. Sandbox: recusado (403 test_key_not_allowed).",
        "summary": "Desfaz um bloqueio feito pela conta. O pedido de SAIR do próprio contato não se desfaz (403 contact_opt_out).",
        "parameters": [
          {
            "name": "blockId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "deleted": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/webhook/rotate-secret": {
      "post": {
        "tags": [
          "Webhooks de eventos"
        ],
        "x-ocs-method": "webhook.rotateSecret",
        "x-ocs-rate-kind": "write",
        "x-ocs-sandbox": "refused",
        "description": "Método da chave: webhook.rotateSecret. Limite por minuto: alteração. Sandbox: recusado (403 test_key_not_allowed).",
        "summary": "Troca o segredo da assinatura; o novo vale na hora e aparece só nesta resposta.",
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "configured": true,
                  "url": "https://suaempresa.example/oneclick/webhook",
                  "enabled": true,
                  "secretHint": "••••m2Pa",
                  "secret": "ocs_whsec_Lp0…(guarde: aparece uma vez)m2Pa"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/dispatches": {
      "get": {
        "tags": [
          "Disparo em massa"
        ],
        "x-ocs-method": "dispatches.list",
        "x-ocs-rate-kind": "read",
        "x-ocs-sandbox": "real",
        "description": "Método da chave: dispatches.list. Limite por minuto: leitura. Sandbox: devolve o dado real da conta.",
        "summary": "Últimos disparos da conta (?limit=1..50). Recupera o dispatchId depois de um tempo esgotado.",
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "dispatches": [
                    {
                      "id": "DISP-M1ABC2-9F3E1A",
                      "status": "running",
                      "total": 2,
                      "processed": 1,
                      "counts": {
                        "sent": 1,
                        "failed": 0,
                        "blocked": 0,
                        "no_credits": 0,
                        "skipped": 0
                      },
                      "resultsUrl": "/v1/dispatches/DISP-M1ABC2-9F3E1A/results"
                    }
                  ],
                  "limit": 20
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/dispatches/{dispatchId}/results": {
      "get": {
        "tags": [
          "Disparo em massa"
        ],
        "x-ocs-method": "dispatches.results",
        "x-ocs-rate-kind": "read",
        "x-ocs-sandbox": "real",
        "description": "Método da chave: dispatches.results. Limite por minuto: leitura. Sandbox: devolve o dado real da conta.",
        "summary": "Desfecho de cada contato × canal, em páginas de 50 (?page=1), na ordem de envio.",
        "parameters": [
          {
            "name": "dispatchId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "dispatchId": "DISP-M1ABC2-9F3E1A",
                  "status": "done",
                  "processed": 2,
                  "total": 2,
                  "page": 1,
                  "pageSize": 50,
                  "totalPages": 1,
                  "items": [
                    {
                      "index": 0,
                      "contact": "5511987654321",
                      "channel": "whatsapp",
                      "outcome": "sent"
                    },
                    {
                      "index": 1,
                      "contact": "5511987654321",
                      "channel": "sms",
                      "outcome": "no_credits",
                      "detail": "Créditos insuficientes."
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/messages": {
      "get": {
        "tags": [
          "Envio para um contato"
        ],
        "x-ocs-method": "messages.list",
        "x-ocs-rate-kind": "read",
        "x-ocs-sandbox": "real",
        "description": "Método da chave: messages.list. Limite por minuto: leitura. Sandbox: devolve o dado real da conta.",
        "summary": "Últimos envios para um contato (?limit=1..50), com o status do momento do envio. Recupera o id depois de um tempo esgotado; o status atual sai em statusUrl.",
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "messages": [
                    {
                      "id": "MSG-MG1ABC2-7F3E1A",
                      "channel": "sms",
                      "status": "sent",
                      "to": "5511987654321",
                      "reference": "pedido-4521",
                      "segments": 1,
                      "creditsUsed": 1,
                      "createdAt": "2026-09-18T14:02:11.000Z",
                      "statusUrl": "/v1/messages/MSG-MG1ABC2-7F3E1A"
                    }
                  ],
                  "limit": 20
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/channels": {
      "get": {
        "tags": [
          "Números de WhatsApp"
        ],
        "x-ocs-method": "channels.list",
        "x-ocs-rate-kind": "read",
        "x-ocs-sandbox": "real",
        "description": "Método da chave: channels.list. Limite por minuto: leitura. Sandbox: devolve o dado real da conta.",
        "summary": "Números de WhatsApp da conta e se estão conectados.",
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "whatsapp": [
                    {
                      "instanceName": "api_4f9c2b1e",
                      "connected": true,
                      "phone": "5511987654321",
                      "status": "CONNECTED"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1": {
      "get": {
        "tags": [
          "Conta, plano e limites"
        ],
        "x-ocs-method": "api.index",
        "x-ocs-rate-kind": "read",
        "x-ocs-sandbox": "real",
        "description": "Método da chave: api.index (toda chave chama). Limite por minuto: leitura. Sandbox: devolve o dado real da conta.",
        "summary": "Índice da API: ambiente da chave (produção ou sandbox), os métodos que ela pode chamar e os limites dela. Toda chave válida chama.",
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "api": "OneClick Sales — API pública",
                  "version": "v1",
                  "environment": "production",
                  "key": {
                    "id": "3f9a2c71b0de",
                    "label": "ERP",
                    "methods": [
                      "account.read",
                      "messages.sms.send"
                    ],
                    "allowedIps": []
                  },
                  "rateLimits": {
                    "perMinute": {
                      "read": 60,
                      "write": 60,
                      "send": 120
                    },
                    "perDay": 50000
                  },
                  "areas": [
                    {
                      "area": "conta",
                      "methods": [
                        {
                          "id": "account.read",
                          "http": "GET",
                          "path": "/v1/account",
                          "area": "conta",
                          "kind": "read",
                          "sandbox": "real",
                          "summary": "Conta e plano",
                          "allowed": true
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/account": {
      "get": {
        "tags": [
          "Conta, plano e limites"
        ],
        "x-ocs-method": "account.read",
        "x-ocs-rate-kind": "read",
        "x-ocs-sandbox": "real",
        "description": "Método da chave: account.read. Limite por minuto: leitura. Sandbox: devolve o dado real da conta.",
        "summary": "Conta e plano: em vigor, vencendo (7 dias) ou vencido, validade e dias restantes, cadastro da empresa e se a conta pode enviar (\"blockedBy\").",
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "environment": "production",
                  "account": {
                    "companyName": "Empresa Exemplo Ltda",
                    "tradeName": "Exemplo",
                    "status": "active"
                  },
                  "plan": {
                    "id": "plan_anual",
                    "cycle": "anual",
                    "name": "Plano Start Anual",
                    "status": "active",
                    "inForce": true,
                    "expiresAt": "2027-10-05",
                    "daysRemaining": 364,
                    "renewWith": "POST /v1/billing/renew-plan"
                  },
                  "billingProfile": {
                    "complete": true,
                    "missing": []
                  },
                  "sending": {
                    "allowed": true,
                    "blockedBy": [],
                    "message": "A conta pode enviar (ainda valem a janela de envio, o saldo e as travas de cada contato)."
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/account/limits": {
      "get": {
        "tags": [
          "Conta, plano e limites"
        ],
        "x-ocs-method": "account.limits",
        "x-ocs-rate-kind": "read",
        "x-ocs-sandbox": "real",
        "description": "Método da chave: account.limits. Limite por minuto: leitura. Sandbox: devolve o dado real da conta.",
        "summary": "Limites que valem agora: chamadas da API por minuto (leitura, alteração, envio) e por dia com o uso de hoje, janela de envio, uma abordagem por dia, tetos por disparo e campanha, e o limite diário de cada número de WhatsApp.",
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "environment": "production",
                  "api": {
                    "perMinute": {
                      "read": 60,
                      "write": 60,
                      "send": 120
                    },
                    "perMinuteSource": {
                      "read": "platform",
                      "write": "platform",
                      "send": "platform"
                    },
                    "perDay": 50000,
                    "usedToday": 1280,
                    "remainingToday": 48720,
                    "resetsInSeconds": 30240,
                    "activeKeys": 2,
                    "maxKeys": 10
                  },
                  "sendWindow": {
                    "channels": [
                      "whatsapp",
                      "sms",
                      "voice"
                    ],
                    "timeZone": "America/Sao_Paulo",
                    "ranges": [
                      {
                        "from": "08:00",
                        "to": "12:00"
                      },
                      {
                        "from": "13:30",
                        "to": "22:00"
                      }
                    ],
                    "openNow": true,
                    "nextOpenAt": null
                  },
                  "outreach": {
                    "perContactPerChannelPerDay": 1
                  },
                  "dispatch": {
                    "maxContactsPerMassDispatch": 30000,
                    "maxActiveMassDispatches": 3,
                    "maxRecipientsPerCampaign": 30000,
                    "maxContactsPerList": 300000,
                    "smsMaxSegments": 10
                  },
                  "whatsapp": {
                    "dailyLimitPerNumberByAge": [
                      {
                        "upToDays": 1,
                        "dailyLimit": 40
                      },
                      {
                        "upToDays": null,
                        "dailyLimit": 500
                      }
                    ],
                    "minSecondsBetweenMessagesPerNumber": 2.5
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/account/health": {
      "get": {
        "tags": [
          "Erros, falhas e uso da API"
        ],
        "x-ocs-method": "account.health",
        "x-ocs-rate-kind": "read",
        "x-ocs-sandbox": "real",
        "description": "Método da chave: account.health. Limite por minuto: leitura. Sandbox: devolve o dado real da conta.",
        "summary": "Diagnóstico da conta: o que impede ou vai impedir o funcionamento (plano, cadastro, saldo, números de WhatsApp, webhook, campanhas pausadas, erros da API de hoje). \"status\": ok, warning ou critical.",
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "status": "warning",
                  "checkedAt": "2026-10-06T14:02:11.000Z",
                  "environment": "production",
                  "checks": [
                    {
                      "id": "plan",
                      "level": "warning",
                      "message": "O plano vence em 5 dia(s) (2026-10-11).",
                      "action": "POST /v1/billing/renew-plan"
                    },
                    {
                      "id": "whatsapp_numbers",
                      "level": "warning",
                      "message": "1 de 3 números de WhatsApp desconectados (os outros seguem enviando)."
                    },
                    {
                      "id": "credits",
                      "level": "ok",
                      "message": "Há saldo disponível nos canais."
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/account/api-usage": {
      "get": {
        "tags": [
          "Erros, falhas e uso da API"
        ],
        "x-ocs-method": "account.apiUsage",
        "x-ocs-rate-kind": "read",
        "x-ocs-sandbox": "real",
        "description": "Método da chave: account.apiUsage. Limite por minuto: leitura. Sandbox: devolve o dado real da conta.",
        "summary": "Uso da API por dia, método e chave (?days=1..90): chamadas, sucesso, erros 4xx/5xx e recusas por limite (429), com o tempo médio por método.",
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "days": 7,
                  "environment": "production",
                  "totals": {
                    "count": 4210,
                    "ok": 4105,
                    "e4xx": 92,
                    "e5xx": 1,
                    "limited": 12
                  },
                  "byDay": [
                    {
                      "date": "2026-10-06",
                      "count": 610,
                      "ok": 598,
                      "e4xx": 10,
                      "e5xx": 0,
                      "limited": 2
                    }
                  ],
                  "byMethod": [
                    {
                      "method": "messages.whatsapp.send",
                      "count": 1820,
                      "ok": 1790,
                      "e4xx": 28,
                      "e5xx": 0,
                      "limited": 2,
                      "avgMs": 640
                    }
                  ],
                  "byKey": [
                    {
                      "keyId": "3f9a2c71b0de",
                      "count": 4210,
                      "ok": 4105,
                      "e4xx": 92,
                      "e5xx": 1,
                      "limited": 12,
                      "environment": "production"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/account/api-errors": {
      "get": {
        "tags": [
          "Erros, falhas e uso da API"
        ],
        "x-ocs-method": "account.apiErrors",
        "x-ocs-rate-kind": "read",
        "x-ocs-sandbox": "real",
        "description": "Método da chave: account.apiErrors. Limite por minuto: leitura. Sandbox: devolve o dado real da conta.",
        "summary": "Últimas chamadas da API que deram erro (?limit=1..200; ?key=current só desta chave), com o código, a mensagem e o id da requisição (X-Request-Id). Guardadas por 30 dias.",
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "limit": 50,
                  "retentionDays": 30,
                  "errors": [
                    {
                      "at": "2026-10-06T13:58:02.000Z",
                      "method": "messages.sms.send",
                      "http": "POST",
                      "path": "/v1/sms/messages",
                      "status": 409,
                      "error": "outside_send_window",
                      "message": "Fora da janela de envio.",
                      "requestId": "a1b2c3d4e5f6",
                      "keyId": "3f9a2c71b0de",
                      "environment": "production"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    },
    "/v1/billing/payments/{paymentId}": {
      "get": {
        "tags": [
          "Cobrança"
        ],
        "x-ocs-method": "billing.paymentStatus",
        "x-ocs-rate-kind": "read",
        "x-ocs-sandbox": "real",
        "description": "Método da chave: billing.paymentStatus. Limite por minuto: leitura. Sandbox: devolve o dado real da conta.",
        "summary": "Status de uma cobrança Pix (guardado por 20 s; consulte a cada 5 a 10 s).",
        "parameters": [
          {
            "name": "paymentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "example": {
                  "paymentId": "1325678955",
                  "status": "approved",
                  "paid": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        }
      }
    }
  }
}
