---
docId: doc_d798511aeb41442fab1a23e25e67d592
title: Send a message
description: "Send text, media or instructions within a conversation."
api:
  group: mensajes
  auth: bearer
  operations:
    - operationId: sendMessage
      method: POST
      path: /v1/messages
      postmanName: Send a Custom Message
---

<script>
  import { Ways, Note, Collapsible } from '$lib/components';
</script>

# Send a message

Send a message to an existing conversation. To start a WhatsApp conversation, use [Send a template](/api-reference/messages/send-template). For email, this endpoint only replies to existing threads; to start one, use [Send an email](/api-reference/messages/send-email).

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl https://api.platic.ai/v1/messages \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "channelId": "wb-123",
    "conversationId": "5215512345678",
    "content": "Your order is on its way."
  }'
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.messages.send({
  channelId: "wb-123",
  conversationId: "5215512345678",
  content: "Your order is on its way.",
});
```

</Ways.Way>
</Ways>

<Note type="important">

To send a message to the contact through WhatsApp, Instagram or Messenger/Facebook, check [Get a conversation (V1)](/api-reference/conversations/v1/get) and verify `canSendDirectMessage`, computed from their last message. If it is `false` on WhatsApp, use a [template](/api-reference/messages/send-template). On internal channels it is always `true`.

</Note>


## Query parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `workspace` | string | Look for the channel and the conversation only in that workspace. Without it, every workspace of the credential is searched. A workspace the credential does not cover answers `400` | — |

## Request body

```json
{
  "channelId": "521234567890",
  "conversationId": "521234567890",
  "content": "Hi! How can I help you?",
  "client": {
    "name": "Ana",
    "customFields": {
      "plate": "ABC123"
    }
  }
}
```

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `channelId` | string | ✓ | Internal channel ID OR the agent's phone number (E.164 format without `+`). On [internal channels](#internal-channels-chats-with-agents) you can use the chat's internal channelId |
| `conversationId` | string | ✓ | The contact's phone number in E.164 format without `+`. On [internal channels](#internal-channels-chats-with-agents), the chat's `conversationId` (`chat_*`). On [email](#email), the conversation `id`, the contact id or their email |
| `content` | string \| object | ✓ | Message content. A string is sent as text. For media and interactive messages, use an object: see [Message types](#message-types) |
| `type` | enum | — | `text`, `image`, `video`, `file`, `audio`, `instruction`, `interactive`, `email`. Optional: the API infers it from `content` when omitted |
| `client` | object | — | Data to create or update the contact's profile |
| `campaignId` | string | — | ID of the campaign the message is attributed to. If omitted, it is recorded under the `api` campaign |
| `delay` | number | — | Delay in milliseconds (3,000 – 86,400,000; maximum 24 hours) |
| `scheduleTime` | string | — | Scheduled send date/time (ISO 8601). Maximum 30 days after the request |

<Note type="tip">

Send `client` to update the profile or create it if it does not exist. The agent can use the new data immediately.

</Note>

<Collapsible summary="Fields of the client object">

| Field | Type | Description |
|-------|------|-------------|
| `client.name` | string | Full name of the contact |
| `client.firstname` | string | First name |
| `client.lastname` | string | Last name |
| `client.email` | string | Email address |
| `client.birthdate` | string | Date of birth (dd/mm/yyyy) |
| `client.gender` | enum | Gender: `male` or `female` |
| `client.company` | string | Company name |
| `client.country` | enum | ISO 3166-1 alpha-2 code (e.g. `MX`, `US`) |
| `client.state` | string | State of residence |
| `client.city` | string | City of residence |
| `client.address` | string | Full address |
| `client.postalCode` | string | Postal code |
| `client.customFields` | map | Object with key-value pairs of the custom fields defined in the workspace. See [Custom fields](/api-reference/custom-fields) for the available ones. |
| `client.owners` | array | Emails of the responsible users |

</Collapsible>

## Message types

`content` accepts text or one of the objects shown below. You can set `type` or let the API infer it from `content`.

### Text

Short form:

```json
{
  "channelId": "521234567890",
  "conversationId": "521234567890",
  "content": "Hi! How can I help you?"
}
```

Explicit form:

```json
{
  "channelId": "521234567890",
  "conversationId": "521234567890",
  "type": "text",
  "content": { "text": "Hi! How can I help you?" }
}
```

### Image

```json
{
  "channelId": "521234567890",
  "conversationId": "521234567890",
  "type": "image",
  "content": {
    "image": {
      "url": "https://cdn.assets.com/photo.jpg",
      "caption": "Here is the photo you asked for"
    }
  }
}
```

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `content.image.url` | string | ✓ | Public `https://` URL of the image |
| `content.image.caption` | string | — | Text that appears below the image |

