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
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."
}' await platic.messages.send({
channelId: "wb-123",
conversationId: "5215512345678",
content: "Your order is on its way.",
}); What you need to know
- Every error under
/v1/messagesuses the standard format, with adetails.code. See Errors. - To start a WhatsApp conversation you need a template; once the contact replies you can send any message while the service window is open.
- Sends with
delayorscheduleTimeare accepted but not yet sent; manage them with scheduled messages.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
POST | /v1/messages/template | Start or reopen WhatsApp with a template |
POST | /v1/messages/email | Start or reply to an email thread |
POST | /v1/messages | Step into a conversation or instruct the agent |
GET | /v1/messages/scheduled | List scheduled messages |
GET | /v1/messages/scheduled/{messageId} | Get a scheduled message |
PATCH | /v1/messages/scheduled/{messageId} | Reschedule a message |
DELETE | /v1/messages/scheduled/{messageId} | Cancel a message |
GET | /v1/whatsapp/templates | List templates, with filters by status, category and name |
GET | /v1/whatsapp/templates/{name} | Get the detail of one template |
GET | /v1/whatsapp/templates/{name}/analytics | See sent, delivered, read, clicks and cost of a template |
POST | /v1/whatsapp/templates | Create a template and send it to Meta for review |
PATCH | /v1/whatsapp/templates/{name} | Edit one language version of a template |
DELETE | /v1/whatsapp/templates/{name} | Delete a template, with all its languages or just one |
Important
Before sending a direct message through WhatsApp, Instagram or Messenger/Facebook, check canSendDirectMessage with GET /v1/conversations/{id}. It is computed from the user's last message. On Platica's internal chats it is always true.
Permissions
Reading, creating and editing templates requires the Conversations module or the Campaigns module. Deleting them requires Campaigns.