Skip to main content
POST
JavaScript

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

account_id
string
required

The account from which the message should be sent.

Example:

"acct_01j9a43avnfqzbjfch6pygv1td"

Body

application/json

Create a message while including parameters for the conversation in which the message should be sent.

conversation
ConversationParams · object
required

Params for selecting or creating a new conversation. Either the id or the Contact must be given.

Example:
attachments
AttachmentParams · object[]
body
string

The message body.

metadata
Metadata · object

Set of key-value pairs that will be stored with the object.

send_at
string<date-time>

An optional datetime for scheduling message up to a couple of months in the future.

settings
MessageSettingsParams · object

Per-message setting overrides.

Example:

Response

Created message

A Message is a communication sent to a Contact.

created_at
string<date-time> | null
required

When the message was added to the conversation, in ISO8601 UTC format. Null for scheduled messages until they are created. For imported messages, this is the original creation time.

attachments
Attachment · object[]
blast_id
string | null

The ID of the blast this message belongs to, if any. This can be used to attribute messages back to a specific blast.

body
string | null

The message body.

conversation
Conversation · object

A conversation with a Contact

Example:
failure_reason
string | null

The reason the message failed, or null if no failure reason is set.

id
string

Unique identifier for the object.

metadata
Metadata · object

Set of key-value pairs that will be stored with the object.

status
enum<string>

The current status of the message.

Available options:
pending,
received,
sent,
delivered,
failed