### Video

```json
{
  "channelId": "521234567890",
  "conversationId": "521234567890",
  "type": "video",
  "content": {
    "video": {
      "url": "https://cdn.assets.com/video.mp4",
      "caption": "Watch this video"
    }
  }
}
```

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `content.video.url` | string | ✓ | Public `https://` URL of the video |
| `content.video.caption` | string | — | Text that appears below the video |

### Document / file

```json
{
  "channelId": "521234567890",
  "conversationId": "521234567890",
  "type": "file",
  "content": {
    "file": {
      "url": "https://cdn.assets.com/invoice.pdf",
      "filename": "invoice-2025-09.pdf",
      "caption": "Your invoice for the month"
    }
  }
}
```

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `content.file.url` | string | ✓ | Public `https://` URL of the file |
| `content.file.filename` | string | — | Name under which the contact sees the file |
| `content.file.caption` | string | — | Text that appears next to the file |

### Audio

```json
{
  "channelId": "521234567890",
  "conversationId": "521234567890",
  "type": "audio",
  "content": {
    "audio": {
      "url": "https://cdn.assets.com/note.ogg"
    }
  }
}
```

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `content.audio.url` | string | ✓ | Public `https://` URL of the audio |

### Interactive messages

Interactive messages (buttons, lists and flows) are available only on WhatsApp.

<Collapsible summary="Quick reply buttons">

Up to 3 buttons per message. The contact taps one and the API receives the reply as a normal message with the `id` of the selected button.

```json
{
  "channelId": "521234567890",
  "conversationId": "521234567890",
  "type": "interactive",
  "content": {
    "type": "button",
    "body": { "text": "Do you want to confirm your appointment?" },
    "action": {
      "buttons": [
        { "id": "confirm", "title": "Yes, confirm" },
        { "id": "reschedule", "title": "Reschedule" },
        { "id": "cancel", "title": "Cancel" }
      ]
    }
  }
}
```

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `content.body.text` | string | ✓ | Main text of the message |
| `content.header` | object | — | Optional header (`{ type: "text", text }`) |
| `content.footer.text` | string | — | Small text below the buttons |
| `content.action.buttons[].id` | string | ✓ | Button identifier. You receive it when the contact taps it |
| `content.action.buttons[].title` | string | ✓ | Visible text of the button (20 characters max. recommended) |

</Collapsible>

<Collapsible summary="Lists">

Up to 10 rows in total, spread across one or more sections. The contact opens the list, taps a row and the API receives the reply with the `id` of the selected row.

```json
{
  "channelId": "521234567890",
  "conversationId": "521234567890",
  "type": "interactive",
  "content": {
    "type": "list",
    "body": { "text": "Pick the time you prefer" },
    "action": {
      "button": "See times",
      "sections": [
        {
          "title": "This week",
          "rows": [
            { "id": "mon-10", "title": "Monday 10:00", "description": "Available" },
            { "id": "tue-12", "title": "Tuesday 12:00", "description": "Available" }
          ]
        }
      ]
    }
  }
}
```

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `content.body.text` | string | ✓ | Main text of the message |
| `content.action.button` | string | ✓ | Text of the button that opens the list |
| `content.action.sections[].title` | string | — | Section title |
| `content.action.sections[].rows[].id` | string | ✓ | Row identifier. You receive it when the contact taps it |
| `content.action.sections[].rows[].title` | string | ✓ | Visible text of the row |
| `content.action.sections[].rows[].description` | string | — | Secondary text below the title |

