Skip to main content
POST
Send a message.

Authorizations

Authorization
string
header
required

A person's session: Authorization: Bearer <ID token>, the ID token the Sendblue sign-in issues. The person acts in their company's root account with the role of their seat.

Headers

Idempotency-Key
string
required

A value unique to this intended write, 1 to 128 visible ASCII characters. A repeat with the same key returns the original result.

Required string length: 1 - 128
Pattern: ^[\x21-\x7E]+$

Body

application/json
to
string
required

A phone number in E.164 form.

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

"+14155550100"

from
string

A number the account owns. Required unless campaign_id is given.

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

"+14155550100"

campaign_id
string

Send from this campaign's numbers. With from, that number must belong to it.

body
string

Required unless attachments are given.

Maximum string length: 1600
media_urls
string<uri>[]

Public https URLs of attachments. Sends the message as MMS.

Maximum array length: 10
media_ids
string[]

Uploads owned by this account, in delivery order. Use these or media_urls. A qualified strict iMessage sender accepts one upload. An upload must remain readable when the transport retrieves it.

Required array length: 1 - 10 elements
status_callback
string<uri>

A public https URL that receives the message's status changes.

send_at
string<date-time>

Send later, between 15 minutes and 35 days from now. Needs campaign_id.

validity_period_seconds
integer

Fail the message if it has not been handed to the carrier in this time.

Required range: 1 <= x <= 36000
max_price_micro_usd
integer<int64>

Refuse the message if it would cost more than this.

Required range: x >= 1

Response

The message was accepted.

id
string
required
direction
enum<string>
required

outbound_reply is a message a TwiML reply to an inbound message sent.

Available options:
inbound,
outbound_api,
outbound_reply
status
enum<string>
required
Available options:
scheduled,
queued,
sending,
sent,
delivered,
undelivered,
failed,
canceled,
received,
unknown
to
string
required

A phone number in E.164 form.

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

"+14155550100"

from
string | null
required

The sender. Null until a campaign has chosen one.

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

"+14155550100"

campaign_id
string | null
required

The campaign the message was sent through, if one was named.

body
string
required

Empty after redaction.

media_urls
string<uri>[]
required

Ordered attachment URLs. Outbound messages retain the submitted URLs. Inbound messages link to Omni Media resources that require the owning account's credentials.

segments
integer | null
required

SMS segments, once known.

price
object | null
required

What the message cost, once settled.

Example:
error_code
integer | null
required

The failure class of a failed or undelivered message.

status_callback
string<uri> | null
required
created_at
string<date-time>
required

RFC 3339, UTC.

updated_at
string<date-time>
required

RFC 3339, UTC.

sent_at
string<date-time> | null
required
delivery_evidence
enum<string>

Evidence that an iMessage line sent the message. verified is the strongest evidence, read from the sending device's own record. reported means the device's authenticated report was corroborated by a second check. reported_unconfirmed means the report lacks that corroboration. The message status separately records recipient delivery.

Available options:
verified,
unknown,
reported,
reported_unconfirmed
billing_status
enum<string>

The reservation is held, captured, released without charge, or awaiting review by Sendblue after a late affirmative report.

Available options:
held,
charged,
uncharged,
review
usage
object

A composed SMS or MMS reservation or settlement. Amounts become available when the corresponding financial decision is posted. An explicit zero is a confirmed amount.