---
title: "Messages · REST reference"
description: "The Messages routes. Every body is JSON, and an error always comes back as an object with a code and a message."
lang: "en-US"
canonical: "https://zaiped.com/en/developers/docs/reference/messages"
alternate: "https://zaiped.com/developers/docs/reference/messages"
---

# Messages · REST reference

## 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`.

**Request body**

- `numberId` · string (Required): Zaiped id (whatsappConnections)
- `to` · string (Required)
- `message` · object (Required)
- `contextWamid` · string

**message.type = "text"**

- `text` · string (Required)
- `previewUrl` · boolean

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

- `media` · object (Required)
- `caption` · string
- `fileName` · string

**message.type = "location"**

- `latitude` · number (Required)
- `longitude` · number (Required)
- `name` · string
- `address` · string

**message.type = "contacts"**

- `contacts` · object[] (Required)

**message.type = "reaction"**

- `wamid` · string (Required)
- `emoji` · string (Required)

**message.type = "buttons"**

- `header` · object
- `body` · string (Required)
- `footer` · string
- `buttons` · object[] (Required)

**message.type = "list"**

- `header` · string
- `body` · string (Required)
- `footer` · string
- `button` · string (Required)
- `sections` · object[] (Required)

**message.type = "cta_url"**

- `header` · object
- `body` · string (Required)
- `footer` · string
- `buttonText` · string (Required)
- `url` · string (Required)

**message.type = "carousel"**

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

**message.type = "location_request"**

- `body` · string (Required)

**message.type = "flow"**

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

**message.type = "product"**

- `body` · string
- `footer` · string
- `retailerId` · string (Required)

**message.type = "product_list"**

- `header` · string (Required)
- `body` · string (Required)
- `footer` · string
- `sections` · object[] (Required)

**message.type = "catalog_message"**

- `body` · string (Required)
- `footer` · string
- `thumbnailRetailerId` · string

**message.type = "call_permission"**

- `body` · string (Required)

**message.type = "template"**

- `templateId` · string (Required): Zaiped id (templates)
- `values` · object (Required)

**Response (object)**

- `wamid` · string (Required)
- `to` · string (Required)
- `status` · "accepted" | "held_for_quality_assessment" (Required)

```
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.

**Path parameters**

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

**Request body**

- `numberId` · string (Required): Zaiped id (whatsappConnections)
- `typing` · boolean

**Response (object)**

- `ok` · true (Required)

```
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.

**Request body**

- `numberId` · string (Required): Zaiped id (whatsappConnections)
- `phone` · string (Required)

**Response (object)**

- `ok` · true (Required)

```
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

**Path parameters**

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

**Response (object)**

- `ok` · true (Required)

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