Send a message

SDK platic.messages.send()

Send a message to an existing conversation. To start a WhatsApp conversation, use Send a template. For email, this endpoint only replies to existing threads; to start one, use Send an email.

Example

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

Query parameters

ParameterTypeDescriptionRequired
workspacestringLook 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

{
  "channelId": "521234567890",
  "conversationId": "521234567890",
  "content": "Hi! How can I help you?",
  "client": {
    "name": "Ana",
    "customFields": {
      "plate": "ABC123"
    }
  }
}
FieldTypeRequiredDescription
channelIdstring✓Internal channel ID OR the agent's phone number (E.164 format without +). On internal channels you can use the chat's internal channelId
conversationIdstring✓The contact's phone number in E.164 format without +. On internal channels, the chat's conversationId (chat_*). On email, the conversation id, the contact id or their email
contentstring | object✓Message content. A string is sent as text. For media and interactive messages, use an object: see Message types
typeenum—text, image, video, file, audio, instruction, interactive, email. Optional: the API infers it from content when omitted
clientobject—Data to create or update the contact's profile
campaignIdstring—ID of the campaign the message is attributed to. If omitted, it is recorded under the api campaign
delaynumber—Delay in milliseconds (3,000 – 86,400,000; maximum 24 hours)
scheduleTimestring—Scheduled send date/time (ISO 8601). Maximum 30 days after the request
FieldTypeDescription
client.namestringFull name of the contact
client.firstnamestringFirst name
client.lastnamestringLast name
client.emailstringEmail address
client.birthdatestringDate of birth (dd/mm/yyyy)
client.genderenumGender: male or female
client.companystringCompany name
client.countryenumISO 3166-1 alpha-2 code (e.g. MX, US)
client.statestringState of residence
client.citystringCity of residence
client.addressstringFull address
client.postalCodestringPostal code
client.customFieldsmapObject with key-value pairs of the custom fields defined in the workspace. See Custom fields for the available ones.
client.ownersarrayEmails of the responsible users

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:

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

Explicit form:

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

Image

{
  "channelId": "521234567890",
  "conversationId": "521234567890",
  "type": "image",
  "content": {
    "image": {
      "url": "https://cdn.assets.com/photo.jpg",
      "caption": "Here is the photo you asked for"
    }
  }
}
FieldTypeRequiredDescription
content.image.urlstring✓Public https:// URL of the image
content.image.captionstring—Text that appears below the image

Video

{
  "channelId": "521234567890",
  "conversationId": "521234567890",
  "type": "video",
  "content": {
    "video": {
      "url": "https://cdn.assets.com/video.mp4",
      "caption": "Watch this video"
    }
  }
}
FieldTypeRequiredDescription
content.video.urlstring✓Public https:// URL of the video
content.video.captionstring—Text that appears below the video

Document / file

{
  "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"
    }
  }
}
FieldTypeRequiredDescription
content.file.urlstring✓Public https:// URL of the file
content.file.filenamestring—Name under which the contact sees the file
content.file.captionstring—Text that appears next to the file

Audio

{
  "channelId": "521234567890",
  "conversationId": "521234567890",
  "type": "audio",
  "content": {
    "audio": {
      "url": "https://cdn.assets.com/note.ogg"
    }
  }
}
FieldTypeRequiredDescription
content.audio.urlstring✓Public https:// URL of the audio

Interactive messages

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

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.

{
  "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" }
      ]
    }
  }
}
FieldTypeRequiredDescription
content.body.textstring✓Main text of the message
content.headerobject—Optional header ({ type: "text", text })
content.footer.textstring—Small text below the buttons
content.action.buttons[].idstring✓Button identifier. You receive it when the contact taps it
content.action.buttons[].titlestring✓Visible text of the button (20 characters max. recommended)

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.

{
  "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" }
          ]
        }
      ]
    }
  }
}
FieldTypeRequiredDescription
content.body.textstring✓Main text of the message
content.action.buttonstring✓Text of the button that opens the list
content.action.sections[].titlestring—Section title
content.action.sections[].rows[].idstring✓Row identifier. You receive it when the contact taps it
content.action.sections[].rows[].titlestring✓Visible text of the row
content.action.sections[].rows[].descriptionstring—Secondary text below the title

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.