</Collapsible>

<Collapsible summary="Flows">

To send a published WhatsApp Flow, set `flow_id` or `flow_name` and the button text. The API generates `flow_token` and uses it to match the contact's reply to the send.

```json
{
  "channelId": "521234567890",
  "conversationId": "521234567890",
  "type": "interactive",
  "content": {
    "type": "flow",
    "body": { "text": "Complete your registration in under a minute" },
    "action": {
      "parameters": {
        "flow_id": "1234567890",
        "flow_cta": "Start"
      }
    }
  }
}
```

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `content.body.text` | string | ✓ | Main text of the message |
| `content.action.parameters.flow_id` | string | ✓¹ | ID of the Flow published on WhatsApp. Alternative: `flow_name` |
| `content.action.parameters.flow_name` | string | ✓¹ | Name of the published Flow. Alternative to `flow_id` |
| `content.action.parameters.flow_cta` | string | ✓ | Text of the button that opens the Flow |

¹ You must send `flow_id` **or** `flow_name`; you do not need both.

</Collapsible>

### Instruction to the agent

An instruction goes to the agent, not the contact, and does not require an open service window. Use it to tell the agent to wait or resume the conversation. The `mode` field defines what it does.

```json
{
  "channelId": "521234567890",
  "conversationId": "521234567890",
  "type": "instruction",
  "content": {
    "text": "Wait for the customer to confirm the appointment before continuing.",
    "mode": "wait"
  }
}
```

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `content.text` | string | ✓ | Order or context the agent must take into account |
| `content.mode` | enum | ✓ | `wait` or `resume` |

**Behavior by mode**

- `wait`: saves the instruction as a system message. The agent waits for the contact's next message and then uses the instruction as context; it does not reply immediately.
- `resume`: resumes the conversation and runs the agent with the instruction. The agent decides whether it needs to reply to the contact.

To act on the conversation by its `id`, use [Pause the agent](/api-reference/conversations/pause), [Resume the agent](/api-reference/conversations/resume) (the agent replies now, with or without an instruction) or [Hand back on the next message](/api-reference/conversations/wait) (the agent replies when the contact writes next). They take an `Idempotency-Key`.

```json
{
  "channelId": "521234567890",
  "conversationId": "521234567890",
  "type": "instruction",
  "content": {
    "text": "Continue the sales flow and offer a 10% discount.",
    "mode": "resume"
  }
}
```

<Note type="tip">

Schedule an instruction with `delay` or `scheduleTime`. It runs at the chosen time. For example, schedule a `resume` to follow up tomorrow at 9:00.

</Note>

## Scheduling

Send the message immediately, with a delay, or at a specific date. Save `messageId` to [read, reschedule, or cancel the send](/api-reference/messages/scheduled).

<Collapsible summary="Scheduling options">

**Delayed send (delay):**

- Minimum: `3000` ms (3 seconds)
- Maximum: `86400000` ms (24 hours)
- Example: `"delay": 5000` sends the message in 5 seconds

**Scheduled send (scheduleTime):**

- ISO 8601 format
- Must be a future date
- Cannot be more than 30 days after the request
- Examples:
  - `"2026-10-15T18:40:00"`: Mexico time (UTC-6)
  - `"2026-10-15T18:40:00Z"`: UTC time
  - `"2026-10-15T18:40:00-06:00"`: with a specific time zone

<Note type="warning">

You cannot use `delay` and `scheduleTime` in the same request.

</Note>

</Collapsible>

<Note type="important">

For messages sent to the contact, the service window is checked when sending, not when scheduling. If it closes before the scheduled message runs, the send fails.

</Note>

## Response

The response shows whether the message was sent immediately or scheduled.

**Immediate send:**

```json
{
  "messageId": "msg_123xyz",
  "status": "sent",
  "timestamp": "2026-09-20T20:00:00Z"
}
```

**With `delay` (HTTP `202`):**

