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

# POST Send a Message

> Send a WhatsApp message via the API. Supports text, images, documents, audio, video, stickers, contacts, and interactive messages.

## Send a Message

`POST /api/messages/send`

Send a message through a connected WhatsApp channel. Supports text, images, documents, audio, video, stickers, contacts, and interactive messages.

### Headers

**Cookie** `string` *required*

Session cookie (login via POST /api/auth/login)

### Request body

**channelId** `string` *required*

The WhatsApp channel ID to send from.

**to** `string` *required*

Recipient phone number with country code.

**type** `string` *required*

Message type: `text`, `image`, `document`, `audio`, `video`, `sticker`, `contacts`, `interactive`.

**content** `object` *required*

Message content object (shape varies by type).

```bash cURL theme={null}
curl -X POST https://zeplo.ai/api/messages/send \
  -H "Cookie: connect.sid=s%3A7HImZ-T2BxWSbUsf9dtWdOlBW4rVuORO.5J0Do0NyvBu%2BkTvu1aHvtNs00BKhkpUKTwiokLS0cpw" \
  -H "Content-Type: application/json" \
  -d '{
    "channelId": "647015955153740",
    "to": "919876543210",
    "type": "text",
    "content": { "text": "Hello from Zeplo!" }
  }'
```

### Message types

#### Text message

```json theme={null}
{
  "channelId": "647015955153740",
  "to": "919876543210",
  "type": "text",
  "content": {
    "text": "Hello from Zeplo!",
    "preview_url": true
  }
}
```

#### Image message

```json theme={null}
{
  "channelId": "647015955153740",
  "to": "919876543210",
  "type": "image",
  "content": {
    "url": "https://example.com/image.jpg",
    "caption": "Check this out!"
  }
}
```

#### Document message

```json theme={null}
{
  "channelId": "647015955153740",
  "to": "919876543210",
  "type": "document",
  "content": {
    "url": "https://example.com/invoice.pdf",
    "caption": "Your invoice",
    "filename": "invoice.pdf"
  }
}
```

#### Audio message

```json theme={null}
{
  "channelId": "647015955153740",
  "to": "919876543210",
  "type": "audio",
  "content": {
    "url": "https://example.com/audio.mp3"
  }
}
```

#### Video message

```json theme={null}
{
  "channelId": "647015955153740",
  "to": "919876543210",
  "type": "video",
  "content": {
    "url": "https://example.com/video.mp4",
    "caption": "Demo video"
  }
}
```

#### Interactive button message

```json theme={null}
{
  "channelId": "647015955153740",
  "to": "919876543210",
  "type": "interactive",
  "content": {
    "type": "button",
    "body": { "text": "Choose an option:" },
    "action": {
      "buttons": [
        { "type": "reply", "reply": { "id": "yes", "title": "Yes" } },
        { "type": "reply", "reply": { "id": "no", "title": "No" } }
      ]
    }
  }
}
```

#### Interactive list message

```json theme={null}
{
  "channelId": "647015955153740",
  "to": "919876543210",
  "type": "interactive",
  "content": {
    "type": "list",
    "body": { "text": "Select a product:" },
    "action": {
      "button": "View Products",
      "sections": [
        {
          "title": "Electronics",
          "rows": [
            { "id": "laptop", "title": "Laptop", "description": "$999" },
            { "id": "phone", "title": "Phone", "description": "$599" }
          ]
        }
      ]
    }
  }
}
```

#### Contact message

```json theme={null}
{
  "channelId": "647015955153740",
  "to": "919876543210",
  "type": "contacts",
  "content": {
    "contacts": [
      {
        "name": { "first_name": "John", "last_name": "Doe" },
        "phones": [{ "phone": "+1234567890", "type": "mobile" }]
      }
    ]
  }
}
```

```json Response theme={null}
{
  "success": true,
  "message": "Message sent successfully",
  "data": {
    "id": "msg_abc123",
    "whatsappMessageId": "wamid.HBgM...",
    "channelId": "647015955153740",
    "to": "919876543210",
    "type": "text",
    "status": "sent",
    "createdAt": "2026-01-15T10:30:00Z"
  }
}
```

***

## Send message in conversation

`POST /api/conversations/:conversationId/messages`

Create a new message within an existing conversation.

### Authorization

| Header | Required | Description |
| - | - | - |
| `x-api-key` | Yes | Your API key |
| `x-api-secret` | Yes | Your API secret key |
| `x-channel-id` | Yes | WhatsApp channel ID |

### Path parameters

**conversationId** `integer` *required*

The conversation ID.

### Request body

**type** `string` *required*

Message type (e.g., `text`, `image`, `document`).

**content** `object` *required*

Message content object (shape varies by type).

```bash cURL theme={null}
curl -X POST https://zeplo.ai/api/conversations/1/messages \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-api-secret: YOUR_API_SECRET" \
  -H "x-channel-id: YOUR_CHANNEL_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "text",
    "content": { "text": "Reply to your inquiry" }
  }'
```

```json Response theme={null}
{
  "success": true,
  "data": {
    "id": 42,
    "conversationId": 1,
    "type": "text",
    "content": { "text": "Reply to your inquiry" },
    "direction": "outbound",
    "status": "sent",
    "createdAt": "2026-01-15T10:30:00Z"
  }
}
```


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