API 参考

域名

开通发信身份,并了解 DNS 验证状态。

POST/domains
API 密钥

添加发信域名

添加发信域名

请求
curl https://sendhq.cc/api/v1/domains \
  -X POST \
  -H "Authorization: Bearer $SENDHQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"example.com"}'
201 响应
{
  "id": "dom_…",
  "name": "example.com",
  "status": "pending",
  "records": []
}
GET/domains
API 密钥

列出域名及缓存的 DNS 状态

列出域名及缓存的 DNS 状态

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

获取域名配置详情

获取域名配置详情

请求
curl https://sendhq.cc/api/v1/domains/id_value \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 响应
{
  "id": "dom_…",
  "name": "example.com",
  "setup_status": "checking",
  "records": [],
  "dns_issues": []
}
POST/domains/:id/verify
API 密钥

刷新 SES 与 DNS 验证状态

刷新 SES 与 DNS 验证状态

请求
curl https://sendhq.cc/api/v1/domains/id_value/verify \
  -X POST \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 响应
{
  "domain": {
    "id": "dom_…",
    "status": "verified"
  },
  "checks": {
    "ses": true
  },
  "status": "verified"
}
DELETE/domains/:id
API 密钥

删除域名

删除域名

请求
curl https://sendhq.cc/api/v1/domains/id_value \
  -X DELETE \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 响应
{
  "ok": true
}
GET/dns/provider
API 密钥

检测权威 DNS 服务商及记录的相对主机名

根据实时的域名服务器检测该域名的权威 DNS 服务商,返回每条必需记录应填写的相对主机名、推荐的 DMARC 记录、入站 MX 状态,以及可用的一键配置方式。

查询参数domain_id
请求
curl https://sendhq.cc/api/v1/dns/provider \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 响应
{
  "detectionStatus": "confirmed",
  "detected": "cloudflare",
  "zone": "example.com",
  "nameservers": [
    "ada.ns.cloudflare.com"
  ],
  "recordHosts": {},
  "inbound": {
    "available": true,
    "domain": null,
    "status": "not_configured",
    "record": null
  },
  "recommendations": [],
  "authentication": {},
  "providers": {
    "domainConnect": {
      "available": false,
      "providerName": null
    }
  }
}
GET/dns/domain-connect/connect
API 密钥

创建用于一键配置 DNS 的 Domain Connect 授权链接

当权威 DNS 服务商支持 SendHQ 的 Domain Connect 模板时,返回一个经过签名的服务商授权 URL。必须由人工打开该 URL,并在 DNS 服务商处批准变更;SendHQ 永远不会获得长期有效的 DNS 凭据。如果服务商不支持该模板,则返回 409。

查询参数domain_idnext
请求
curl https://sendhq.cc/api/v1/dns/domain-connect/connect \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 响应
{
  "url": "https://dns-provider.example/v2/domainTemplates/…",
  "providerName": "Example DNS"
}