sendblue-api
它能做什么
这个工具让计算机程序能够通过一个电话号码发送和接收短信(SMS、iMessage、RCS)。你可以发送单人或群组消息,添加特效和表情回应,还能知道对方是否正在输入。
适用场景
- ✓当某个应用需要发送短信通知时。
- ✓当你想搭建一个能回复短信的聊天机器人时。
- ✓当你想把消息发送功能集成到更大的系统中时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/skills/sendblue/sendblue-api/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“给朋友发一条带特效的短信。”
每周 5 个新技能,1 分钟读完。
工作原理
你的程序会向 Sendblue API 发送一个请求,里面包含消息详情(发给谁、内容是什么等)。之后,Sendblue 会通过你配置的电话号码完成发送。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
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"
}
…
常见问题
iMessage、SMS 和 RCS 是什么?
它们是几种不同的发信方式。iMessage 是苹果的服务(气泡为蓝色),SMS 是传统短信,RCS 则是更现代的短信升级版。
什么是“webhook”?
它就像一种“通知”。当有新消息到达,或你发出的消息已送达时,Sendblue 会把这个通知发送给你的程序。
可以发送图片和视频吗?
可以,你可以发送照片、视频等媒体文件,但大小限制取决于是 iMessage 还是 SMS。
详情
作者的原始描述
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.
热度
- GitHub 星标
- 48k
- 排名
- #6293
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。