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.
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.
- ✅ Rehost inbound media on receipt — media URLs expire in ~30 days.
- ❌ 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 — pace them or split across lines.
- 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 should be on HTTPS and idempotent — same
message_handle may arrive more than once.
- 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, download and re-host on receipt.
- 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 — pace them or split across lines.
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/mhassan0000/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## How It Works3435### Step 1: Authenticate3637```38https://api.sendblue.com39```4041Every request needs two headers:4243```44sb-api-key-id: <YOUR_API_KEY_ID>45sb-api-secret-key: <YOUR_API_SECRET>46Content-Type: application/json47```4849Keep both values server-side — never ship them to a browser or mobile client.5051### Step 2: Send a message5253```bash54curl -X POST https://api.sendblue.com/api/send-message \55 -H "sb-api-key-id: $KEY_ID" \56 -H "sb-api-secret-key: $SECRET" \57 -H 'Content-Type: application/json' \58 -d '{59 "number": "+15551234567",60 "from_number": "+1YOUR_SENDBLUE_NUMBER",61 "content": "Hello from the API!"62 }'63```6465Phone numbers must be E.164. `from_number` must be a line you own — list yours with `GET /api/lines`.6667### Step 3: Track delivery6869The 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`.7071### Step 4: Receive inbound7273Configure 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`.7475## Core Endpoints7677| Method | Path | Purpose |78|--------|------|---------|79| POST | `/api/send-message` | Send a 1:1 message (text and/or media) |80| POST | `/api/send-group-message` | Send to multiple recipients |81| POST | `/api/create-group` | Create a named group thread |82| POST | `/api/send-reaction` | Send a tapback (love/like/dislike/laugh/emphasize/question) |83| POST | `/api/send-typing-indicator` | Show "typing…" in the recipient's thread |84| POST | `/api/mark-read` | Send a read receipt |85| POST | `/api/upload-file` / `/api/upload-media-object` | Upload media (direct or from URL) |86| GET | `/api/status` | Poll a message's delivery status |87| GET | `/api/evaluate-service` | Check whether a number is on iMessage |88| GET | `/api/v2/messages` / `/api/v2/messages/:id` | Read message history |89| GET / POST / PUT / DELETE | `/api/v2/contacts[...]` | Manage contacts |90| GET | `/api/lines` | List your Sendblue phone numbers |91| POST | `/api/account/webhooks` | CRUD webhook subscriptions |9293## Examples9495### Example 1: Send with media, effects, and a status callback9697```json98POST /api/send-message99{100 "number": "+15551234567",101 "from_number": "+1YOUR_SENDBLUE_NUMBER",102 "content": "Optional text",103 "media_url": "https://example.com/img.jpg",104 "send_style": "celebration",105 "status_callback": "https://yourapp.com/sendblue/status"106}107```108109`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.110111### Example 2: Group message112113```json114POST /api/send-group-message115{116 "numbers": ["+15551234567", "+15557654321"],117 "from_number": "+1YOUR_SENDBLUE_NUMBER",118 "content": "Hey team"119}120```121122The response returns a `group_id` — persist it to send follow-ups into the same thread instead of creating a new one each time.123124### Example 3: React to a message125126```json127POST /api/send-reaction128{129 "from_number": "+1YOUR_SENDBLUE_NUMBER",130 "message_handle": "<message_handle from prior send>",131 "reaction": "love"132}133```134135Reactions only work on iMessage and need the original message's `message_handle`. Valid values: `love`, `like`, `dislike`, `laugh`, `emphasize`, `question`.136137### Example 4: Inbound webhook payload (`receive`)138139```json140{141 "accountEmail": "you@example.com",142 "content": "Reply text",143 "media_url": "https://...",144 "is_outbound": false,145 "number": "+15551234567",146 "from_number": "+1YOUR_SENDBLUE_NUMBER",147 "service": "iMessage",148 "group_id": "...",149 "date_sent": "2024-01-01T12:00:00Z"150}151```152153Status callback payloads (`outbound`) mirror the send-message response and update as the message moves through `SENT` → `DELIVERED` (or `ERROR`).154155## Best Practices156157- ✅ **Persist `message_handle` on every send.** You need it for reactions, replies, and correlating status callbacks.158- ✅ **Use `status_callback` over polling.** It's lower-cost and more accurate than `GET /api/status`.159- ✅ **Return 2xx fast from your webhook**, then process async. Non-2xx triggers duplicate deliveries.160- ✅ **Check service with `/api/evaluate-service`** before relying on iMessage-only features for a recipient.161- ✅ **Rehost inbound media on receipt** — media URLs expire in ~30 days.162- ❌ **Don't ship `sb-api-key-id` / `sb-api-secret-key` to a client.** They are server-side credentials.163- ❌ **Don't treat a 200 on `/api/send-message` as delivery.** It only means "accepted".164165## Limitations166167- Synchronous send responses only report acceptance, not delivery. Final state arrives via `status_callback` or `GET /api/status`.168- `send_style` silently no-ops on SMS (green-bubble recipients).169- Inbound media URLs expire in ~30 days.170- Per-line rate limits apply; bursting many sends from one number can trip Apple's spam heuristics — pace them or split across lines.171- Reactions and effects are iMessage-only.172173## Security & Safety Notes174175- Keep `sb-api-key-id` and `sb-api-secret-key` server-side. They are not safe in browser, mobile, or CI logs.176- 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.177- Webhook endpoints should be on HTTPS and idempotent — same `message_handle` may arrive more than once.178- 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.179- Rotate API keys from the Sendblue dashboard if either value is exposed; the old pair is invalidated on rotation.180181## Common Pitfalls182183- **E.164 only.** `5551234567` or `(555) 123-4567` will fail — always send `+15551234567`.184- **`from_number` must be one of your lines.** A spoofed or unprovisioned number returns an error.185- **`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.186- **Store `message_handle`.** You need it for reactions, replies, and correlating status callbacks back to your records.187- **Media URLs expire in ~30 days.** If you need durable media from inbound webhooks, download and re-host on receipt.188- **Status is async.** A 200 on `/api/send-message` means accepted, not delivered. Use `status_callback` rather than blocking on the synchronous response.189- **Webhook retries on non-2xx.** Return 200 even when you've decided to ignore the event; otherwise expect duplicate deliveries.190- **Rate limits apply per line.** Bursting many sends from one number trips Apple's spam heuristics — pace them or split across lines.191192## Related Skills193194- `@sendblue-cli` — Shell wrapper for shell-context outbound (scripts, cron, agent hooks). Use it when you don't need a full HTTP integration.195- `@sendblue-notify` — Patterns and copy rules for outbound "text me when X is done" notifications layered on top of the API or CLI.196197## Links198199- Full reference: <https://docs.sendblue.com/>200- Sendblue: <https://sendblue.com>201- Useful undocumented-here features: carousels (`/api/send-carousel`), FaceTime/contact-card sharing, advanced webhook filtering, contacts API beyond basic CRUD — see the docs site.