create
Send an SMS or MMS message. Pass the destination and source numbers first, then
any other fields in options. A message with media is sent as MMS.
Request
Message.CreateMessageRequest
Request body for sending a new SMS or MMS message.
OR
Message.WhatsAppContentMessageRequest
A WhatsApp content message. The `message_type` field determines the shape of `body`.
OR
Message.WhatsAppTemplateMessageRequest
Send an approved WhatsApp template. Use this to reach a customer for the first time or outside the 24-hour window. Do not include `body` or `message_type`.
Response
id
The unique ID of the message. This is the `MessageSegment` ID, consistent with the dashboard and the `/api/messaging/logs` endpoint.
from
The source phone number.
to
The destination phone number.
body
The message body text. Returns an empty string when the message has been redacted.
status
Delivery state of the message.
direction
The direction of the message.
kind
The kind of message.
media
Array of URLs for any media attachments on the message. Empty for SMS.
number_of_segments
Number of segments the message body was split into for delivery.
error_code
Provider-specific error code if delivery failed. Null when no error occurred.
error_message
Human-readable error message if delivery failed. Null when no error occurred.
created_at
Date and time when the message was created.
project_id
The ID of the project the message belongs to.
status_callback_url
Callback URL configured to receive message status events. Null if no callback was configured.
message_uri
Relative URL for retrieving the message via the `/api/messaging/logs` endpoint.
Response Example
Response