> ## Documentation Index
> Fetch the complete documentation index at: https://docs.d-api.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Disparar chamada do agente (URL pública do gatilho)

> Público por design: o token da URL é a credencial (sem API key). Crie o gatilho no painel.

Corpo JSON (até 16 KB): `phone` (com DDI; número BR sem DDI recebe 55), `sessionId` opcional (padrão do gatilho), `variables` opcional (só as variáveis declaradas no agente; até 30, valores até 500 caracteres). Também aceita chaves planas `"variables.<nome>": valor` no topo (o objeto `variables` prevalece em conflito).

Assinatura (quando o gatilho exige): `X-DAPI-Signature: t=<unix>,v1=<hex HMAC-SHA256(segredo, t + "." + corpo)>`, tolerância de 300 s.

`Idempotency-Key` (até 128): repetições em 24 h recebem a mesma resposta. Sem ela, o mesmo telefone + variáveis em 60 s também.

Fora da janela de horário do gatilho a chamada é agendada para a próxima abertura (`status: "scheduled"`).

Erros: 404 `not_found`, 423 `trigger_paused`, 401 `invalid_signature`, 400 `invalid_input`/`missing_variables`, 403 `session_not_allowed`/`country_not_allowed`, 409 `agent_not_published`/`request_in_progress`, 402 `insufficient_balance`/`daily_cap_reached`, 413 `payload_too_large`, 429 `rate_limited` (com `retryAfterSec` e Retry-After)/`queue_full`.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/hooks/va/{token}
openapi: 3.1.0
info:
  title: D-API - Infraestrutura WhatsApp Completa
  description: >-
    Solução escalável e robusta para gestores de automação, SaaS e usuários
    finais que precisam de uma integração WhatsApp confiável. Oferece múltiplas
    instâncias simultâneas, webhooks em tempo real, dashboard intuitivo e API
    REST documentada com 99.9% de uptime e latência inferior a 30ms.
  version: 1.2.1
  contact:
    name: Suporte D-API
    email: suporte@d-api.cloud
    url: https://d-api.cloud
servers:
  - url: https://api.d-api.cloud
    description: Produção
security:
  - ApiKeyAuth: []
tags:
  - name: Início
    description: Endpoints base
  - name: Sessões
    description: Endpoints para gerenciamento de sessões
  - name: Mensagens
    description: Endpoints para envio de mensagens
  - name: Cloud API
    description: >-
      WhatsApp API Oficial (Meta Cloud API): conexão manual, gestão de templates
      (listar/criar/excluir) e envio de templates.
  - name: Ligações URA
    description: >-
      Disparo de ligações de voz (URA): individual ou em massa, com áudio ou
      fluxo IVR.
  - name: SMS
    description: 'Envio de SMS: individual ou em massa.'
  - name: Comandos
    description: >-
      Consulta de comandos assíncronos (async: true) pelo commandId retornado no
      enfileiramento.
paths:
  /api/v1/hooks/va/{token}:
    post:
      tags:
        - Agentes de voz — gatilhos
      summary: Disparar chamada do agente (URL pública do gatilho)
      description: >-
        Público por design: o token da URL é a credencial (sem API key). Crie o
        gatilho no painel.


        Corpo JSON (até 16 KB): `phone` (com DDI; número BR sem DDI recebe 55),
        `sessionId` opcional (padrão do gatilho), `variables` opcional (só as
        variáveis declaradas no agente; até 30, valores até 500 caracteres).
        Também aceita chaves planas `"variables.<nome>": valor` no topo (o
        objeto `variables` prevalece em conflito).


        Assinatura (quando o gatilho exige): `X-DAPI-Signature: t=<unix>,v1=<hex
        HMAC-SHA256(segredo, t + "." + corpo)>`, tolerância de 300 s.


        `Idempotency-Key` (até 128): repetições em 24 h recebem a mesma
        resposta. Sem ela, o mesmo telefone + variáveis em 60 s também.


        Fora da janela de horário do gatilho a chamada é agendada para a próxima
        abertura (`status: "scheduled"`).


        Erros: 404 `not_found`, 423 `trigger_paused`, 401 `invalid_signature`,
        400 `invalid_input`/`missing_variables`, 403
        `session_not_allowed`/`country_not_allowed`, 409
        `agent_not_published`/`request_in_progress`, 402
        `insufficient_balance`/`daily_cap_reached`, 413 `payload_too_large`, 429
        `rate_limited` (com `retryAfterSec` e Retry-After)/`queue_full`.
      operationId: postApiV1HooksVaByToken
      parameters:
        - schema:
            type: string
          in: path
          name: token
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - phone
              properties:
                phone:
                  oneOf:
                    - type: string
                    - type: number
                  example: '5511999990000'
                sessionId:
                  type: string
                variables:
                  type: object
                  additionalProperties:
                    oneOf:
                      - type: string
                      - type: number
                      - type: boolean
      responses:
        '202':
          description: Chamada na fila ou agendada
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      success:
                        type: boolean
                      callId:
                        type: string
                      status:
                        type: string
                        enum:
                          - queued
                      queuePosition:
                        type:
                          - integer
                          - 'null'
                  - type: object
                    properties:
                      success:
                        type: boolean
                      status:
                        type: string
                        enum:
                          - scheduled
                      scheduledFor:
                        type: string
                        format: date-time
                      requestId:
                        type: string
        '400':
          description: invalid_input / missing_variables
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  code:
                    type: string
                  message:
                    type: string
        '401':
          description: invalid_signature
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  code:
                    type: string
                  message:
                    type: string
        '402':
          description: insufficient_balance / daily_cap_reached
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  code:
                    type: string
                  message:
                    type: string
        '403':
          description: session_not_allowed / country_not_allowed
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  code:
                    type: string
                  message:
                    type: string
        '404':
          description: Gatilho inexistente ou revogado
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  code:
                    type: string
                  message:
                    type: string
        '409':
          description: agent_not_published / request_in_progress
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  code:
                    type: string
                  message:
                    type: string
        '413':
          description: payload_too_large
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  code:
                    type: string
                  message:
                    type: string
        '423':
          description: trigger_paused
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  code:
                    type: string
                  message:
                    type: string
        '429':
          description: rate_limited / queue_full
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  code:
                    type: string
                  message:
                    type: string
      security: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'API Key para autenticação. Formato: <API_KEY>'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.