Skip to content
Get Started

Messages

Operations for sending and managing messages

Get messages
client.messages.list(MessageListParams { account_email, created_at_gte, created_at_lte, 18 more } query?, RequestOptionsoptions?): MessageListResponse { data, pagination, status }
GET/api/v2/messages
Get a specific message
client.messages.retrieve(stringmessageID, RequestOptionsoptions?): MessageRetrieveResponse { data, status }
GET/api/v2/messages/{message_id}
Send a message
client.messages.send(MessageSendParams { content, from_number, number, 3 more } body, RequestOptionsoptions?): MessageResponse { account_email, content, date_created, 10 more }
POST/api/send-message
Get message status
client.messages.getStatus(MessageGetStatusParams { handle } query, RequestOptionsoptions?): MessageResponse { account_email, content, date_created, 10 more }
GET/api/status
ModelsExpand Collapse
MessageContent { account_email, content, date_created, 9 more }
account_email?: string

Email of the account

content?: string

Message content

date_created?: string

When the message was created

formatdate-time
date_sent?: string

When the message was sent

formatdate-time
date_updated?: string

When the message was last updated

formatdate-time
from_number?: string

Sender phone number

is_outbound?: boolean

Whether this is an outbound message

media_url?: string

URL of attached media

message_handle?: string

Unique message identifier

send_style?: "celebration" | "shooting_star" | "fireworks" | 10 more
One of the following:
"celebration"
"shooting_star"
"fireworks"
"lasers"
"love"
"confetti"
"balloons"
"spotlight"
"echo"
"invisible"
"gentle"
"loud"
"slam"
status?: "QUEUED" | "SENT" | "DELIVERED" | 2 more
One of the following:
"QUEUED"
"SENT"
"DELIVERED"
"ERROR"
"RECEIVED"
to_number?: string

Recipient phone number

MessageResponse { account_email, content, date_created, 10 more }
account_email?: string

Email of the account that sent the message

content?: string

Message content

date_created?: string

When the message was created

formatdate-time
date_updated?: string

When the message was last updated

formatdate-time
error_code?: number

Numeric error code if message failed

error_message?: string

Error message if message failed

from_number?: string

Sending phone number

is_outbound?: boolean

Whether this is an outbound message

media_url?: string

URL of attached media

message_handle?: string

Unique identifier for tracking the message

number?: string

Recipient phone number

send_style?: "celebration" | "shooting_star" | "fireworks" | 10 more

The iMessage expressive message style

One of the following:
"celebration"
"shooting_star"
"fireworks"
"lasers"
"love"
"confetti"
"balloons"
"spotlight"
"echo"
"invisible"
"gentle"
"loud"
"slam"
status?: "QUEUED" | "SENT" | "DELIVERED" | "ERROR"
One of the following:
"QUEUED"
"SENT"
"DELIVERED"
"ERROR"
MessageListResponse { data, pagination, status }
data?: Array<Data>
accountEmail?: string

Email of the account

content?: string

Message content

date_sent?: string

When the message was sent

formatdate-time
date_updated?: string

When the message was last updated

formatdate-time
error_code?: number | null

Numeric error code if message failed

error_detail?: string | null

Detailed error information

error_message?: string | null

Error message if message failed

error_reason?: string | null

Error reason if message failed

from_number?: string

Sender phone number

group_display_name?: string | null

Display name for group messages

group_id?: string | null

Group ID for group messages

is_outbound?: boolean

Whether this is an outbound message

media_url?: string | null

URL of attached media

message_handle?: string

Unique message identifier

message_type?: "message" | "group"
One of the following:
"message"
"group"
number?: string

Primary phone number (to_number for outbound, from_number for inbound)

opted_out?: boolean

Whether the recipient has opted out

participants?: Array<string>

List of participants for group messages

plan?: string

Account plan used for this message

send_style?: "celebration" | "shooting_star" | "fireworks" | 10 more

The iMessage expressive message style

One of the following:
"celebration"
"shooting_star"
"fireworks"
"lasers"
"love"
"confetti"
"balloons"
"spotlight"
"echo"
"invisible"
"gentle"
"loud"
"slam"
sendblue_number?: string | null

Sendblue phone number used

service?: "iMessage" | "SMS" | "RCS"

The messaging service used

One of the following:
"iMessage"
"SMS"
"RCS"
status?: "REGISTERED" | "PENDING" | "SENT" | 7 more
One of the following:
"REGISTERED"
"PENDING"
"SENT"
"DELIVERED"
"RECEIVED"
"QUEUED"
"ERROR"
"DECLINED"
"ACCEPTED"
"SUCCESS"
to_number?: string

Recipient phone number

was_downgraded?: boolean

Whether the message was downgraded from iMessage to SMS

Whether there are more messages available

Number of messages returned in this request

Number of messages skipped

Total number of messages matching the filters

status?: string
MessageRetrieveResponse { data, status }
data?: Data { accountEmail, content, date_sent, 22 more }
accountEmail?: string

Email of the account

content?: string

Message content

date_sent?: string

When the message was sent

formatdate-time
date_updated?: string

When the message was last updated

formatdate-time
error_code?: number | null

Numeric error code if message failed

error_detail?: string | null

Detailed error information

error_message?: string | null

Error message if message failed

error_reason?: string | null

Error reason if message failed

from_number?: string

Sender phone number

group_display_name?: string | null

Display name for group messages

group_id?: string | null

Group ID for group messages

is_outbound?: boolean

Whether this is an outbound message

media_url?: string | null

URL of attached media

message_handle?: string

Unique message identifier

message_type?: "message" | "group"
One of the following:
"message"
"group"
number?: string

Primary phone number (to_number for outbound, from_number for inbound)

opted_out?: boolean

Whether the recipient has opted out

participants?: Array<string>

List of participants for group messages

plan?: string

Account plan used for this message

send_style?: "celebration" | "shooting_star" | "fireworks" | 10 more

The iMessage expressive message style

One of the following:
"celebration"
"shooting_star"
"fireworks"
"lasers"
"love"
"confetti"
"balloons"
"spotlight"
"echo"
"invisible"
"gentle"
"loud"
"slam"
sendblue_number?: string | null

Sendblue phone number used

service?: "iMessage" | "SMS" | "RCS"

The messaging service used

One of the following:
"iMessage"
"SMS"
"RCS"
status?: "REGISTERED" | "PENDING" | "SENT" | 7 more
One of the following:
"REGISTERED"
"PENDING"
"SENT"
"DELIVERED"
"RECEIVED"
"QUEUED"
"ERROR"
"DECLINED"
"ACCEPTED"
"SUCCESS"
to_number?: string

Recipient phone number

was_downgraded?: boolean

Whether the message was downgraded from iMessage to SMS

status?: string