Skip to content
Get Started

Messages

Operations for sending and managing messages

Get messages
messages.list(MessageListParams**kwargs) -> MessageListResponse
GET/api/v2/messages
Get a specific message
messages.retrieve(strmessage_id) -> MessageRetrieveResponse
GET/api/v2/messages/{message_id}
Send a message
messages.send(MessageSendParams**kwargs) -> MessageResponse
POST/api/send-message
Get message status
messages.get_status(MessageGetStatusParams**kwargs) -> MessageResponse
GET/api/status
ModelsExpand Collapse
class MessageContent:
account_email: Optional[str]

Email of the account

content: Optional[str]

Message content

date_created: Optional[datetime]

When the message was created

formatdate-time
date_sent: Optional[datetime]

When the message was sent

formatdate-time
date_updated: Optional[datetime]

When the message was last updated

formatdate-time
from_number: Optional[str]

Sender phone number

is_outbound: Optional[bool]

Whether this is an outbound message

media_url: Optional[str]

URL of attached media

message_handle: Optional[str]

Unique message identifier

send_style: Optional[Literal["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: Optional[Literal["QUEUED", "SENT", "DELIVERED", 2 more]]
One of the following:
"QUEUED"
"SENT"
"DELIVERED"
"ERROR"
"RECEIVED"
to_number: Optional[str]

Recipient phone number

class MessageResponse:
account_email: Optional[str]

Email of the account that sent the message

content: Optional[str]

Message content

date_created: Optional[datetime]

When the message was created

formatdate-time
date_updated: Optional[datetime]

When the message was last updated

formatdate-time
error_code: Optional[int]

Numeric error code if message failed

error_message: Optional[str]

Error message if message failed

from_number: Optional[str]

Sending phone number

is_outbound: Optional[bool]

Whether this is an outbound message

media_url: Optional[str]

URL of attached media

message_handle: Optional[str]

Unique identifier for tracking the message

number: Optional[str]

Recipient phone number

send_style: Optional[Literal["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: Optional[Literal["QUEUED", "SENT", "DELIVERED", "ERROR"]]
One of the following:
"QUEUED"
"SENT"
"DELIVERED"
"ERROR"
class MessageListResponse:
data: Optional[List[Data]]
account_email: Optional[str]

Email of the account

content: Optional[str]

Message content

date_sent: Optional[datetime]

When the message was sent

formatdate-time
date_updated: Optional[datetime]

When the message was last updated

formatdate-time
error_code: Optional[int]

Numeric error code if message failed

error_detail: Optional[str]

Detailed error information

error_message: Optional[str]

Error message if message failed

error_reason: Optional[str]

Error reason if message failed

from_number: Optional[str]

Sender phone number

group_display_name: Optional[str]

Display name for group messages

group_id: Optional[str]

Group ID for group messages

is_outbound: Optional[bool]

Whether this is an outbound message

media_url: Optional[str]

URL of attached media

message_handle: Optional[str]

Unique message identifier

message_type: Optional[Literal["message", "group"]]
One of the following:
"message"
"group"
number: Optional[str]

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

opted_out: Optional[bool]

Whether the recipient has opted out

participants: Optional[List[str]]

List of participants for group messages

plan: Optional[str]

Account plan used for this message

send_style: Optional[Literal["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: Optional[str]

Sendblue phone number used

service: Optional[Literal["iMessage", "SMS", "RCS"]]

The messaging service used

One of the following:
"iMessage"
"SMS"
"RCS"
status: Optional[Literal["REGISTERED", "PENDING", "SENT", 7 more]]
One of the following:
"REGISTERED"
"PENDING"
"SENT"
"DELIVERED"
"RECEIVED"
"QUEUED"
"ERROR"
"DECLINED"
"ACCEPTED"
"SUCCESS"
to_number: Optional[str]

Recipient phone number

was_downgraded: Optional[bool]

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: Optional[str]
class MessageRetrieveResponse:
data: Optional[Data]
account_email: Optional[str]

Email of the account

content: Optional[str]

Message content

date_sent: Optional[datetime]

When the message was sent

formatdate-time
date_updated: Optional[datetime]

When the message was last updated

formatdate-time
error_code: Optional[int]

Numeric error code if message failed

error_detail: Optional[str]

Detailed error information

error_message: Optional[str]

Error message if message failed

error_reason: Optional[str]

Error reason if message failed

from_number: Optional[str]

Sender phone number

group_display_name: Optional[str]

Display name for group messages

group_id: Optional[str]

Group ID for group messages

is_outbound: Optional[bool]

Whether this is an outbound message

media_url: Optional[str]

URL of attached media

message_handle: Optional[str]

Unique message identifier

message_type: Optional[Literal["message", "group"]]
One of the following:
"message"
"group"
number: Optional[str]

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

opted_out: Optional[bool]

Whether the recipient has opted out

participants: Optional[List[str]]

List of participants for group messages

plan: Optional[str]

Account plan used for this message

send_style: Optional[Literal["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: Optional[str]

Sendblue phone number used

service: Optional[Literal["iMessage", "SMS", "RCS"]]

The messaging service used

One of the following:
"iMessage"
"SMS"
"RCS"
status: Optional[Literal["REGISTERED", "PENDING", "SENT", 7 more]]
One of the following:
"REGISTERED"
"PENDING"
"SENT"
"DELIVERED"
"RECEIVED"
"QUEUED"
"ERROR"
"DECLINED"
"ACCEPTED"
"SUCCESS"
to_number: Optional[str]

Recipient phone number

was_downgraded: Optional[bool]

Whether the message was downgraded from iMessage to SMS

status: Optional[str]