---
docId: doc_03ccb57f23364a50a0f689c4724e3a5b
title: Messages
description: "Send messages, emails and templates, and manage scheduled sends."
---

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

# Messages

Send messages from your product through WhatsApp, Instagram, Messenger, email, or web chat. Use a template to start WhatsApp conversations and the email endpoint to start or reply to a thread. You can also send messages to internal chats or give an agent instructions.

If you schedule a send with `delay` or `scheduleTime`, use its `messageId` to read, reschedule or cancel it.

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

## What you need to know

- Every error under `/v1/messages` uses the standard format, with a `details.code`. See [Errors](/api-reference/errors).
- To start a WhatsApp conversation you need a [template](/api-reference/messages/send-template); once the contact replies you can send any message while the service window is open.
- Sends with `delay` or `scheduleTime` are accepted but not yet sent; manage them with [scheduled messages](/api-reference/messages/scheduled).

## Endpoints

| Method | Endpoint | Description |
|--------|----------|-------------|
| `POST` | [`/v1/messages/template`](/api-reference/messages/send-template) | Start or reopen WhatsApp with a template |
| `POST` | [`/v1/messages/email`](/api-reference/messages/send-email) | Start or reply to an email thread |
| `POST` | [`/v1/messages`](/api-reference/messages/send) | Step into a conversation or instruct the agent |
| `GET` | [`/v1/messages/scheduled`](/api-reference/messages/scheduled) | List scheduled messages |
| `GET` | [`/v1/messages/scheduled/{messageId}`](/api-reference/messages/scheduled) | Get a scheduled message |
| `PATCH` | [`/v1/messages/scheduled/{messageId}`](/api-reference/messages/scheduled) | Reschedule a message |
| `DELETE` | [`/v1/messages/scheduled/{messageId}`](/api-reference/messages/scheduled) | Cancel a message |
| `GET` | [`/v1/whatsapp/templates`](/api-reference/whatsapp-templates/list) | List templates, with filters by status, category and name |
| `GET` | [`/v1/whatsapp/templates/{name}`](/api-reference/whatsapp-templates/get) | Get the detail of one template |
| `GET` | [`/v1/whatsapp/templates/{name}/analytics`](/api-reference/whatsapp-templates/analytics) | See sent, delivered, read, clicks and cost of a template |
| `POST` | [`/v1/whatsapp/templates`](/api-reference/whatsapp-templates/create) | Create a template and send it to Meta for review |
| `PATCH` | [`/v1/whatsapp/templates/{name}`](/api-reference/whatsapp-templates/update) | Edit one language version of a template |
| `DELETE` | [`/v1/whatsapp/templates/{name}`](/api-reference/whatsapp-templates/delete) | Delete a template, with all its languages or just one |

<Note type="important">

Before sending a direct message through WhatsApp, Instagram or Messenger/Facebook, check `canSendDirectMessage` with [`GET /v1/conversations/{id}`](/api-reference/conversations/v1/get). It is computed from the user's last message. On Platica's internal chats it is always `true`.

</Note>

## Permissions

Reading, creating and editing templates requires the Conversations module or the Campaigns module. Deleting them requires Campaigns.
