The Sendblue API conforms to REST API standards. Using it, you can send outbound iMessage and SMS to any enabled phone globally. All requests can either be form-encoded or
In this documentation, we will cover how to:
You can send a message directly with cURL or by using one of our client libraries by hitting the following endpoint:
Here's what that looks like in Node.js
Sendblue will POST the endpoint you provide in
statusCallback whenever the status of a message changes to one of the following:
Below is an example of the POST body that is sent to the statusCallback URL for a delivered message:
You must send a response to our server in order to avoid receiving multiple webhook calls.
|Callback Body Field||Type||Description|
|accountEmail||Associated account email|
|is_outbound||True if message is sent, false if message is received|
|status||The current status of the message|
|error_code||error code (null if no error)|
|error_message||descriptive error message (null if no error)|
|message_handle||Sendblue message handle|
|date_sent||ISO 8601 formatted date string of the date this message was created|
|date_updated||ISO 8601 formatted date string of the date this message was last updated|
|from_number||E.164 formatted phone number string of the message dispatcher|
|number||E.164 formatted phone number string of your end-user (not the Sendblue-provided phone number)|
|to_number||E.164 formatted phone number string of the message recipient|
|was_downgraded||true if the end user does not support iMessage, false otherwise|
|plan||Value of the Sendblue account plan|
The status field will report the status. There are currently 7 different possible responses to a send-message request:
|QUEUED||The message has reached our servers, and has passed our validation checks. It has been queued for delivery|
|SENT||The message has been sent|
|DELIVERED||The message has been sent, and we've received confirmation of delivery (iMessage Only)|
|READ||The message has been sent, and we've received confirmation that the end user has read the message (iMessage Only)|
|ERROR||The message has failed to send, see the |
Any Code besides 0 or null is a failure. Some codes are not yet documented.
|4000||Validation Error: see |
|4001||Rate Limit Exceeded|
|4002||Blacklisted Number (e.g. 911)|
|5003||Server Rate Exceeded|
|10001||message failed to send|
|10002||failed 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.
Sendblue focuses on message deliverability and end-user experience. This means that each of your users will only ever interact with your business through one Sendblue phone number. However, different clients may see different numbers for texts sent from your company. See Limits & Queues for more info
The from_number field is given as a convenience to you, in case you want to keep track of that info, or tell the client that they should expect a text from the number that you show them.
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.