API 参考

入站邮件

创建地址并处理收到的会话。

POST/domains/:id/inbound/setup
API 密钥

开通 SES 入站收信

开通 SES 入站收信

请求
curl https://sendhq.cc/api/v1/domains/id_value/inbound/setup \
  -X POST \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 响应
{
  "domain": "inbound.example.com",
  "status": "dns_pending",
  "record": {
    "type": "MX",
    "name": "inbound.example.com",
    "value": "10 inbound-smtp.us-east-1.amazonaws.com"
  }
}
POST/domains/:id/inbound/verify
API 密钥

验证入站 MX 路由

验证入站 MX 路由

请求
curl https://sendhq.cc/api/v1/domains/id_value/inbound/verify \
  -X POST \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 响应
{
  "domain": "inbound.example.com",
  "status": "ready",
  "record": {
    "type": "MX"
  }
}
POST/inboxes
API 密钥

创建入站地址

创建入站地址

请求
curl https://sendhq.cc/api/v1/inboxes \
  -X POST \
  -H "Authorization: Bearer $SENDHQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"domain_id":"dom_…","local_part":"support","name":"Support"}'
201 响应
{
  "id": "inb_…",
  "address": "support@inbound.example.com",
  "status": "active"
}
GET/inboxes
API 密钥

列出入站地址

列出入站地址

查询参数domain_id
请求
curl https://sendhq.cc/api/v1/inboxes \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 响应
{
  "data": [],
  "count": 0
}
GET/inboxes/:id
API 密钥

获取入站地址

获取入站地址

请求
curl https://sendhq.cc/api/v1/inboxes/id_value \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 响应
{
  "id": "inb_…",
  "address": "support@example.com",
  "status": "active"
}
PATCH/inboxes/:id
API 密钥

重命名、启用或停用收件箱

重命名、启用或停用收件箱

请求
curl https://sendhq.cc/api/v1/inboxes/id_value \
  -X PATCH \
  -H "Authorization: Bearer $SENDHQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Customer support","status":"active"}'
200 响应
{
  "id": "inb_…",
  "status": "active"
}
PUT/inboxes/:id/forwarding
API 密钥

将收件箱收到的邮件转发到另一个地址

将 `forward_to` 设置为一个邮件地址,或设为 null 以关闭转发。账户所有者自己的地址会立即生效;其他任何地址都会收到一封确认邮件(从该收件箱的已验证域名发出,按一个收件人计量),在链接被确认之前,转发一直处于待定状态。转发的副本从收件箱地址发出,并将原始发件人设为 Reply-To,遵守抑制列表和套餐限制,且永远不会被再次转发。

请求
curl https://sendhq.cc/api/v1/inboxes/id_value/forwarding \
  -X PUT \
  -H "Authorization: Bearer $SENDHQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"forward_to":"team@example.net"}'
200 响应
{
  "id": "inb_…",
  "address": "support@example.com",
  "forwardTo": "team@example.net",
  "forwardStatus": "pending"
}
DELETE/inboxes/:id
API 密钥

删除收件箱,同时保留邮件

删除收件箱,同时保留邮件

请求
curl https://sendhq.cc/api/v1/inboxes/id_value \
  -X DELETE \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 响应
{
  "ok": true
}