API 参考
邮件与会话
发送、获取、搜索、回复邮件,并查看投递事件。
没有与此筛选条件匹配的操作。
/emails发送一封邮件
从工作区的已验证域名发送事务性的 HTML、纯文本或托管模板内容。如果已为该已验证的发信域名启用营销邮件,直接发送时可以将 message_class 设为 marketing。营销邮件会自动添加托管的退订邮件头,除非已配置的第一方集成提供了自己的可见 HTTPS 一键退订 URL。
curl https://sendhq.cc/api/v1/emails \
-X POST \
-H "Authorization: Bearer $SENDHQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{"from":"Acme <hello@example.com>","to":["customer@example.net"],"subject":"Welcome aboard","html":"<h1>Welcome</h1><p>Your workspace is ready.</p>","text":"Welcome. Your workspace is ready."}'{
"id": "em_…",
"providerMessageId": "provider-id",
"threadId": "em_…"
}/emails/batch发送最多 100 封个性化邮件
发送最多 100 封个性化邮件
curl https://sendhq.cc/api/v1/emails/batch \
-X POST \
-H "Authorization: Bearer $SENDHQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{"emails":[{"from":"Acme <hello@example.com>","to":["customer@example.net"],"subject":"Welcome aboard","html":"<h1>Welcome</h1><p>Your workspace is ready.</p>","text":"Welcome. Your workspace is ready."}]}'{
"data": [
{
"index": 0,
"ok": true,
"id": "em_…"
}
],
"count": 1,
"successful": 1,
"failed": 0
}/emails列出已发送和已收到的邮件
Newest-first list with filters. `query` searches subjects, bodies, participants, and attachment filenames. `label`, `domain`, and `category` accept one value or a comma-separated list (matches any); labels may be IDs or names. `outcome` filters sent mail to `bounced`, `complained`, `failed`, or `rejected` (comma-separated, matches any). `archived=false` returns the Inbox view for received mail. Received mail is classified as `primary`, `updates` (newsletters, bulk, and automated mail), or `spam`, and flagged `important`; spam is excluded unless `category=spam` or `include_spam=true`.
curl https://sendhq.cc/api/v1/emails \
-X GET \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"data": [],
"count": 0
}/emails/:id获取邮件及其附件
获取邮件及其附件
curl https://sendhq.cc/api/v1/emails/id_value \
-X GET \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"id": "em_…",
"direction": "out",
"status": "sent",
"attachments": []
}/emails/:id更新已读、归档、垃圾邮件、分类或重要性状态
设置 `read`、`archived`、`category`(`primary`、`updates` 或 `spam`,仅限收到的邮件)和 `important`。更改 `category` 或 `important` 会让 SendHQ 学习该发件人的情况:被举报为垃圾邮件后,该发件人今后的邮件都会进入垃圾邮件;标记为“Not spam”会让其邮件跳过自动垃圾邮件检查;重要性标记也会沿用到该发件人。传入 `learn: false` 则只更改这一封邮件。
curl https://sendhq.cc/api/v1/emails/id_value \
-X PATCH \
-H "Authorization: Bearer $SENDHQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{"category":"spam"}'{
"id": "em_…",
"readAt": "2026-08-23T12:00:00.000Z",
"archivedAt": null,
"category": "spam",
"important": false,
"classification": "you moved it here"
}/emails/:id删除已保留的邮件
删除已保留的邮件
curl https://sendhq.cc/api/v1/emails/id_value \
-X DELETE \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"ok": true
}/emails/:id/events列出某封邮件的投递事件
列出某封邮件的投递事件
curl https://sendhq.cc/api/v1/emails/id_value/events \
-X GET \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"data": [],
"count": 0
}/threads/:id按时间顺序获取一个会话
按时间顺序获取一个会话
curl https://sendhq.cc/api/v1/threads/id_value \
-X GET \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"id": "em_…",
"data": [],
"count": 0
}/emails/:id/deliveryDelivery timeline for one email, with bounce and complaint reasons
Delivery timeline for one email, with bounce and complaint reasons
curl https://sendhq.cc/api/v1/emails/id_value/delivery \
-X GET \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"emailId": "em_123",
"status": "bounced",
"timeline": [],
"count": 0,
"limit": 50,
"offset": 0
}/threads/:id/deliveryPer-thread delivery counts and per-message failure reasons
Per-thread delivery counts and per-message failure reasons
curl https://sendhq.cc/api/v1/threads/id_value/delivery \
-X GET \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"threadId": "thr_123",
"delivered": 0,
"bounced": 0,
"complained": 0,
"failed": 0,
"messages": []
}