```json
{
  "messageId": "msg_123xyz",
  "kind": "service",
  "status": "delayed",
  "timestamp": "2026-09-20T20:00:00Z",
  "executeAt": "2026-09-20T20:00:05.000Z",
  "delayMs": 5000
}
```

**With `scheduleTime` (HTTP `202`):**

```json
{
  "messageId": "msg_123xyz",
  "kind": "service",
  "status": "scheduled",
  "timestamp": "2026-09-20T20:00:00Z",
  "executeAt": "2026-10-16T00:40:00.000Z",
  "scheduledTime": "2026-10-15T18:40:00"
}
```

| Field | Type | Description |
|-------|------|-------------|
| `messageId` | string | ID of the created message. For scheduled sends, use it to [read, reschedule or cancel the resource](/api-reference/messages/scheduled); you do not need `campaignId` or `runId` |
| `kind` | enum | `service` in the HTTP `202` responses of this endpoint |
| `status` | enum | `sent`, `delayed` or `scheduled` |
| `timestamp` | string | Date/time the request was processed (ISO 8601 UTC) |
| `executeAt` | string | Date/time the message will be sent (ISO 8601 UTC). Only present on delayed or scheduled sends |
| `delayMs` | number | Configured delay in milliseconds. Only present when `delay` was used |
| `scheduledTime` | string | Original `scheduleTime` value sent in the request. Only present when `scheduleTime` was used |

Sends with `delay` or `scheduleTime` are accepted but not yet sent. See [Scheduled messages](/api-reference/messages/scheduled) for their statuses and execution rules.

## Errors

<Collapsible summary="Show error codes and fixes">



| Status | `details.code` | When it happens |
|--------|----------------|-----------------|
| `400` | `INVALID_REQUEST` | The body is not valid: `content` or `type` (`details.issues` points at `content`, `type`, `content.text` or `content.mode`), the `client` object on a channel that addresses the contact, or `delay` together with `scheduleTime` (it points at `delay`) |
| `400` | `INVALID_SCHEDULE` | `delay` is out of range, or `scheduleTime` is not valid, is in the past or is more than 30 days ahead. `details.issues` points at `delay` or `scheduleTime` |
| `400` | `INVALID_REQUEST` | The supplied `?workspace=` is not authorized for your credential. `details.available` lists the available workspaces |
| `400` | `INVALID_PHONE_NUMBER` | The phone number is not valid |
| `401` | `UNAUTHENTICATED` | The credential is missing or invalid |
| `403` | `FORBIDDEN` | The credential does not have the module, or the user does not have access to the workspace |
| `404` | `CHANNEL_NOT_FOUND` | No channel has that `channelId` |
| `404` | `CONVERSATION_NOT_FOUND` | No conversation matches that `conversationId` and `channelId` |
| `404` | `CLIENT_NOT_FOUND` | On an email mailbox, the contact does not exist |
| `404` | `WORKSPACE_NOT_FOUND` | The credential does not carry any workspace |
| `409` | `MULTIPLE_CONTACTS_MATCH` | On email, two contacts share that email: use the conversation `id`. `details.clientIds` lists them |
| `409` | `MULTIPLE_CONVERSATIONS_MATCH` | Several internal conversations share that `conversationId`: use the conversation `id` |
| `409` | `CHANNEL_MISMATCH` | On an email mailbox, the conversation does not belong to that mailbox |
| `409` | `CONTACT_INVALID` | On an email mailbox, the contact cannot receive the email |
| `409` | `CONTACT_BLOCKED` | The contact has `status: "blocked"`. `details.clientId` and `details.status` say which |
| `422` | `POST_CONVERSATION` | The channel is a post-comments channel (`igc-` or `fbc-`) |
| `422` | `UNSUPPORTED_MESSAGE_TYPE` | The message type is not allowed on an internal channel: `interactive` and `email` messages and templates are exclusive to external channels |
| `422` | `SERVICE_WINDOW_CLOSED` | The service window of the conversation is closed. Send a [template](/api-reference/messages/send-template) |
| `422` | `CONVERSATION_PHONE_MISSING` | The WhatsApp conversation has no phone number |
| `422` | `CHANNEL_UNAVAILABLE` | The channel has no agent workspace or channel ID defined |
| `502` | `UPSTREAM_ERROR` | The messaging service failed |

