Sendblue API
Overview
Sendblue is a REST API that sends iMessage (blue bubbles), SMS, and RCS from a provisioned phone number. Everything is plain JSON over HTTPS — no SDK is required. The API covers outbound 1:1 and group sends, iMessage effects, reactions, typing indicators, status callbacks, and inbound webhooks.
When to Use This Skill
- Use when writing application code (server, worker, function) that sends Sendblue messages as part of a long-running service.
- Use when receiving inbound messages via webhooks.
- Use when you need features the CLI does not expose: send styles, reactions, group messages, typing indicators, status callbacks, media uploads, or the contacts API beyond basic CRUD.
- Reach for [[sendblue-cli]] instead for shell-context outbound: one-shot scripts, cron jobs, agent hooks, "ping me when X" workflows.
Operational boundaries
These are imported documentation examples; no CLI, daemon, server or hook runtime
is bundled. Verify the pinned upstream version, account, billing, current limits and
actual command/API schema before use. Never print credentials (whoami/show-keys
may expose them) to agent output or logs. Authorization for drafting is not sending.
Do not circumvent provider anti-abuse limits by distributing sends across lines.
How It Works
Step 1: Authenticate
https://api.sendblue.com
Every request needs two headers:
sb-api-key-id: <YOUR_API_KEY_ID>
sb-api-secret-key: <YOUR_API_SECRET>
Content-Type: application/json
Keep both values server-side — never ship them to a browser or mobile client.
Step 2: Send a message
curl -X POST https://api.sendblue.com/api/send-message \
-H "sb-api-key-id: $KEY_ID" \
-H "sb-api-secret-key: $SECRET" \
-H 'Content-Type: application/json' \
-d '{
"number": "+15551234567",
"from_number": "+1YOUR_SENDBLUE_NUMBER",
"content": "Hello from the API!"
}'
Phone numbers must be E.164. from_number must be a line you own — list yours with GET /api/lines.
Step 3: Track delivery
The synchronous response includes a message_handle (Apple GUID — persist this; you need it for reactions and replies) and a status from REGISTERED, PENDING, QUEUED, ACCEPTED, SENT, DELIVERED, DECLINED, ERROR. Only DELIVERED means it landed. Use status_callback instead of polling /api/status.
Step 4: Receive inbound
Configure webhook URLs in the dashboard or via POST /api/account/webhooks. Sendblue POSTs JSON to your endpoint. Respond with 2xx promptly — non-2xx triggers retries and duplicate deliveries. Event types: receive, outbound, typing_indicator, call_log, line_blocked, line_assigned, contact_created.
Core Endpoints
| Method |
Path |
Purpose |
| POST |
/api/send-message |
Send a 1:1 message (text and/or media) |
| POST |
/api/send-group-message |
Send to multiple recipients |
| POST |
/api/create-group |
Create a named group thread |
| POST |
/api/send-reaction |
Send a tapback (love/like/dislike/laugh/emphasize/question) |
| POST |
/api/send-typing-indicator |
Show "typing…" in the recipient's thread |
| POST |
/api/mark-read |
Send a read receipt |
| POST |
/api/upload-file / /api/upload-media-object |
Upload media (direct or from URL) |
| GET |
/api/status |
Poll a message's delivery status |
| GET |
/api/evaluate-service |
Check whether a number is on iMessage |
| GET |
/api/v2/messages / /api/v2/messages/:id |
Read message history |
| GET / POST / PUT / DELETE |
/api/v2/contacts[...] |
Manage contacts |
| GET |
/api/lines |
List your Sendblue phone numbers |
| POST |
/api/account/webhooks |
CRUD webhook subscriptions |
Examples
Example 1: Send with media, effects, and a status callback
POST /api/send-message
{
"number": "+15551234567",
"from_number": "+1YOUR_SENDBLUE_NUMBER",
"content": "Optional text",
"media_url": "https://example.com/img.jpg",
"send_style": "celebration",
"status_callback": "https://yourapp.com/sendblue/status"
}
content and/or media_url is required. send_style is iMessage-only — valid values: celebration, shooting_star, fireworks, lasers, love, confetti, balloons, spotlight, echo, invisible, gentle, loud, slam. Ignored on SMS. Text up to 18,996 chars; media up to 100 MB on iMessage, 5 MB on SMS.
Example 2: Group message
POST /api/send-group-message
{
"numbers": ["+15551234567", "+15557654321"],
"from_number": "+1YOUR_SENDBLUE_NUMBER",
"content": "Hey team"
}
The response returns a group_id — persist it to send follow-ups into the same thread instead of creating a new one each time.
Example 3: React to a message
POST /api/send-reaction
{
"from_number": "+1YOUR_SENDBLUE_NUMBER",
"message_handle": "<message_handle from prior send>",
"reaction": "love"
}
Reactions only work on iMessage and need the original message's message_handle. Valid values: love, like, dislike, laugh, emphasize, question.
Example 4: Inbound webhook payload (receive)
{
"accountEmail": "you@example.com",
"content": "Reply text",
"media_url": "https://...",
"is_outbound": false,
"number": "+15551234567",
"from_number": "+1YOUR_SENDBLUE_NUMBER",
"service": "iMessage",
"group_id": "...",
"date_sent": "2024-01-01T12:00:00Z"
}
Status callback payloads (outbound) mirror the send-message response and update as the message moves through SENT → DELIVERED (or ERROR).
Best Practices
- ✅ Persist
message_handle on every send. You need it for reactions, replies, and correlating status callbacks.
- ✅ Use
status_callback over polling. It's lower-cost and more accurate than GET /api/status.
- ✅ Return 2xx fast from your webhook, then process async. Non-2xx triggers duplicate deliveries.
- ✅ Check service with
/api/evaluate-service before relying on iMessage-only features for a recipient.
- ✅ Retain media only when authorized, with bounded downloads, content validation, malware precautions and a documented deletion policy; verify current URL expiry.
- ❌ Don't ship
sb-api-key-id / sb-api-secret-key to a client. They are server-side credentials.
- ❌ Don't treat a 200 on
/api/send-message as delivery. It only means "accepted".
Limitations
- Synchronous send responses only report acceptance, not delivery. Final state arrives via
status_callback or GET /api/status.
send_style silently no-ops on SMS (green-bubble recipients).
- Inbound media URLs expire in ~30 days.
- Per-line rate limits apply; bursting many sends from one number can trip Apple's spam heuristics — respect provider limits and recipient consent; do not rotate lines to evade controls.
- Reactions and effects are iMessage-only.
Security & Safety Notes
- Keep
sb-api-key-id and sb-api-secret-key server-side. They are not safe in browser, mobile, or CI logs.
- Treat every outbound send, contact/webhook mutation, read receipt, reaction, or typing indicator as state-changing. Preview the recipient, sender line, content, and callback/webhook changes, then wait for explicit user confirmation before sending.
- Webhook endpoints require HTTPS, verified provider authentication/signatures where supported, replay protection, bounded bodies and event-level idempotency. A message can have multiple legitimate status updates: do not deduplicate every event solely by message_handle. Acknowledge after durable enqueue; reject unauthenticated input.
- Sensitive data in message content is visible in lock-screen previews on the recipient's device. Don't embed secrets, tokens, or full PII — link to an authenticated dashboard or shortened payload instead.
- Rotate API keys from the Sendblue dashboard if either value is exposed; the old pair is invalidated on rotation.
Common Pitfalls
- E.164 only.
5551234567 or (555) 123-4567 will fail — always send +15551234567.
from_number must be one of your lines. A spoofed or unprovisioned number returns an error.
send_style silently no-ops on SMS. If the recipient is green-bubble, effects don't render — check service first with /api/evaluate-service if it matters.
- Store
message_handle. You need it for reactions, replies, and correlating status callbacks back to your records.
- Media URLs expire in ~30 days. If you need durable media from inbound webhooks, retain only if authorized under a documented privacy/retention policy.
- Status is async. A 200 on
/api/send-message means accepted, not delivered. Use status_callback rather than blocking on the synchronous response.
- Webhook retries on non-2xx. Return 200 even when you've decided to ignore the event; otherwise expect duplicate deliveries.
- Rate limits apply per line. Bursting many sends from one number trips Apple's spam heuristics — respect provider limits and recipient consent; do not rotate lines to evade controls.
Related Skills
@sendblue-cli — Shell wrapper for shell-context outbound (scripts, cron, agent hooks). Use it when you don't need a full HTTP integration.
@sendblue-notify — Patterns and copy rules for outbound "text me when X is done" notifications layered on top of the API or CLI.
Links
- Full reference: https://docs.sendblue.com/
- Sendblue: https://sendblue.com
- Useful undocumented-here features: carousels (
/api/send-carousel), FaceTime/contact-card sharing, advanced webhook filtering, contacts API beyond basic CRUD — see the docs site.
1---2name: sendblue-api3description: "Send and receive iMessage, SMS, and RCS from application code via the Sendblue HTTP API — text, media, group messages, send styles, reactions, typing indicators, status callbacks, and inbound webhooks."4category: api-integration5risk: critical6source: community7source_type: official8date_added: "2026-05-22"9author: AnthonyFirth10tags: [sendblue, imessage, sms, rcs, messaging, api, webhooks]11tools: [claude, cursor, gemini]12plugin:13 targets:14 codex: blocked15 claude: blocked16metadata:17 source: https://skillmd.com/skills/sickn33/sendblue-api18---1920# Sendblue API2122## Overview2324Sendblue is a REST API that sends iMessage (blue bubbles), SMS, and RCS from a provisioned phone number. Everything is plain JSON over HTTPS — no SDK is required. The API covers outbound 1:1 and group sends, iMessage effects, reactions, typing indicators, status callbacks, and inbound webhooks.2526## When to Use This Skill2728- Use when writing application code (server, worker, function) that sends Sendblue messages as part of a long-running service.29- Use when receiving inbound messages via webhooks.30- Use when you need features the CLI does not expose: send styles, reactions, group messages, typing indicators, status callbacks, media uploads, or the contacts API beyond basic CRUD.31- Reach for [[sendblue-cli]] instead for shell-context outbound: one-shot scripts, cron jobs, agent hooks, "ping me when X" workflows.3233## Operational boundaries3435These are imported documentation examples; no CLI, daemon, server or hook runtime36is bundled. Verify the pinned upstream version, account, billing, current limits and37actual command/API schema before use. Never print credentials (`whoami`/`show-keys`38may expose them) to agent output or logs. Authorization for drafting is not sending.39Do not circumvent provider anti-abuse limits by distributing sends across lines.4041## How It Works4243### Step 1: Authenticate4445```46https://api.sendblue.com47```4849Every request needs two headers:5051```52sb-api-key-id: <YOUR_API_KEY_ID>53sb-api-secret-key: <YOUR_API_SECRET>54Content-Type: application/json55```5657Keep both values server-side — never ship them to a browser or mobile client.5859### Step 2: Send a message6061```bash62curl -X POST https://api.sendblue.com/api/send-message \63 -H "sb-api-key-id: $KEY_ID" \64 -H "sb-api-secret-key: $SECRET" \65 -H 'Content-Type: application/json' \66 -d '{67 "number": "+15551234567",68 "from_number": "+1YOUR_SENDBLUE_NUMBER",69 "content": "Hello from the API!"70 }'71```7273Phone numbers must be E.164. `from_number` must be a line you own — list yours with `GET /api/lines`.7475### Step 3: Track delivery7677The synchronous response includes a `message_handle` (Apple GUID — persist this; you need it for reactions and replies) and a `status` from `REGISTERED`, `PENDING`, `QUEUED`, `ACCEPTED`, `SENT`, `DELIVERED`, `DECLINED`, `ERROR`. Only `DELIVERED` means it landed. Use `status_callback` instead of polling `/api/status`.7879### Step 4: Receive inbound8081Configure webhook URLs in the dashboard or via `POST /api/account/webhooks`. Sendblue POSTs JSON to your endpoint. Respond with 2xx promptly — non-2xx triggers retries and duplicate deliveries. Event types: `receive`, `outbound`, `typing_indicator`, `call_log`, `line_blocked`, `line_assigned`, `contact_created`.8283## Core Endpoints8485| Method | Path | Purpose |86|--------|------|---------|87| POST | `/api/send-message` | Send a 1:1 message (text and/or media) |88| POST | `/api/send-group-message` | Send to multiple recipients |89| POST | `/api/create-group` | Create a named group thread |90| POST | `/api/send-reaction` | Send a tapback (love/like/dislike/laugh/emphasize/question) |91| POST | `/api/send-typing-indicator` | Show "typing…" in the recipient's thread |92| POST | `/api/mark-read` | Send a read receipt |93| POST | `/api/upload-file` / `/api/upload-media-object` | Upload media (direct or from URL) |94| GET | `/api/status` | Poll a message's delivery status |95| GET | `/api/evaluate-service` | Check whether a number is on iMessage |96| GET | `/api/v2/messages` / `/api/v2/messages/:id` | Read message history |97| GET / POST / PUT / DELETE | `/api/v2/contacts[...]` | Manage contacts |98| GET | `/api/lines` | List your Sendblue phone numbers |99| POST | `/api/account/webhooks` | CRUD webhook subscriptions |100101## Examples102103### Example 1: Send with media, effects, and a status callback104105```json106POST /api/send-message107{108 "number": "+15551234567",109 "from_number": "+1YOUR_SENDBLUE_NUMBER",110 "content": "Optional text",111 "media_url": "https://example.com/img.jpg",112 "send_style": "celebration",113 "status_callback": "https://yourapp.com/sendblue/status"114}115```116117`content` and/or `media_url` is required. `send_style` is iMessage-only — valid values: `celebration`, `shooting_star`, `fireworks`, `lasers`, `love`, `confetti`, `balloons`, `spotlight`, `echo`, `invisible`, `gentle`, `loud`, `slam`. Ignored on SMS. Text up to 18,996 chars; media up to 100 MB on iMessage, 5 MB on SMS.118119### Example 2: Group message120121```json122POST /api/send-group-message123{124 "numbers": ["+15551234567", "+15557654321"],125 "from_number": "+1YOUR_SENDBLUE_NUMBER",126 "content": "Hey team"127}128```129130The response returns a `group_id` — persist it to send follow-ups into the same thread instead of creating a new one each time.131132### Example 3: React to a message133134```json135POST /api/send-reaction136{137 "from_number": "+1YOUR_SENDBLUE_NUMBER",138 "message_handle": "<message_handle from prior send>",139 "reaction": "love"140}141```142143Reactions only work on iMessage and need the original message's `message_handle`. Valid values: `love`, `like`, `dislike`, `laugh`, `emphasize`, `question`.144145### Example 4: Inbound webhook payload (`receive`)146147```json148{149 "accountEmail": "you@example.com",150 "content": "Reply text",151 "media_url": "https://...",152 "is_outbound": false,153 "number": "+15551234567",154 "from_number": "+1YOUR_SENDBLUE_NUMBER",155 "service": "iMessage",156 "group_id": "...",157 "date_sent": "2024-01-01T12:00:00Z"158}159```160161Status callback payloads (`outbound`) mirror the send-message response and update as the message moves through `SENT` → `DELIVERED` (or `ERROR`).162163## Best Practices164165- ✅ **Persist `message_handle` on every send.** You need it for reactions, replies, and correlating status callbacks.166- ✅ **Use `status_callback` over polling.** It's lower-cost and more accurate than `GET /api/status`.167- ✅ **Return 2xx fast from your webhook**, then process async. Non-2xx triggers duplicate deliveries.168- ✅ **Check service with `/api/evaluate-service`** before relying on iMessage-only features for a recipient.169- ✅ **Retain media only when authorized**, with bounded downloads, content validation, malware precautions and a documented deletion policy; verify current URL expiry.170- ❌ **Don't ship `sb-api-key-id` / `sb-api-secret-key` to a client.** They are server-side credentials.171- ❌ **Don't treat a 200 on `/api/send-message` as delivery.** It only means "accepted".172173## Limitations174175- Synchronous send responses only report acceptance, not delivery. Final state arrives via `status_callback` or `GET /api/status`.176- `send_style` silently no-ops on SMS (green-bubble recipients).177- Inbound media URLs expire in ~30 days.178- Per-line rate limits apply; bursting many sends from one number can trip Apple's spam heuristics — respect provider limits and recipient consent; do not rotate lines to evade controls.179- Reactions and effects are iMessage-only.180181## Security & Safety Notes182183- Keep `sb-api-key-id` and `sb-api-secret-key` server-side. They are not safe in browser, mobile, or CI logs.184- Treat every outbound send, contact/webhook mutation, read receipt, reaction, or typing indicator as state-changing. Preview the recipient, sender line, content, and callback/webhook changes, then wait for explicit user confirmation before sending.185- Webhook endpoints require HTTPS, verified provider authentication/signatures where supported, replay protection, bounded bodies and event-level idempotency. A message can have multiple legitimate status updates: do not deduplicate every event solely by message_handle. Acknowledge after durable enqueue; reject unauthenticated input.186- Sensitive data in message content is visible in lock-screen previews on the recipient's device. Don't embed secrets, tokens, or full PII — link to an authenticated dashboard or shortened payload instead.187- Rotate API keys from the Sendblue dashboard if either value is exposed; the old pair is invalidated on rotation.188189## Common Pitfalls190191- **E.164 only.** `5551234567` or `(555) 123-4567` will fail — always send `+15551234567`.192- **`from_number` must be one of your lines.** A spoofed or unprovisioned number returns an error.193- **`send_style` silently no-ops on SMS.** If the recipient is green-bubble, effects don't render — check service first with `/api/evaluate-service` if it matters.194- **Store `message_handle`.** You need it for reactions, replies, and correlating status callbacks back to your records.195- **Media URLs expire in ~30 days.** If you need durable media from inbound webhooks, retain only if authorized under a documented privacy/retention policy.196- **Status is async.** A 200 on `/api/send-message` means accepted, not delivered. Use `status_callback` rather than blocking on the synchronous response.197- **Webhook retries on non-2xx.** Return 200 even when you've decided to ignore the event; otherwise expect duplicate deliveries.198- **Rate limits apply per line.** Bursting many sends from one number trips Apple's spam heuristics — respect provider limits and recipient consent; do not rotate lines to evade controls.199200## Related Skills201202- `@sendblue-cli` — Shell wrapper for shell-context outbound (scripts, cron, agent hooks). Use it when you don't need a full HTTP integration.203- `@sendblue-notify` — Patterns and copy rules for outbound "text me when X is done" notifications layered on top of the API or CLI.204205## Links206207- Full reference: <https://docs.sendblue.com/>208- Sendblue: <https://sendblue.com>209- Useful undocumented-here features: carousels (`/api/send-carousel`), FaceTime/contact-card sharing, advanced webhook filtering, contacts API beyond basic CRUD — see the docs site.