Inbox

URL base da API
https://crm.vdgestaobranding.com/api/v1

A documentação fica em developers.vdgestaobranding.com, mas todas as chamadas vão para crm.vdgestaobranding.com/api/v1.

GET/conversations
inbox:read

Listar conversas

  • phone_number_ref — ID do número no CRM.
  • status — open | closed.
  • assignee_id — Atendente.
  • tag — Tag do contato.
  • unread — true para não lidas.
  • since — ISO 8601 (última mensagem a partir de).
  • until — ISO 8601.
  • limit — Itens por página (1–100, padrão 25).
  • cursor — Valor de next_cursor da página anterior.
curl -X GET "https://crm.vdgestaobranding.com/api/v1/conversations" \
  -H "Authorization: Bearer $VDCRM_API_KEY"
Resposta 200
{
  "data": [
    {
      "id": "9f1e…",
      "contact_id": "c1d2…",
      "phone_number_ref": "a0b1…",
      "status": "aberta",
      "assignee_id": null,
      "unread_count": 2,
      "last_message_at": "2026-11-03T15:02:00Z",
      "window_open": true
    }
  ],
  "next_cursor": null
}
GET/conversations/{id}
inbox:read

Obter conversa

curl -X GET "https://crm.vdgestaobranding.com/api/v1/conversations/{id}" \
  -H "Authorization: Bearer $VDCRM_API_KEY"
Resposta 200
{
  "id": "9f1e…",
  "contact_id": "c1d2…",
  "phone_number_ref": "a0b1…",
  "status": "aberta",
  "assignee_id": null,
  "unread_count": 2,
  "last_message_at": "2026-11-03T15:02:00Z",
  "window_open": true
}
GET/conversations/{id}/messages
inbox:read

Listar mensagens

  • limit — Itens por página (1–100, padrão 25).
  • cursor — Valor de next_cursor da página anterior.
curl -X GET "https://crm.vdgestaobranding.com/api/v1/conversations/{id}/messages" \
  -H "Authorization: Bearer $VDCRM_API_KEY"
Resposta 200
{
  "data": [
    {
      "id": "m1…",
      "direction": "inbound",
      "type": "text",
      "content": {
        "text": "Olá!"
      },
      "status": "received",
      "created_at": "2026-11-03T15:02:00Z"
    }
  ],
  "next_cursor": null
}
POST/conversations/{id}/messages
inbox:write
Idempotency-Key

Enviar mensagem na conversa

type: text | media | template. Texto e mídia só com a janela de 24h aberta; fora dela use um modelo aprovado.

curl -X POST "https://crm.vdgestaobranding.com/api/v1/conversations/{id}/messages" \
  -H "Authorization: Bearer $VDCRM_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "text",
  "text": "Olá, Maria! Seu pedido foi enviado."
}'
Resposta 201
{
  "id": "m2…",
  "wamid": "wamid.HBg…",
  "status": "sent"
}
POST/messages
inbox:write
Idempotency-Key

Enviar mensagem para um telefone

Cria o contato e a conversa se necessário. Para iniciar conversa use um modelo aprovado.

curl -X POST "https://crm.vdgestaobranding.com/api/v1/messages" \
  -H "Authorization: Bearer $VDCRM_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "phone_number_ref": "a0b1…",
  "to": "5511999998888",
  "type": "template",
  "name": "pedido_enviado",
  "language": "pt_BR",
  "variables": [
    "Maria",
    "#1234"
  ]
}'
Resposta 201
{
  "id": "m3…",
  "wamid": "wamid.HBg…",
  "status": "sent"
}
POST/conversations/{id}/read
inbox:write

Marcar como lida

curl -X POST "https://crm.vdgestaobranding.com/api/v1/conversations/{id}/read" \
  -H "Authorization: Bearer $VDCRM_API_KEY"
Resposta 200
{
  "id": "9f1e…",
  "contact_id": "c1d2…",
  "phone_number_ref": "a0b1…",
  "status": "aberta",
  "assignee_id": null,
  "unread_count": 2,
  "last_message_at": "2026-11-03T15:02:00Z",
  "window_open": true
}
POST/conversations/{id}/close
inbox:write

Finalizar

curl -X POST "https://crm.vdgestaobranding.com/api/v1/conversations/{id}/close" \
  -H "Authorization: Bearer $VDCRM_API_KEY"
Resposta 200
{
  "id": "9f1e…",
  "contact_id": "c1d2…",
  "phone_number_ref": "a0b1…",
  "status": "aberta",
  "assignee_id": null,
  "unread_count": 2,
  "last_message_at": "2026-11-03T15:02:00Z",
  "window_open": true
}
POST/conversations/{id}/reopen
inbox:write

Reabrir

curl -X POST "https://crm.vdgestaobranding.com/api/v1/conversations/{id}/reopen" \
  -H "Authorization: Bearer $VDCRM_API_KEY"
Resposta 200
{
  "id": "9f1e…",
  "contact_id": "c1d2…",
  "phone_number_ref": "a0b1…",
  "status": "aberta",
  "assignee_id": null,
  "unread_count": 2,
  "last_message_at": "2026-11-03T15:02:00Z",
  "window_open": true
}
POST/conversations/{id}/archive
inbox:write

Arquivar

curl -X POST "https://crm.vdgestaobranding.com/api/v1/conversations/{id}/archive" \
  -H "Authorization: Bearer $VDCRM_API_KEY"
Resposta 200
{
  "id": "9f1e…",
  "contact_id": "c1d2…",
  "phone_number_ref": "a0b1…",
  "status": "aberta",
  "assignee_id": null,
  "unread_count": 2,
  "last_message_at": "2026-11-03T15:02:00Z",
  "window_open": true
}
POST/conversations/{id}/assign
inbox:write

Atribuir atendente

curl -X POST "https://crm.vdgestaobranding.com/api/v1/conversations/{id}/assign" \
  -H "Authorization: Bearer $VDCRM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "assignee_id": "u1…"
}'
Resposta 200
{
  "id": "9f1e…",
  "contact_id": "c1d2…",
  "phone_number_ref": "a0b1…",
  "status": "aberta",
  "assignee_id": null,
  "unread_count": 2,
  "last_message_at": "2026-11-03T15:02:00Z",
  "window_open": true
}