Channel selection can also return `409 AMBIGUOUS_CHANNEL` or the responder-agent errors described in [Send a template](/api-reference/messages/send-template#errors). For a mailbox, the errors in [Send an email](/api-reference/messages/send-email#errors) apply.

The general error format is in [Errors](/api-reference/errors).

</Collapsible>

## Notes

### Rules per channel

#### WhatsApp

- Templates are required to start a conversation. Once the contact replies, the service window stays open for 24 hours and you can send any type of message until it closes.
- Each message from the contact restarts the window.
- Supports text, images, videos, files, audio, buttons, lists and flows.

#### Instagram and Facebook

- Support text, images, videos, files and audio. Interactive messages (buttons, lists, flows) are **not** available outside WhatsApp.
- The window is computed from the user's last message; validate `canSendDirectMessage` before sending.

#### Email

On an email mailbox (`channelId` like `em-sales@acme.com`), this endpoint only **replies** to a thread that already exists. Send `content` as text:

```json
{
  "channelId": "em-sales@acme.com",
  "conversationId": "Hk3pQ9wLx2QmZ7bN1cVd",
  "content": "Sure, I'll send it as a PDF."
}
```

- `conversationId` can be the conversation `id`, the contact id or their email. With the contact, the reply goes to the open thread with the most recent activity or, if none is open, to the most recent one.
- If two contacts have that email, it answers `409`: use the conversation `id`.
- There is no service window: `canSendDirectMessage` is always `true`.

To start a thread, send HTML or attach files, use [Send an email](/api-reference/messages/send-email). The guide is [Email through the API](/api-reference/channels/email).

#### Post comments

Comment channels (`igc-` and `fbc-`) do not accept messages: they answer `422` with `details.code: "POST_CONVERSATION"`. Answer a comment with [Reply publicly or privately](/api-reference/posts/reply).

#### Internal channels (chats with agents)

`POST /v1/messages` also works on the internal conversations created by the [Chat API](/api-reference/chat). Identify the thread with the chat's `conversationId` (`chat_*`) or with its internal `channelId`:

```json
{
  "channelId": "workspace-ws_001-agent-agent_001",
  "conversationId": "chat_01JCHAT23456789",
  "content": "An advisor will review your case in a few minutes."
}
```

- Supported types: `text`, `image`, `video`, `file`, `audio` and `instruction`. `interactive` and `email` messages and templates are exclusive to external channels and return `422` on an internal channel.
- [Instructions to the agent](#instruction-to-the-agent) (`wait` / `resume`) work exactly as on external channels.
- There is **no service window** on internal channels: `canSendDirectMessage` is always `true`.

### Channel compatibility matrix

| Type | WhatsApp | Instagram / Facebook | Email ¹ | Internal (Chat API) |
|------|----------|----------------------|---------|---------------------|
| `text` | ✓ | ✓ | ✓ | ✓ |
| `image` | ✓ | ✓ | — | ✓ |
| `video` | ✓ | ✓ | — | ✓ |
| `file` | ✓ | ✓ | — | ✓ |
| `audio` | ✓ | ✓ | — | ✓ |
| `instruction` | ✓ | ✓ | ✓ | ✓ |
| `interactive` (buttons, lists, flows) | ✓ | — | — | — |
| `email` | — | — | ✓ | — |
| Templates ([Send a template](/api-reference/messages/send-template)) | ✓ | — | — | — |
| Service window | 24 h | Depends on platform | No window | No window |

¹ Only to reply to a thread. To start one, and for attachments, use [Send an email](/api-reference/messages/send-email). `email` on an internal channel returns `422`.

### Check the status

Verify whether your message was delivered:

1. From the platform's inbox.
2. With [the conversation's messages](/api-reference/conversations/messages): each message has its `deliveryStatus`.
