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

# Enviar mensagens

> Texto, imagem, vídeo, voz, áudio, arquivo, reação e presença.

A sessão vai em `session` no corpo (ou `?session=`). Se existe uma única sessão, pode omitir.

| Rota | Corpo |
| - | - |
| `POST /api/sendText` | `{"session","chatId","text","reply_to"}` |
| `POST /api/sendImage` `sendVideo` `sendVoice` `sendAudio` `sendFile` `sendSticker` | `{"session","chatId","file":{"mimetype","filename","data"\|"url"},"caption"}` |
| `PUT /api/reaction` | `{"session","messageId","reaction":"👍"}` |
| `POST /api/startTyping`, `/api/stopTyping` | `{"session","chatId"}` |
| `POST /api/{sessão}/presence` | `{"chatId","presence":"typing"\|"recording"\|"paused"\|"online"\|"offline"}` |

`chatId`: `5511999990000@c.us` (pessoa), `1203...@g.us` (grupo), `...@lid`.

## Antes de enviar: o número existe?

```bash theme={null}
curl -H "X-Api-Key: $KEY" "localhost:8080/api/contacts/check-exists?session=suporte&phone=5511999990000"
# {"numberExists":true,"chatId":"5511999990000@c.us"}
```

O `chatId` devolvido já resolve o nono dígito do Brasil. Use-o no envio.

## Resposta

Os ids de mensagem seguem o formato do WAHA: `true_5511999990000@c.us_3EB0...`.

## Erros

| Código | Quando |
| - | - |
| `400` | `chatId` ou corpo inválido |
| `404` | sessão inexistente |
| `503` | sessão sem conexão (`WhatsApp não conectado (<estado>)`) |
| `502` | o WhatsApp recusou |


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