Skip to content
Get Started
Getting Started

Sending messages

iMessage for Business | Outbound messages documentation - Sendblue

The Sendblue API conforms to REST API standards. Using it, you can send outbound iMessage and SMS to any enabled phone globally.

In this documentation, we will cover how to:

  1. Send iMessages to a destination phone number
  2. Track the status of your message using webhooks

There are two endpoints for sending messages:

ParameterTypeRequiredDescription
numberstringYesE.164 formatted phone number of the recipient (e.g., “+19998887777”)
from_numberstringYesE.164 formatted phone number to send from (must be a number on your account)
contentstringNoThe message content to send
media_urlstringNoURL to media file to send (see Sending files)
send_stylestringNoExpressive message style (see Expressive messages)
status_callbackstringNoURL to receive status updates for this message

You can send images using the media_url parameter. This URL should be a CDN link pointing to an image. The URL must end with the proper file extension. We recommend sticking to the standard PascalCase naming convention. So if your image is named “Welcome Image”, we recommend uploading it to your CDN as “WelcomeImage.png”.

Files are currently capped at 5MB.

media_url does not support signed urls, please use the media object pattern for that.

Sendblue will POST the endpoint you provide in status_callback whenever the status of a message changes to one of the following:

  • REGISTERED
  • PENDING
  • DECLINED
  • QUEUED
  • ACCEPTED
  • SENT
  • DELIVERED
  • ERROR

Below is an example of the POST body that is sent to the status_callback URL for a sent message:

{
"accountEmail": "your-account-email",
"content": "Hello world!",
"is_outbound": true,
"status": "SENT",
"error_code": null,
"error_message": null,
"error_reason": null,
"message_handle": "5a17319e-cbcf-443e-897e-d8b0c04b1b09",
"date_sent": "2025-12-12T15:35:35.410Z",
"date_updated": "2025-12-12T15:35:35.410Z",
"from_number": "+18649820355",
"number": "+19998887777",
"to_number": "+19998887777",
"was_downgraded": null,
"plan": "dedicated",
"media_url": "",
"message_type": "message",
"group_id": "",
"participants": [],
"send_style": "",
"opted_out": false,
"error_detail": null,
"sendblue_number": null,
"service": "iMessage",
"group_display_name": null
}
Callback Body FieldTypeDescription
accountEmailstringAssociated account email
contentstringMessage content
is_outboundbooleanTrue if message is sent, false if message is received
statusstringThe current status of the message
error_codeintError code (null if no error)
error_messagestringDescriptive error message (null if no error)
error_reasonstringAdditional error context (null if no error)
error_detailstringDetailed error information (null if no error)
message_handlestringSendblue message handle
date_sentstringISO 8601 formatted date string of the date this message was created
date_updatedstringISO 8601 formatted date string of the date this message was last updated
from_numberstringE.164 formatted phone number string of the message dispatcher
numberstringE.164 formatted phone number string of your end-user (not the Sendblue-provided phone number)
to_numberstringE.164 formatted phone number string of the message recipient
was_downgradedbooleanTrue if the end user does not support iMessage, null otherwise
planstringValue of the Sendblue account plan
media_urlstringA CDN link to any media attached to the message
message_typestringType of message (e.g., “message”)
group_idstringGroup identifier (empty string for non-group messages)
participantsarrayArray of participant phone numbers
send_stylestringExpressive message style if used (empty string if none)
opted_outbooleanTrue if the recipient has opted out
sendblue_numberstringThe Sendblue phone number used
servicestringThe messaging service used (e.g., “iMessage”, “SMS”)
group_display_namestringDisplay name for group chats (null for non-group messages)

The status field will report the status. There are currently 8 different possible statuses:

StatusDescription
REGISTEREDThe message has been registered in our system
PENDINGThe message has reached our servers
DECLINEDThe message was rejected for some reason (see error_code and error_message for details)
QUEUEDThe message has passed validation and has been queued for delivery
ACCEPTEDThe message has been dequeued and is being sent
SENTThe message has been sent (terminal state for SMS, or if the receiver is not connected to the iMessage network)
DELIVEREDThe message has been delivered (terminal state for iMessage or RCS)
ERRORThe message has failed to send, see the error_code field to understand why

Any Code besides 0 or null is a failure. Some codes are not yet documented.

CodeDescription
4000Validation Error: see error_message field
4001Rate Limit Exceeded
4002Blacklisted Number (e.g. 911)
5000Internal Error
5003Server Rate Exceeded
10001message failed to send
10002failed to resolve message status

Messages sent using Sendblue must be less than 18996 characters in length. If you have larger requirements we recommend breaking the message up into several, smaller messages.

The from_number parameter is required when sending messages. This must be a phone number that is assigned to your Sendblue account.

The message handle is used so that you can query the status of each message at a later date. This is especially useful in high volume message_status=QUEUED cases or TIMEOUT cases.