Skip to content
  • Auto
  • Light
  • Dark
Get Started

Send

Send a message
post/api/send-message

Send an iMessage, SMS, or MMS to a single recipient

Body ParametersExpand Collapse
content: string

Message text content

maxLength18996
from_number: string

REQUIRED - The phone number to send from. Must be one of your registered Sendblue phone numbers in E.164 format. Without this parameter, the message will fail to send.

number: string

Recipient phone number in E.164 format

media_url: optional string

URL of media file to send (images, videos, etc.)

formaturi
send_style: optional "celebration" or "shooting_star" or "fireworks" or 10 more

The iMessage expressive message style

Accepts one of the following:
"celebration"
"shooting_star"
"fireworks"
"lasers"
"love"
"confetti"
"balloons"
"spotlight"
"echo"
"invisible"
"gentle"
"loud"
"slam"
status_callback: optional string

Webhook URL for message status updates

formaturi
ReturnsExpand Collapse
MessageResponse = object { account_email, content, date_created, 10 more }
account_email: optional string

Email of the account that sent the message

content: optional string

Message content

date_created: optional string

When the message was created

formatdate-time
date_updated: optional string

When the message was last updated

formatdate-time
error_code: optional number

Numeric error code if message failed

error_message: optional string

Error message if message failed

from_number: optional string

Sending phone number

is_outbound: optional boolean

Whether this is an outbound message

media_url: optional string

URL of attached media

message_handle: optional string

Unique identifier for tracking the message

number: optional string

Recipient phone number

send_style: optional "celebration" or "shooting_star" or "fireworks" or 10 more

The iMessage expressive message style

Accepts one of the following:
"celebration"
"shooting_star"
"fireworks"
"lasers"
"love"
"confetti"
"balloons"
"spotlight"
"echo"
"invisible"
"gentle"
"loud"
"slam"
status: optional "QUEUED" or "SENT" or "DELIVERED" or 2 more
Accepts one of the following:
"QUEUED"
"SENT"
"DELIVERED"
"READ"
"ERROR"
Send a message
curl https://api.sendblue.co/api/send-message \
    -H 'Content-Type: application/json' \
    -H "sb-api-key-id: $SENDBLUE_API_API_KEY" \
    -H "sb-api-secret-key: $SENDBLUE_API_API_SECRET" \
    -d '{
          "content": "Hello, World!",
          "from_number": "+19998887777",
          "number": "+19998887777",
          "media_url": "https://example.com/image.jpg",
          "send_style": "celebration",
          "status_callback": "https://example.com/webhook"
        }'
{
  "account_email": "[email protected]",
  "content": "Hello, World!",
  "date_created": "2023-10-01T12:00:00Z",
  "date_updated": "2023-10-01T12:00:01Z",
  "error_code": 0,
  "error_message": "error_message",
  "from_number": "+19998887777",
  "is_outbound": true,
  "media_url": "https://cdn.sendblue.co/media/abc123.jpg",
  "message_handle": "msg_abc123def456",
  "number": "+18887776666",
  "send_style": "celebration",
  "status": "QUEUED"
}
Returns Examples
{
  "account_email": "[email protected]",
  "content": "Hello, World!",
  "date_created": "2023-10-01T12:00:00Z",
  "date_updated": "2023-10-01T12:00:01Z",
  "error_code": 0,
  "error_message": "error_message",
  "from_number": "+19998887777",
  "is_outbound": true,
  "media_url": "https://cdn.sendblue.co/media/abc123.jpg",
  "message_handle": "msg_abc123def456",
  "number": "+18887776666",
  "send_style": "celebration",
  "status": "QUEUED"
}