Skip to main content
POST
Send a message

Authorizations

Authorization
string
header
required

The API key, created in Settings › API, in the header Authorization: Bearer . The default.

Headers

Idempotency-Key
string

Up to 255 characters. Repeat the key with the same body within 24 hours and you get the same response plus an Idempotent-Replayed header set to true. 402, 409, 429 and 5xx responses (except send_outcome_unknown) are not stored: fix the cause and retry with the same key.

Required string length: 1 - 255

Body

application/json

type text: free-form text to a lead_id; with the 24-hour window closed on WhatsApp it goes out as the agent's reopening template, and on Instagram it returns 409. type template: an approved template to a WhatsApp lead_id, or to a phone number (to) of an agent (text_agent_id), creating the lead if it does not exist.

type
enum<string>
required
Available options:
text,
template
lead_id
string<uuid>
text_agent_id
string<uuid>
to
string

Phone number in E.164 format.

Pattern: ^\+[1-9]\d{6,14}$
Example:

"+34600111222"

text
string
Required string length: 1 - 4096
template
object
lead_variables
object

Flat customer variables. They are merged with the lead's existing ones; null or "" deletes the key.

pause_ai
boolean

Templates only: pauses the AI so a person can take over.

reset_conversation
boolean

Templates only: an existing lead starts over.

source_lead_id
string<uuid>

Only with type template: the lead from another channel for the same person, for example the call that opens this WhatsApp conversation. Both end up with the same contact_id.

Response

The message, with lead_created (false for text) and warnings (empty if there were none).

The message just sent, with lead_created (false for text) and warnings (empty if there were none).

object
string
required
Allowed value: "message"
id
string<uuid>
required
lead_id
string<uuid>
required
direction
enum<string>
required
Available options:
inbound,
outbound
sender
enum<string>
required

lead: written by the lead. agent: sent by the agent (the AI or a person). skills: an agent tool.

Available options:
lead,
agent,
skills
origin
enum<string>
required

Who originated it. lead: the lead. ai: the AI agent. manual: a person from the dashboard. api: an API request. system: the platform, for example a notice. unclassified: historical rows with no known origin.

Available options:
lead,
ai,
manual,
api,
system,
unclassified
type
enum<string>
required
Available options:
text,
template,
media
text
string | null
required

null on a lead message with an attachment and no caption.

template
object | null
required
attachments
object[]
required
reply_to_message_id
string<uuid> | null
required
status
enum<string>
required

received: a message from the lead. queued: stored but not yet sent to WhatsApp (in the queue, outside sending hours, waiting for template approval or with no channel connected). accepted: WhatsApp accepted it. sent, delivered, read and failed are confirmed by WhatsApp later.

Available options:
received,
queued,
accepted,
sent,
delivered,
read,
failed
error
object | null
required

Why it failed, if it failed.

created_at
string<date-time>
required
sent_at
string<date-time> | null
required
delivered_at
string<date-time> | null
required
read_at
string<date-time> | null
required
failed_at
string<date-time> | null
required
lead_created
boolean
required

Only in the POST /messages response: whether the send created the lead.

warnings
enum<string>[]
required

Only in the POST /messages response: steps after the send that failed (the template was already sent). Empty if there were no warnings.

Available options:
pause_ai_failed,
variables_failed,
conversation_reset_failed