# Webhook Chatwoot

`POST /chatwoot/webhook`

Pasta: **Integração Chatwoot**

## Autenticação

```http
token: {{token}}
```

## Descrição

# Webhook Chatwoot

Recebe eventos do Chatwoot (mensagens criadas, atualizações etc.) e processa envio/sincronização com o WhatsApp.

## Endpoint

``` http
POST {{baseUrl}}/chatwoot/webhook
```

## Autenticação

``` http
token: {{token}}
```

## Corpo

``` json
{
  "event": "message_created",
  "account": { "id": 1 },
  "conversation": { "id": 1 },
  "message": {}
}
```

## Resposta

``` json
{
  "success": true,
  "result": { "handled": true, "action": "..." }
}
```

## Observações

Configure esta URL no Chatwoot apontando para a instância. O corpo segue o payload nativo do Chatwoot.

## Corpo (exemplo)

```json
{
  "event": "message_created",
  "id": 42,
  "content": "Olá pelo Chatwoot",
  "message_type": "outgoing",
  "private": false,
  "conversation": {
    "id": 1,
    "inbox_id": 1
  },
  "sender": {
    "name": "Agente",
    "type": "user"
  }
}
```

## cURL

```bash
curl -X POST "{{baseUrl}}/chatwoot/webhook" \
  -H "token: {{token}}" \
  -H "Content-Type: application/json" \
  -d '{
  "event": "message_created",
  "id": 42,
  "content": "Olá pelo Chatwoot",
  "message_type": "outgoing",
  "private": false,
  "conversation": {
    "id": 1,
    "inbox_id": 1
  },
  "sender": {
    "name": "Agente",
    "type": "user"
  }
}'
```

---

[Índice da pasta](./index.md) · [Índice geral](../index.md) · [UI](https://gozap.dev/docs?op=integracao-chatwoot/webhook-chatwoot)
