Skip to main content
O webhook de mensagens é disparado sempre que uma nova mensagem é recebida ou enviada em uma conversa.

Payload do Webhook

Quando um evento de mensagem ocorre, a Multchats envia um POST para sua URL configurada com o seguinte payload:
{
  "type": "message",
  "integrationId": "cm5abc123def456",
  "chat": {
    "id": "cm5xyz789ghi012",
    "name": "João Silva",
    "chatId": "5511999998888@c.us",
    "picture": "https://example.com/photo.jpg",
    "type": "individual",
    "sectorId": "cm5sector123",
    "status": "open",
    "attendantId": "cm5attendant456",
    "lastMessageId": "cm5msg789",
    "lastMessageAt": "2024-01-15T10:30:00.000Z",
    "createdAt": "2024-01-10T08:00:00.000Z"
  },
  "message": {
    "id": "cm5msg789",
    "type": "text",
    "ack": 2,
    "content": "Olá, preciso de ajuda!",
    "chatInternalId": "cm5xyz789ghi012",
    "options": {},
    "direction": "inbound",
    "messageId": "3EB0ABC123DEF456",
    "messageAt": "2024-01-15T10:30:00.000Z",
    "createdAt": "2024-01-15T10:30:01.000Z",
    "updatedAt": "2024-01-15T10:30:01.000Z"
  }
}