---
title: "Mensagens · Referência REST"
description: "As rotas de Mensagens. Todo corpo é JSON, e o erro sempre volta como um objeto com código e mensagem."
lang: "pt-BR"
canonical: "https://zaiped.com/developers/docs/reference/messages"
alternate: "https://zaiped.com/en/developers/docs/reference/messages"
---

# Mensagens · Referência REST

## POST /v1/messages

Send a message

Sends any message type the Cloud API supports (text, media, location, contacts, reaction, interactive buttons and lists, CTA URL, carousel, flow, product, template). Free-form messages need an open 24-hour window with the recipient; templates do not. Media is referenced by the `mediaId` returned by upload_media (`media: { path }`) or by a public `link`.

**Corpo da requisição**

- `numberId` · string (Obrigatório): Zaiped id (whatsappConnections)
- `to` · string (Obrigatório)
- `message` · object (Obrigatório)
- `contextWamid` · string

**message.type = "text"**

- `text` · string (Obrigatório)
- `previewUrl` · boolean

**message.type = "image" | "video" | "audio" | "document" | "sticker"**

- `media` · object (Obrigatório)
- `caption` · string
- `fileName` · string

**message.type = "location"**

- `latitude` · number (Obrigatório)
- `longitude` · number (Obrigatório)
- `name` · string
- `address` · string

**message.type = "contacts"**

- `contacts` · object[] (Obrigatório)

**message.type = "reaction"**

- `wamid` · string (Obrigatório)
- `emoji` · string (Obrigatório)

**message.type = "buttons"**

- `header` · object
- `body` · string (Obrigatório)
- `footer` · string
- `buttons` · object[] (Obrigatório)

**message.type = "list"**

- `header` · string
- `body` · string (Obrigatório)
- `footer` · string
- `button` · string (Obrigatório)
- `sections` · object[] (Obrigatório)

**message.type = "cta_url"**

- `header` · object
- `body` · string (Obrigatório)
- `footer` · string
- `buttonText` · string (Obrigatório)
- `url` · string (Obrigatório)

**message.type = "carousel"**

- `body` · string (Obrigatório)
- `mediaKind` · "image" | "video" (Obrigatório)
- `cardButton` · "url" | "reply" (Obrigatório)
- `cards` · object[] (Obrigatório)

**message.type = "location_request"**

- `body` · string (Obrigatório)

**message.type = "flow"**

- `flowId` · string (Obrigatório): Zaiped id (flows)
- `header` · object
- `body` · string (Obrigatório)
- `footer` · string
- `cta` · string (Obrigatório)

**message.type = "product"**

- `body` · string
- `footer` · string
- `retailerId` · string (Obrigatório)

**message.type = "product_list"**

- `header` · string (Obrigatório)
- `body` · string (Obrigatório)
- `footer` · string
- `sections` · object[] (Obrigatório)

**message.type = "catalog_message"**

- `body` · string (Obrigatório)
- `footer` · string
- `thumbnailRetailerId` · string

**message.type = "call_permission"**

- `body` · string (Obrigatório)

**message.type = "template"**

- `templateId` · string (Obrigatório): Zaiped id (templates)
- `values` · object (Obrigatório)

**Resposta (object)**

- `wamid` · string (Obrigatório)
- `to` · string (Obrigatório)
- `status` · "accepted" | "held_for_quality_assessment" (Obrigatório)

```
curl -X POST "https://zaiped.com/v1/messages" \
  -H "Authorization: Bearer zp_..." \
  -H "Content-Type: application/json" \
  -d '{
  "numberId": "…",
  "to": "…",
  "message": {
    "type": "text",
    "text": "…"
  }
}'
```

## POST /v1/messages/{wamid}/read

Mark a received message as read

Optionally shows the typing indicator for up to 25 seconds.

**Parâmetros de caminho**

- `wamid` · string (Obrigatório): The WhatsApp message id (`wamid`) of the received message.

**Corpo da requisição**

- `numberId` · string (Obrigatório): Zaiped id (whatsappConnections)
- `typing` · boolean

**Resposta (object)**

- `ok` · true (Obrigatório)

```
curl -X POST "https://zaiped.com/v1/messages/YOUR_WAMID/read" \
  -H "Authorization: Bearer zp_..." \
  -H "Content-Type: application/json" \
  -d '{
  "numberId": "…"
}'
```

## POST /v1/blocked

Block a phone number

Meta only allows blocking users who messaged the number in the last 24 hours.

**Corpo da requisição**

- `numberId` · string (Obrigatório): Zaiped id (whatsappConnections)
- `phone` · string (Obrigatório)

**Resposta (object)**

- `ok` · true (Obrigatório)

```
curl -X POST "https://zaiped.com/v1/blocked" \
  -H "Authorization: Bearer zp_..." \
  -H "Content-Type: application/json" \
  -d '{
  "numberId": "…",
  "phone": "…"
}'
```

## DELETE /v1/blocked/{numberId}/{phone}

Unblock a phone number

**Parâmetros de caminho**

- `numberId` · string (Obrigatório): The number id, as returned by list_numbers.
- `phone` · string (Obrigatório): The phone in E.164 (`5511999999999`).

**Resposta (object)**

- `ok` · true (Obrigatório)

```
curl -X DELETE "https://zaiped.com/v1/blocked/YOUR_NUMBER_ID/YOUR_PHONE" \
  -H "Authorization: Bearer zp_..."
```