{
  "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"
      }
    }
  }
}
FieldTypeRequiredDescription
content.body.textstring✓Main text of the message
content.action.parameters.flow_idstring✓¹ID of the Flow published on WhatsApp. Alternative: flow_name
content.action.parameters.flow_namestring✓¹Name of the published Flow. Alternative to flow_id
content.action.parameters.flow_ctastring✓Text of the button that opens the Flow

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

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.

{
  "channelId": "521234567890",
  "conversationId": "521234567890",
  "type": "instruction",
  "content": {
    "text": "Wait for the customer to confirm the appointment before continuing.",
    "mode": "wait"
  }
}
FieldTypeRequiredDescription
content.textstring✓Order or context the agent must take into account
content.modeenum✓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, Resume the agent (the agent replies now, with or without an instruction) or Hand back on the next message (the agent replies when the contact writes next). They take an Idempotency-Key.

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

Scheduling

Send the message immediately, with a delay, or at a specific date. Save messageId to read, reschedule, or cancel the send.

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

Response

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

Immediate send:

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

With delay (HTTP 202):

{
  "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):

{
  "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"
}
FieldTypeDescription
messageIdstringID of the created message. For scheduled sends, use it to read, reschedule or cancel the resource; you do not need campaignId or runId
kindenumservice in the HTTP 202 responses of this endpoint
statusenumsent, delayed or scheduled
timestampstringDate/time the request was processed (ISO 8601 UTC)
executeAtstringDate/time the message will be sent (ISO 8601 UTC). Only present on delayed or scheduled sends
delayMsnumberConfigured delay in milliseconds. Only present when delay was used
scheduledTimestringOriginal 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 for their statuses and execution rules.

Errors

Statusdetails.codeWhen it happens
400INVALID_REQUESTThe 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)
400INVALID_SCHEDULEdelay 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
400INVALID_REQUESTThe supplied ?workspace= is not authorized for your credential. details.available lists the available workspaces
400INVALID_PHONE_NUMBERThe phone number is not valid
401UNAUTHENTICATEDThe credential is missing or invalid
403FORBIDDENThe credential does not have the module, or the user does not have access to the workspace
404CHANNEL_NOT_FOUNDNo channel has that channelId
404CONVERSATION_NOT_FOUNDNo conversation matches that conversationId and channelId
404CLIENT_NOT_FOUNDOn an email mailbox, the contact does not exist
404WORKSPACE_NOT_FOUNDThe credential does not carry any workspace
409MULTIPLE_CONTACTS_MATCHOn email, two contacts share that email: use the conversation id. details.clientIds lists them
409MULTIPLE_CONVERSATIONS_MATCHSeveral internal conversations share that conversationId: use the conversation id
409CHANNEL_MISMATCHOn an email mailbox, the conversation does not belong to that mailbox
409CONTACT_INVALIDOn an email mailbox, the contact cannot receive the email
409CONTACT_BLOCKEDThe contact has status: "blocked". details.clientId and details.status say which
422POST_CONVERSATIONThe channel is a post-comments channel (igc- or fbc-)
422UNSUPPORTED_MESSAGE_TYPEThe message type is not allowed on an internal channel: interactive and email messages and templates are exclusive to external channels
422SERVICE_WINDOW_CLOSEDThe service window of the conversation is closed. Send a template
422CONVERSATION_PHONE_MISSINGThe WhatsApp conversation has no phone number
422CHANNEL_UNAVAILABLEThe channel has no agent workspace or channel ID defined
502UPSTREAM_ERRORThe messaging service failed

Channel selection can also return 409 AMBIGUOUS_CHANNEL or the responder-agent errors described in Send a template. For a mailbox, the errors in Send an email apply.

The general error format is in Errors.

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:

{
  "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. The guide is Email through the API.

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.

Internal channels (chats with agents)

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

{
  "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 (wait / resume) work exactly as on external channels.
  • There is no service window on internal channels: canSendDirectMessage is always true.

Channel compatibility matrix

TypeWhatsAppInstagram / FacebookEmail ¹Internal (Chat API)
text✓✓✓✓
image✓✓—✓
video✓✓—✓
file✓✓—✓
audio✓✓—✓
instruction✓✓✓✓
interactive (buttons, lists, flows)✓———
email——✓—
Templates (Send a template)✓———
Service window24 hDepends on platformNo windowNo window

¹ Only to reply to a thread. To start one, and for attachments, use Send an 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: each message has its deliveryStatus.