Mailzero 文档
Today 背后的 API:连接收件箱,阅读摘要和事实,通过常设委托将您选择的事务类型交给智能体,让它们在授权范围内执行操作,每项操作都有回执。域名、DNS 和平台其他部分的参考文档在下方。
认证
所有经过身份验证的端点都需要在 Authorization 标头中提供 Bearer 令牌。
curl https://domani.run/api/domains/search?q=example.com \ -H "Authorization: Bearer domani_sk_xxx"
通过以下方式获取 API 密钥 创建帐户 或从 设置。某些端点(搜索、TLD、WHOIS)是公开的,但无需授权即可具有较低的速率限制。
令牌范围
令牌可以限制在特定的权限范围内。使用 * 完全访问(默认)。通过创建范围令牌 `POST /api/tokens` 与一个 `scopes` 数组。
| 适用范围 | 授予访问权限 |
|---|---|
| domains:read | GET /api/domains、GET /api/domains/{domain}、GET /api/domains/{domain}/dns、/dnssec、/status、/email/check、/auth-code、/transfer-away、/transfer-status、/analytics |
| domains:write | PUT /api/domains/{domain}/dns、POST/DELETE /api/domains/{domain}/dnssec、POST /connect、POST /verify、PUT /settings、PUT /parking、PUT/DELETE /api/domains/{domain}/for-sale、POST /api/domains/import、POST /import/verify |
| domains:transfer | POST /api/domains/buy、POST /transfer、POST /renew(涉及付款,包括市场购买) |
| tokens:read | GET /api/tokens |
| tokens:write | POST /api/tokens, DELETE /api/tokens/{id} |
| webhooks:read | GET /api/webhooks, GET /api/webhooks/{id}/deliveries |
| webhooks:write | POST /api/webhooks, PATCH /api/webhooks/{id}, DELETE /api/webhooks/{id} |
| email:read | GET /api/emails,/api/emails/{address}, /api/emails/{address}/messages, /api/emails/{address}/aliases, /api/email/changes, /api/domains/{domain}/email/status, /api/domains/{domain}/email/deliverability, /api/suppressions, GET /api/contacts |
| email:write | POST /api/emails,POST /api/emails/{address}/send, POST /api/domains/{domain}/email/setup, aliases + catch-all, POST/DELETE /api/suppressions, POST/DELETE /api/contacts |
| email:delete | 永久删除垃圾箱中已有的邮件。将邮件移至垃圾箱仅需要 email:write。仅将此范围授予允许不可逆转地删除电子邮件内容的智能体 |
| email:manage_mailboxes | 创建邮箱(POST /api/emails),且仅执行此操作。此受限管理范围允许智能体为新项目创建地址(partners@、launch@),但不能读取或发送邮件、管理域名或操作令牌 |
| email:auth_secrets | 阅读分类为身份验证邮件的消息(OTP/验证码、密码重置、魔术链接)。如果没有它,email:read 仍会列出它们,但主题和正文会被隐藏 - 因此被盗的智能体令牌无法获取 2FA 代码。仅授予真正需要完成登录的智能体 |
| account:read | GET /api/me, GET /api/agents/identity |
| account:write | DELETE /api/me, POST /api/billing/setup, POST /api/billing/subscribe, POST /api/billing/cancel, POST /api/me/resend-verification, POST/PATCH/DELETE /api/agents/identity |
| billing:read | GET /api/billing/invoices |
| search | GET /api/domains/search、/suggest、/whois、/dns-check、GET /api/tlds |
| deals:read | GET /api/deals, GET /api/deals/{id} |
| deals:write | POST /api/domains/sell, PATCH /api/deals/{id} |
| notifications:read | GET /api/notifications, GET /api/notifications/count |
| backorders:read | GET /api/backorders, GET /api/backorders/{id} |
| backorders:write | POST /api/backorders, DELETE /api/backorders/{id} |
| assistant:read | Read Mailzero assistant settings,the Today queue, Work items, exact action previews, history-import progress, and content-minimized Activity |
| assistant:write | Change Mailzero assistant settings,record consent and start history imports, record human Decisions on Work items, retry imports, and export or delete derived assistant data. Never sends mail |
范围衰减: 令牌只能创建具有相同或更少范围的子令牌,而不能更多。
缺少范围返回 403 带代码 `INSUFFICIENT_SCOPE` 以及命名所需范围的提示。
智能体快速入门:任务循环
为智能体分配身份和令牌,通过观察级别的常设委托将某类事务交给它,然后让它读取每个事务的信封,请求执行操作并报告。级别和授权会批准、上报给您或拒绝;每项操作都会留下回执;当回执证明其能力时提升级别。
# The owner, once
curl -X POST https://domani.run/api/agents/identity -H "Authorization: Bearer $OWNER_KEY" -H "Content-Type: application/json" -d '{"slug":"finance-helper","name":"Finance helper"}'
curl -X POST https://domani.run/api/tokens -H "Authorization: Bearer $OWNER_KEY" -H "Content-Type: application/json" -d '{"name":"finance helper","scopes":["assistant:read","assistant:write"],"agent_identity_id":"agt_123"}'
curl -X POST https://domani.run/api/assistant/rules -H "Authorization: Bearer $OWNER_KEY" -H "Content-Type: application/json" -d '{"name":"Acme","match":{"senderDomain":"acme.com"},"assignee_type":"agent","assignee_ref":"finance-helper","level":"observe"}'
# The agent, for every matter
curl https://domani.run/api/assistant/today -H "Authorization: Bearer $AGENT_KEY"
curl https://domani.run/api/assistant/tasks/wi_789 -H "Authorization: Bearer $AGENT_KEY"
curl -X POST https://domani.run/api/assistant/tasks/wi_789/effects -H "Authorization: Bearer $AGENT_KEY" -H "Content-Type: application/json" -d '{"effects":[{"kind":"label","mailbox_id":"mbx_123","add":["finance"]}],"idempotency_key":"label-wi_789-1"}'
curl -X POST https://domani.run/api/assistant/tasks/wi_789/report -H "Authorization: Bearer $AGENT_KEY" -H "Content-Type: application/json" -d '{"outcome":"done","summary":"Labelled finance; the invoice matches the order."}'Mailzero 助手
Mailzero 助手端点会把用户自己的邮件转化为有依据的决定:一个带版本的“今天”队列、每个需要判断的会话对应一个工作项,以及仅在用户做出选择后才准备的确切操作计划。/api/assistant 下的任何端点都不会发送、删除或更改邮件;模型输出始终只是提案,由服务器进行校验。
两个范围即可覆盖: assistant:read 用于设置、“今天”、工作项、操作计划、导入进度和活动; assistant:write 用于更改设置、授权与历史导入、人工对工作项做出的决定,以及派生数据的导出或删除。
只有在明确授权之后才会开始处理: POST /api/assistant/preview 会记录授权版本、限定所拥有的邮箱范围,并启动可恢复的后台导入。轮询 GET /api/assistant/backfill 以查看进度。
curl -X POST https://domani.run/api/assistant/work-items/wi_789/interactions -H "Authorization: Bearer domani_sk_xxx" -H "Content-Type: application/json" -d '{"type":"choose","work_item_version":3,"decision_id":"dec_1","decision_version":1,"option_id":"opt_send","idempotency_key":"choose-wi_789-opt_send-1"}'做出选择后会准备一份确切的计划。使用 GET /api/assistant/action-plans/{id}读取它,展示给用户,然后通过常规回复端点 POST /api/emails/{address}/messages/{id}/reply 发送,并附带 assistant_plan_id。服务器会拒绝过期或不匹配的计划,每次发送记录一份回执,并将工作项移至“等待中”或“已处理”。
经过身份验证的邮箱 webhook
在仪表板中,打开域的电子邮件选项卡,选择一个邮箱,然后选择 Authorization 或 X-API-Key。 Domani 对该值进行加密,并通过 Webhook 测试和入站电子邮件传送来发送。实时入库投递具有持久性,最多可重试 3 次; `X-Domani-Delivery-Attempt`.
read -rsp 'Sender credential: ' WEBHOOK_SENDER_AUTH; echo export WEBHOOK_SENDER_AUTH jq -n --arg url 'https://agent.example/webhook' --arg auth "$WEBHOOK_SENDER_AUTH" '{url:$url,headers:'{Authorization:$auth}} | \ curl --fail-with-body -X PUT "https://domani.run/api/emails/agent%40example.com/webhook" \ -H "Authorization: Bearer $DOMANI_API_KEY" \ -H "Content-Type: application/json" --data-binary @- unset WEBHOOK_SENDER_AUTH标头值永远不会返回。回应仅公开 `header_names`。省略 `headers` 要保留存储的值,请发送一个空对象来清除它,然后使用 `POST /api/emails/`'{address}'`/webhook/test` 以验证投递。
从头开始?包括 `webhook_headers` 在 `POST /api/agents/provision` 购买域名、创建其邮箱并在一次幂等调用中附加经过身份验证的事件 Webhook。 Domani 在收取任何费用之前会验证 URL 和标头名称。
错误
所有错误都会返回一致的 JSON 信封。使用 `code` 用于编程处理和 `hint` 进行康复指导。
{
"error": "Missing API key",
"code": "MISSING_API_KEY",
"hint": "Include 'Authorization: Bearer domani_sk_xxx' header",
"documentation_url": "https://domani.run/llms.txt"
}| 代码 | HTTP协议 |
|---|---|
| MISSING_API_KEY | 401 |
| INVALID_API_KEY | 401 |
| EXPIRED_API_KEY | 401 |
| MISSING_PARAMETER | 400 |
| INVALID_DOMAIN | 400 |
| PAYMENT_REQUIRED | 402 |
| DOMAIN_UNAVAILABLE | 409 |
| RATE_LIMIT_EXCEEDED | 429 |
| USER_EXISTS | 409 |
| NOT_FOUND | 404 |
| UNKNOWN_PROVIDER | 400 |
| UNKNOWN_METHOD | 400 |
| TARGET_REQUIRED | 400 |
| INVALID_PARAMETER | 400 |
| CONTACT_REQUIRED | 400 |
| INVALID_CONTACT | 400 |
| INSUFFICIENT_SCOPE | 403 |
| SCOPE_ESCALATION | 400 |
| MAILBOX_CONFINED | 400 |
| DOMAIN_EXISTS | 400 |
| DOMAIN_NOT_ACTIVE | 400 |
| UNSUPPORTED_TLD | 400 |
| TLD_NOT_IN_PUBLIC_DNS | 400 |
| NOT_AVAILABLE | 400 |
| ALREADY_REGISTERED | 400 |
| TRANSFER_NOT_ELIGIBLE | 400 |
| RENEWAL_NOT_ELIGIBLE | 400 |
| ALREADY_LISTED | 400 |
| LISTING_SOLD | 400 |
| SELF_PURCHASE | 400 |
| DESCRIPTION_TOO_LONG | 400 |
| DEAL_NOT_FOUND | 400 |
| INVALID_DEAL_STATE | 400 |
| EPP_ATTEMPTS_EXCEEDED | 400 |
| ACTIVE_DEAL_EXISTS | 400 |
| AGENT_IDENTITY_NOT_FOUND | 400 |
| AGENT_IDENTITY_ESCALATION | 400 |
| AGENT_MAILBOXES_REQUIRED | 400 |
| CREDENTIAL_REVOKE_FAILED | 400 |
| INVALID_IDEMPOTENCY_KEY | 400 |
| IDEMPOTENCY_KEY_MISMATCH | 400 |
| IDEMPOTENCY_KEY_REUSED | 400 |
| OPERATION_IN_PROGRESS | 400 |
| OPERATION_SUPERSEDED | 400 |
| INVALID_OPERATION_RECEIPT | 400 |
| WORKSPACE_ADMIN_REQUIRED | 400 |
| WORKSPACE_OWNER_REQUIRED | 400 |
| PRINCIPAL_NOT_IN_WORKSPACE | 400 |
| MAILBOX_NOT_IN_WORKSPACE | 400 |
| GROUP_NOT_IN_WORKSPACE | 400 |
| COLLECTION_NOT_IN_WORKSPACE | 400 |
| ACCESS_VERSION_CONFLICT | 400 |
| ACCESS_OFFER_INVALID | 400 |
| ACCESS_OFFER_EMAIL_MISMATCH | 400 |
| MAIL_DOMAIN_CAPACITY_EXHAUSTED | 400 |
| MAIL_PROVIDER_ERROR | 400 |
| INVALID_HTTP_ROUTE_HOSTNAME | 400 |
| INVALID_HTTP_ROUTE_UPSTREAM | 400 |
| INVALID_HTTP_ROUTE_UPSTREAM_HEADERS | 400 |
| INVALID_HTTP_ROUTE_LEASE | 400 |
| INVALID_HTTP_ROUTE_POLICY | 400 |
| INVALID_HOSTNAME_BINDING | 400 |
| HTTP_ROUTE_HOSTNAME_NOT_ALLOWED | 400 |
| HTTP_ROUTE_HOSTNAME_REQUIRED | 400 |
| HTTP_ROUTE_HOSTNAME_RESERVED | 400 |
| HTTP_ROUTE_HOSTNAME_UNAVAILABLE | 400 |
| HTTP_ROUTE_CONCURRENCY_LIMIT | 400 |
| HTTP_ROUTE_WORKSPACE_LIMIT | 400 |
| HTTP_ROUTE_DOMAIN_NOT_OWNED | 400 |
| HTTP_ROUTE_TERMINAL | 400 |
| HTTP_ROUTE_VERIFICATION_NOT_ENABLED | 400 |
| HTTP_ROUTE_VERIFICATION_REQUIRES_HTTPS | 400 |
| HTTP_ROUTE_POLICY_WITHOUT_SCOPE | 400 |
| HTTP_ROUTE_POLICY_REQUIRED | 400 |
| HTTP_ROUTE_AGENT_IDENTITY_REQUIRED | 400 |
| HTTP_ROUTE_POLICY_ESCALATION | 400 |
| HOSTNAME_BINDING_NOT_ACTIVE | 400 |
| HOSTNAME_BINDING_DNS_CONFLICT | 400 |
| HOSTNAME_BINDING_ACK_REQUIRED | 400 |
| HOSTNAME_BINDING_BROWSER_MODE_MISMATCH | 400 |
| HOSTNAME_DNS_CONFLICT | 400 |
| ZONE_READ_FAILED | 400 |
| DNS_VERSION_CONFLICT | 400 |
| UNAUTHORIZED | 400 |
| APEX_WEB_MODE_CONFLICT | 400 |
| APEX_DELEGATION_ACK_REQUIRED | 400 |
| VERIFICATION_COOLDOWN | 400 |
| VERIFICATION_SEND_FAILED | 400 |
| UPGRADE_REQUIRED | 400 |
| FREE_LIMIT_EXCEEDED | 400 |
速率限制
每个响应都包含速率限制标头:
`X-RateLimit-Limit`- 每个窗口的最大请求数`X-RateLimit-Remaining`- 剩余请求`X-RateLimit-Reset`- 窗口重置时的 unix 时间戳
当速率受限(HTTP 429)时,检查 `Retry-After` 标题等待几秒钟。
Mailzero 助手
/api/assistant/rules列出常设委托
所有者的常设委托规则,按顺序:名称、匹配谓词、受托人(智能体身份或工作空间成员)、自主权级别、每个匹配的次数。需要 assistant:read;智能体令牌被拒绝。
回应 200
| rules | AssistantRule[] |
/api/assistant/rules创建常设委托
将某类事项一次性移交给智能体或人员。match 是显式谓词,绝不是模型调用:senderAddress、senderDomain、organisation、workKeyPrefix、senderKind、mailboxIds、labels、subjectPattern(锚定、不区分大小写)、minOccurrences、minConfidence(校准分类器对 category: 标签给出的概率,0.5 到 1) 中的任意一个;每个声明的条件都必须满足。规则是有序的,第一个匹配的规则获胜;除非另有说明,级别为 observe。匹配的规则将下一个匹配的事项移交给受托人,通过委托通知告知,Today 显示原因。需要 assistant:write;智能体令牌被拒绝。
回应 201
| id | string | |
| name | string | |
| enabled | boolean | |
| position | integer | |
| match | AssistantRuleMatch | |
| assignee | object | |
| level | string | |
| grants | AssistantGrants | |
| match_count | integer | |
| last_matched_at | string (date-time) | null | |
| created_at | string (date-time) | |
| updated_at | string (date-time) |
/api/assistant/rules/{id}更改常设委托
重命名、启用或禁用、重新排序、更改匹配条件、受托人、级别或授权。将级别降低到 observe 是规则的一键终止开关。需要 assistant:write;智能体令牌被拒绝。
参数
| id* | string |
回应 200
| id | string | |
| name | string | |
| enabled | boolean | |
| position | integer | |
| match | AssistantRuleMatch | |
| assignee | object | |
| level | string | |
| grants | AssistantGrants | |
| match_count | integer | |
| last_matched_at | string (date-time) | null | |
| created_at | string (date-time) | |
| updated_at | string (date-time) |
/api/assistant/rules/{id}删除常设委托
移除规则;它移交的事项返回给所有者,受托人所做操作的记录保留。需要 assistant:write;智能体令牌被拒绝。
参数
| id* | string |
回应 200
| deleted | boolean | |
| released_items | integer |
/api/assistant/rules/test在样本事实上尝试常设委托
模拟运行:哪条规则会处理具有这些事实(邮箱、键、发件人、主题、标签、出现次数)的事项,以及原因。不会更改任何内容。需要 assistant:write;智能体令牌会被拒绝。
请求正文
| mailbox_id* | string | |
| key* | string | 工作事项键,例如 org:tucows:invoice |
| sender_address | string | null | |
| sender_kind | string(human | automated) | |
| subject | string | null | |
| labels | string[] | |
| occurrences | integer | |
| confidence | object | 分类器对每个标签的概率,用于带 minConfidence 的规则 |
回应 200
| matched | boolean | |
| rule | AssistantRule | |
| why | string[] | |
| considered | integer |
/api/assistant/rules/{id}/check针对常设委托的级别和授权尝试一个效果
今天在规则下请求的效果的验证顺序的模拟运行:级别允许该类型;授权允许收件人、数量(今天已执行的效果计数)、时间表、从事项读取的支出、风险类别;必需的审批人已批准。回答计划将采取的状态(proposed、approved、escalated 或 rejected)以及每项检查和原因。不会更改任何内容。需要 assistant:write;智能体令牌被拒绝。
参数
| id* | string |
请求正文
| effect* | object | |
| matter | object | |
| at | string (date-time) | 检查时间表的时刻;默认为现在 |
| approved_by | string[] | 已批准的成员 ID |
回应 200
| rule | object | |
| allowed_kinds | string[] | |
| effective_grants | AssistantGrants | |
| outcome | string | |
| check | AssistantGrantCheck | |
| hint | string |
/api/assistant/metrics读取任务指标
滚动窗口期内(默认三十天,window_days 从 1 到 90)任务层的七个数字,针对账户和每个常设委托:未经所有者关闭的事项、从到达到完成的时间、按提议执行的计划、已编辑和已拒绝的计划、每个事项的升级次数、执行后的更正次数、冲突次数、每个事项的模型成本。从收据、计划、升级和账本中读取;没有估算值。需要 assistant:read。
参数
| window_days | integer |
回应 200
| type | string | |
| as_of | string (date-time) | |
| window_days | integer | |
| account | AssistantTaskNumbers | |
| rules | object[] |
/api/assistant/approvals获取审批队列
等待所有者处理的计划(在草稿阶段提出的,或被授权持有的)以及受托人提出的问题,涵盖读者可以看到的事项。通过工作项的交互来回应:批准或拒绝计划,选择选项或对问题给出指示。需要 assistant:read。在身份验证邮件被排除在助手之外之前由此类邮件生成的事项,对于没有 email:auth_secrets 的读者,会隐藏其标题、摘要、请求和计划效果后再显示。
回应 200
| type | string | |
| as_of | string (date-time) | |
| plans | object[] | |
| escalations | object[] |
/api/assistant/suggestions获取委派建议
助手提议的常设委派:某事项在九十天内至少重复出现三次(相同组织或发件人)且每次处理方式相同(ignored、answered、closed、handed to one agent),并预填充规则。默认显示未处理的建议。在所有者接受之前不会创建任何内容。需要 assistant:read;智能体令牌会被拒绝。
参数
| status | string(open | accepted | dismissed) |
回应 200
| suggestions | AssistantSuggestion[] |
/api/assistant/suggestions/{id}接受或拒绝委派建议
接受:建议关闭,预填充的规则返回供客户端创建(POST /api/assistant/rules)。拒绝:建议关闭且相同事项和处理方式不会再次出现。需要 assistant:write;智能体令牌会被拒绝。
参数
| id* | string |
请求正文
| action* | string(accept | dismiss) |
回应 200
| suggestion | AssistantSuggestion | |
| rule | AssistantRuleInput |
/api/assistant/grants列出附加到受让人的授权
附加到所有者的智能体和成员的授权,在每个将事项交给他们的规则之上;规则和受让人中更严格的适用。需要 assistant:read;智能体令牌被拒绝。
回应 200
| grants | AssistantAssigneeGrants[] |
/api/assistant/grants设置受让人的授权
将授权附加到智能体身份或工作区成员;它们替换受让人之前的授权并限制每个将事项交给他们的规则。需要 assistant:write;智能体令牌被拒绝。
请求正文
| assignee_type* | string(agent | member) | |
| assignee_ref* | string | 智能体身份 slug,或成员的用户 ID |
| grants* | AssistantGrants |
回应 200
| assignee | object | |
| grants | AssistantGrants | |
| created_at | string (date-time) | |
| updated_at | string (date-time) |
/api/assistant/grants/{type}/{ref}移除受让人的授权
受让人仅保留每个规则授予的内容。需要 assistant:write;智能体令牌被拒绝。
参数
| type* | string(agent | member) | |
| ref* | string |
回应 200
| deleted | boolean |
/api/assistant/tasks/{id}读取任务信封
移交的事项,按受托人所需:带证据的摘要、事实、委托(受托人、规则、级别、允许的效果类型、有效授权)、开放和最近的计划、租约。智能体令牌读取移交给它的事项以及它操作的邮箱的事项;所有者读取自己的事项。需要 assistant:read。在身份验证邮件被排除在助手之外之前由此类邮件生成的事项,对于没有 email:auth_secrets 的读者,会隐藏其标题、摘要、请求和计划效果后再显示。
参数
| id* | string | 工作项 ID |
回应 200
| id | string | 工作项 ID |
| version | integer | |
| status | string | |
| deadline | string (date-time) | null | |
| you | object | |
| delegation | object | |
| lease | AssistantTaskLease | |
| brief | object | null | 事项的摘要,如 GET /api/assistant/work-items/{id}/brief 返回的内容 |
| facts | object | null | 事项的事实,如 GET /api/assistant/work-items/{id}/facts 返回的内容 |
| plans | object | |
| escalations | object[] | 任务上提出的问题,最新的在前,包含其答案 |
/api/assistant/tasks/{id}/lease获取或续订任务租约
两个受托人永远不会处理同一事项:租约指定谁处理它直到何时(默认十五分钟,最多一小时)。再次获取会续订租约;在到期前,另一个持有者会被拒绝并返回 TASK_LEASED。效果请求会自动获取租约。需要 assistant:write。
参数
| id* | string |
请求正文
| ttl_seconds | integer |
回应 200
| task_id | string | |
| lease | AssistantTaskLease |
/api/assistant/tasks/{id}/lease归还租约
释放调用者持有的租约;另一个受托人持有的租约不受影响。需要 assistant:write。
参数
| id* | string |
回应 200
| task_id | string | |
| released | boolean | |
| lease | AssistantTaskLease |
/api/assistant/tasks/{id}/effects请求对任务执行效果
受托人请求一个或多个效果(回复、转发、标签、延后、解决、备注、请求)。委托的级别决定允许的类型,授权限制它们:在 guarded_send 或 operate 的授权范围内(以及 triage 的入站类型),效果立即执行并返回回执;在 draft 级别,它们等待所有者批准;授权失败会升级到所有者;级别不允许的类型会被拒绝。所有者自己的请求立即执行。相同的幂等键会再次返回第一个计划。需要 assistant:write。
参数
| id* | string |
请求正文
| effects* | AssistantEffect[] | |
| idempotency_key* | string | |
| note | string | 受托人希望所有者了解的关于此请求的信息 |
回应 200
| task_id | string | |
| replayed | boolean | |
| plan | AssistantPlan | |
| execution | object | null | |
| lease | AssistantTaskLease | |
| hint | string |
/api/assistant/tasks/{id}/escalate停下来并询问所有者
受理人提出问题并附上证据,必要时还包括其看到的选项。所有者通过对此创建的决策进行普通的选择或指示交互来回答;事项在 Today 中显示为需要所有者,租约被释放,任务等待。需要 assistant:write。
参数
| id* | string |
请求正文
| question* | string | |
| options | object[] | |
| evidence_refs | string[] |
回应 200
| task_id | string | |
| escalation_id | string | |
| decision_id | string | |
| status | string | |
| version | integer | |
| hint | string |
/api/assistant/tasks/{id}/report报告任务
受理人做了什么以及如何结束:完成(事项解决,或在仍期待答案时等待)、受阻(询问所有者)或交还(所有者接管且规则在此事项上保持关闭)。声明与平台写入的收据进行核对:没有收据的声明记录为声明,绝不记录为事实。租约被释放。需要 assistant:write。
参数
| id* | string |
请求正文
| outcome* | string(done | blocked | handed_back) | |
| summary* | string | |
| evidence_refs | string[] | |
| claims | object[] |
回应 200
| task_id | string | |
| outcome | string | |
| status | string | |
| reconciliation | object | |
| receipt_id | string | |
| hint | string |
/api/emails/{address}/messages/{id}/facts读取智能体对一条消息确立的内容
对此消息的分析产生的知识:声明(主体、谓词、带类型和货币的值、依据、置信度、有效性、证据)、实体、承诺和期望。过程中不进行任何计算:管道从未分析过的消息会返回 analysed: false 并附带 reason(当邮箱不在智能体中时为 not_enabled,当分析尚未发生时为 not_analysed)。需要 assistant:read。
参数
| address* | string | |
| id* | string | 消息ID |
回应 200
| message_id | string | |
| thread_id | string | |
| analysed | boolean | |
| reason | string | 仅当 analysed 为 false 时 |
| analysis | object | |
| facts | Fact[] | |
| entities | object[] | |
| commitments | object[] | |
| expectations | object[] |
/api/emails/{address}/messages/{id}/extract使用您自己的模式从消息中提取所需字段
对消息文本(主题、发件人、正文)进行一次模型调用,使用调用方的 JSON 模式(对象和基本类型,最多 8 KB,无引用):返回该形状的 data、confidence(0 到 1)和 evidence_quotes(逐字摘录)。按(消息、模式、指令)缓存,因此相同问题只需一次调用(之后 cached: true)。受账户的模型预算限制(用尽时返回 429,模型路由关闭时返回 503)。登录验证码邮件返回 403 AUTH_MESSAGE。正文超过 60,000 字符返回 413。
参数
| address* | string | |
| id* | string | 消息ID |
请求正文
| schema* | object | 要提取的字段的 JSON 模式:基本类型、数组和嵌套对象的对象,小于 8 KB,无 $ref |
| instructions | string | 可选指导,例如金额单位为 EUR |
回应 200
| message_id | string | |
| data | object | |
| confidence | number | |
| evidence_quotes | string[] | |
| model | string | |
| cached | boolean | |
| generated_at | string (date-time) | |
| usage | object |
/api/assistant/settings获取 Mailzero 助手设置
返回助手的启用状态、shadow/pause 标志、同意版本、隐私路由、邮箱范围以及您拥有的所有邮箱。需要 assistant:read 授权。
回应 200
| enabled | boolean | |
| shadow_enabled | boolean | |
| paused | boolean | |
| mailbox_ids | string[] | |
| agent_mailbox_ids | string[] | 由你的 AI 智能体运营的邮箱。它们的事项显示在 Today 的智能体分区,而不是 Needs you。 |
| agents | object[] | 你的智能体身份,用于委派。 |
| search_opt_out_mailbox_ids | string[] | 仅通过关键词搜索邮件的邮箱:它们的邮件永远不会发送到嵌入模型。 |
| brief_opt_out_mailbox_ids | string[] | 摘要保持确定性的邮箱:不会将证据摘录发送给模型用于生成摘要和下一步操作(对到达邮件的分析保持不变) |
| history_window_days | integer | |
| privacy_route | string | |
| attachment_vision | boolean | |
| community_signals | boolean | 您的钓鱼举报会计入社区指纹(域名、主题的形式,绝不包括文本或地址),社区的计数会反映到您的信任信号中。默认开启;关闭后两者都保持本地。 |
| pipeline_version | string | |
| consent | object | |
| mailboxes | object[] |
响应示例
{
"enabled": false,
"shadow_enabled": true,
"paused": false,
"mailbox_ids": [
"mbx_123"
],
"history_window_days": 30,
"privacy_route": "private_cloud",
"attachment_vision": false,
"pipeline_version": "communication-analysis.v1",
"consent": {
"required_version": "mailzero-personal-ai.v1",
"accepted_version": "mailzero-personal-ai.v1",
"accepted_at": "2026-09-02T09:12:00.000Z"
},
"mailboxes": [
{
"id": "mbx_123",
"slug": "hello",
"domain": "example.com",
"name": "Hello",
"kind": "api",
"address": "hello@example.com"
}
]
}/api/assistant/settings更新 Mailzero 助手设置
显式启用、暂停、恢复或限定助手处理范围。发送 mailbox_ids: [] 会禁用所有邮箱并取消正在运行的历史记录导入。恢复需要当前的同意版本。邮件接收保持独立。需要 assistant:write 授权。
请求正文
| enabled | boolean | 显示 Today 决策并按需生成草稿 |
| shadow_enabled | boolean | 分析邮件但不显示决策 |
| paused | boolean | |
| mailbox_ids | string[] | 要处理的已拥有邮箱 ID;空数组会禁用所有功能 |
| agent_mailbox_ids | string[] | 由你的 AI 智能体运营的邮箱。它们的事项显示在 Today 的智能体分区,而不是 Needs you。 |
| history_window_days | integer | |
| attachment_vision | boolean |
回应 200
| ok | boolean | |
| enabled | boolean | |
| shadow_enabled | boolean | |
| paused | boolean | |
| mailbox_ids | string[] |
响应示例
{
"ok": true,
"enabled": true,
"shadow_enabled": true,
"paused": false,
"mailbox_ids": [
"mbx_123"
]
}/api/assistant/preview同意并启动后台历史记录导入
记录当前明确的AI同意,在选定的用户拥有的邮箱上启用影子处理,并创建可恢复的近期历史记录后台导入。客户端可以立即关闭并轮询GET /api/assistant/backfill。需要assistant:write授权。
请求正文
| mailbox_ids* | string[] | |
| history_window_days | integer | |
| consent* | boolean(true) | |
| consent_version* | string(mailzero-personal-ai.v1) |
回应 200
| ok | boolean | |
| preview | object |
响应示例
{
"ok": true,
"preview": {
"mailbox_ids": [
"mbx_123"
],
"history_window_days": 30,
"scanned": 0,
"enqueued": 0,
"capped": false,
"background": true,
"backfill_id": "bf_456"
}
}/api/assistant/backfill获取后台历史记录导入进度
返回扫描/分析阶段、已处理和总消息数、百分比、自适应预计完成时间、暂停状态以及应用是否可以关闭。需要assistant:read授权。
回应 200
| backfill | object | null |
响应示例
{
"backfill": {
"id": "bf_456",
"status": "processing",
"phase": "analysis",
"paused": false,
"processed": 12,
"total": 40,
"failed": 0,
"percent": 30,
"estimated_seconds_remaining": 240,
"estimated_completion_at": "2026-09-02T09:20:00.000Z",
"can_close_app": true,
"started_at": "2026-09-02T09:12:00.000Z",
"completed_at": null
}
}/api/assistant/backfill重试失败的历史记录导入消息
为仍启用AI的邮箱重新排队最新导入中的终端失败。消息出现在此之前,自动重试已经用尽。需要assistant:write授权。
回应 200
| ok | boolean | |
| retried | integer |
响应示例
{
"ok": true,
"retried": 2
}/api/assistant/today获取基于事实的Today决策队列
返回带有 as_of、lag、coverage 和 warnings 的版本化 Now、Needs you、Waiting、Upcoming 和最近 Handled 投影。每个项目链接到其源消息;此处不会发送邮件。需要 assistant:read 授权。身份验证邮件(登录验证码、密码重置、魔术链接)永远不会成为事项,也永远不会到达模型。在身份验证邮件被排除在助手之外之前由此类邮件生成的事项,对于没有 email:auth_secrets 的读者,会隐藏其标题、摘要、请求和计划效果后再显示。
参数
| agent | string | 仅限单个智能体的视图:它操作的邮箱项目以及交给它的项目。绑定到智能体身份的令牌始终获得该智能体的视图;指定另一个智能体会返回 403 AGENT_SCOPE。 |
| category | string | 只保留一种事项类型(invoice、meeting_request、newsletter 等);响应中的 categories 字段列出视图中的每种类型及其数量。未知类型返回 400 INVALID_CATEGORY。 |
| tag | string | 仅带有此标签(用户的标签之一)的事项;响应的 tags 字段列出视图中的每个标签及其数量。 |
回应 200
| type | string | |
| as_of | string | |
| projection_lag_ms | integer | |
| category | string | null | 视图所限定的事项类型(category 查询参数);未限定时为 null,表示所有类型。 |
| categories | object | 过滤前视图中的每一种事项类型,以及各自包含的项目数。 |
| tag | string | null | 视图所限定的标签(tag 查询参数),全部事项时为 null。 |
| tags | object | 过滤前视图中该用户的每个标签,以及带有它的事项数量。 |
| sections | object |
响应示例
{
"type": "today",
"as_of": "2026-09-02T09:15:00.000Z",
"projection_lag_ms": 4200,
"category": null,
"categories": {
"partner_inquiry": 1
},
"tag": null,
"tags": {
"lumenworks": 1
},
"sections": {
"now": [
{
"id": "wi_789",
"version": 3,
"status": "needs_judgment",
"title": "Investor update",
"summary": "Paul needs the August metrics before his 16:00 partner call.",
"category": "partner_inquiry",
"tags": [
"lumenworks"
],
"proposed_tags": [],
"mailbox": {
"id": "mbx_123",
"address": "hello@example.com",
"name": "Hello"
},
"source": {
"type": "domani-postgres",
"conversation_id": "conv_1",
"event_id": "msg_1",
"revision": 1
},
"attention": {
"level": "now",
"reason": "Deadline today from a known investor",
"confidence": "high",
"deadline": "2026-09-02T16:00:00.000Z"
},
"decision": {
"id": "dec_1",
"version": 1,
"status": "open",
"question": "How do you want to answer Paul?",
"options": [
{
"id": "opt_send",
"label": "Send current metrics",
"recommended": true
},
{
"id": "opt_tomorrow",
"label": "Ask for tomorrow"
}
]
}
}
],
"needs_you": [],
"waiting": [],
"upcoming": [],
"handled": []
}
}/api/assistant/work-items/{id}获取一个助手 Work 项目和确切的当前计划
返回已落实的 Work 项目、其未决 Decision 和选项、确切的当前 Action 计划、未完成的承诺和期望、交互和回执。需要 assistant:read 授权。在身份验证邮件被排除在助手之外之前由此类邮件生成的事项,对于没有 email:auth_secrets 的读者,会隐藏其标题、摘要、请求和计划效果后再显示。
参数
| id* | string | 来自 Today 队列的 Work 项目 ID |
回应 200
| id | string | |
| version | integer | |
| status | string | |
| title | string | |
| summary | string | |
| ask | string | null | 所有者必须做或决定的唯一一件事,否则为 null。 |
| category | string | null | 分析找到的事项类型(发票、会议请求、简报等);没有任何分析给出时为 null。规则以标签 category:<kind> 匹配它。 |
| tags | string[] | 此事项上的个人标签(CT-01b):确认过一次或手动设置,每个标签都是提供商端会话上的一个标签。规则以标签 tag:<name> 进行匹配。 |
| proposed_tags | string[] | 引擎为此事项建议的标签(每个提到的项目一个),尚未确认。通过 tag 交互确认一个后,它将自动应用于同一项目的下一个事项。 |
| suspect | boolean | 信任信号发现发件人可疑:该事项位于 Suspect 部分,永远不会是 Now,不携带决策,并且在用户报告其合法之前不会对其运行任何效果。 |
| suspect_reasons | string[] | 为什么看起来可疑,每个信号一句话(身份验证失败、Reply-To 不一致、相似域名、冒用名称、首次联系涉及金钱、对助手的指令、要求回复邮件中的秘密)。 |
| sender | object | null | |
| recurrence | object | 同一情况重复出现的次数:一个条目,N 条消息。 |
| mailbox | object | |
| opened_at | string | null | |
| delegated_to | string | null | 所有者将此事项交给的智能体 slug,或为 null。 |
| delegation_rule | object | null | 将此事项移交的常设委托规则,以及匹配原因;一旦所有者收回事项,该规则即暂停。 |
| unread | boolean | 在所有者于最近一次变更后打开该事项之前为 true。 |
| messages | object[] | 此事项背后的来源消息,按最新在前排序。 |
| history | object[] | 此事项迄今为止的经过,按最早在前排序:每条先前消息一行。 |
| source | object | |
| attention | object | |
| analysis | object | |
| evidence_refs | string[] | |
| entity_refs | string[] | |
| snoozed_until | string | null | |
| decision | object | null | |
| plan | object | null |
/api/assistant/work-items/{id}/brief读取一个工作项的情况简报
智能体在行动前阅读的一份文档:情况(状态、注意事项、重复性、发件人)、迄今为止的故事(其中的每封邮件,无论是否已分析)、分析确立的事实(包含价值、依据和有效性的声明,以及实体)、未完成的承诺和期望(等待谁处理以及自何时起)、已解决的事项(已关闭的循环和回执)、当前的决策及其选项、建议的下一步(当存在决策的推荐选项时采用该选项,否则采用规则:逾期的承诺、需要追踪的逾期期望、需要回答的发件人请求)以及证据消息。确定性且成本低:无需模型调用。智能体令牌读取其操作的邮箱项目以及交给它们的项目。
参数
| id* | string | Work 项目 ID |
| synthesis | boolean | 设置为false以跳过模型的解读(摘要、具体下一步操作、开放问题)并仅读取确定性简报;该解读按证据状态缓存 |
回应 200
| id | string | |
| version | integer | |
| generated_at | string (date-time) | |
| title | string | |
| summary | string | |
| ask | string | null | |
| mailbox | object | |
| delegated_to | string | null | |
| situation | object | |
| story | object[] | 该情况的每封邮件,从最早到最新,附带分析给出的单行标题 |
| facts | object[] | |
| entities | object[] | |
| commitments | object[] | 所有者方做出的未完成承诺 |
| expectations | object[] | 等待他人处理的未完成事项 |
| settled | object[] | 已关闭的循环和回执,从最新到最早 |
| awaiting | object[] | |
| decision | object | null | 当前准备好的决策及其选项 |
| summary_source | string | 摘要是模型对证据的解读还是流程自身的句子 |
| suggested_next | object | null | |
| open_questions | string[] | 只有所有者可以在下一步操作之前决定的内容,最多三个问题 |
| synthesis | object | null | 写入摘要和下一步操作的模型调用,当简报仅为确定性时为null |
| evidence | object[] | |
| owner_replies | object[] | |
| evidence_refs | string[] |
/api/assistant/brief读取某个通信者的情况简报
在回复某人之前需要了解的内容:他们在你可以读取的邮箱(或一个邮箱)中最近活跃的工作项的简报、他们落后的其他项目,以及他们最近的十封邮件。当尚未分析到来自他们的任何内容时,brief 为 null。
参数
| correspondent* | string | 该人的电子邮件地址 |
| mailbox | string | 限制为一个邮箱地址(slug@domain) |
回应 200
| correspondent | string | |
| mailboxes | string[] | |
| brief | any | |
| related | object[] | |
| recent_mail | object[] | |
| generated_at | string (date-time) |
/api/assistant/work-items/{id}/facts读取 Work 项目背后的事实
从该项目的每次分析中合并的声明和实体(最新的优先),加上其存储的承诺和期望及其状态。智能体令牌可读取其操作的邮箱的项目以及交给它们的项目。
参数
| id* | string | Work 项目 ID |
回应 200
| work_item_id | string | |
| version | integer | |
| analysed | boolean | |
| analyses | object[] | |
| facts | Fact[] | |
| entities | object[] | |
| commitments | object[] | |
| expectations | object[] | |
| evidence_refs | string[] |
/api/assistant/work-items/{id}/open将 Work 事项标记为已打开
记录所有者已在当前版本打开此 Work 事项,并清除其未读标记,直到该事项再次变更。需要 assistant:write 范围。
参数
| id* | string |
回应 200
| ok | boolean | |
| opened_at | string | |
| unread | boolean |
/api/assistant/learned助手了解到的关于您的信息
同一发件人或组织每次回来都被忽略后助手建议的静音规则、生效中的静音(助手排除在“今天”之外的发件人、域名或情形)及各自的原因,以及确认过一次的标签(每个都会自动应用于同一项目的下一个事项)。通过 suggestions 端点接受静音规则;用 mutes 端点遗忘静音,用 tags 端点遗忘标签。
回应 200
| mutes | object[] | 生效的静音规则,最新的在前。 |
| suggestions | AssistantSuggestion[] | 待处理的静音规则:通过建议端点接受其中一条以设置其携带的静音。 |
| tags | object[] | 确认过一次的标签(CT-01b),最新在前:每个标签会自动应用于同一项目的下一个事项,直到被遗忘。 |
/api/assistant/learned/mutes删除静音
该发件人、域名或情况的下一封邮件将再次成为事项。
请求正文
| kind* | string(sender | sender_domain | situation) | |
| value* | string | 地址、域名或情况键,如已学习视图中列出的。 |
回应 200
| ok | boolean | |
| kind | string | |
| value | string |
/api/assistant/learned/tags遗忘一个标签
不再自动应用任何内容:该项目的下一个事项会再次建议该标签。带有它的事项保留它。
请求正文
| name* | string | 标签,与 learned 视图列出的一致。 |
回应 200
| ok | boolean | |
| name | string |
/api/assistant/work-items/{id}/investigate调查事项:注册局和链接的信息
在那一刻读取公共基础设施关于发件人域名的事实(其注册日期和注册商、其SPF和DMARC态势、是否接收邮件)、源消息中每个链接的真实去向(逐跳跟踪的重定向、最终主机及其域名的事实),以及每个附件的真实内容(其前几个字节与名称和声明的类型进行对比)。用这些事实添加的信号回答档案(几天前注册的域名、落地到其他地方的链接、不保护任何内容的发件人域名、被命名为文档的程序)。无供应商、无账户、不存储任何内容;查找失败本身就是一个事实。
参数
| id* | string |
回应 200
| work_item_id | string | |
| source | string | 源邮件是否已读,或仅读取发件人地址。 |
| checked_at | string | |
| sender | object | |
| links | object[] | |
| attachments | object[] | 每个附件的真实内容,从其前几个字节读取,与其名称和声明的类型所承诺的内容进行对比。 |
| signals | object[] | 事实对评估的补充,每项一句话。 |
/api/assistant/work-items/{id}/sender事项背后是谁:组织、相关人员、历史
返回事项的发件人卡片:已存储域名档案所知的发件人组织(名称、法定名称、类别、网站、注册日期、邮件态势;共享邮件域名如 gmail.com 或从未分析过的域名为 null,且从不进行实时分析)、故事消息在 from、to 和 cc 中携带的人员及其角色和是否属于同一组织(读者自己的邮箱除外),以及关系:读者所有邮箱中从该地址收到了多少邮件(最多计数到 50)、首次和最近的时间、发件人的其他事项以及同一域名同事提出的事项。需要 assistant:read scope。
参数
| id* | string |
回应 200
| work_item_id | string | |
| sender | object | null | |
| organisation | object | null | 共享邮件域名或从未分析过的域名为 null。 |
| participants | object[] | |
| relationship | object | |
| generated_at | string (date-time) |
/api/assistant/work-items/{id}/interactions记录一个受限的人工 Decision
选择一个选项、给出指令、接管、暂停、忽略、更正、报告信任判定(钓鱼或合法),或批准或拒绝等待中的计划(已批准的计划立即执行,其收据在响应中)。调用由 work_item_version 限定并通过 idempotency_key 幂等重放。选择或指令会准备一个精确的草稿,仍然通过正常的回复流程;此端点永远不会发送邮件。需要 assistant:write 范围。
参数
| id* | string |
请求正文
| scope | string(item | sender | sender_domain | situation) | 使用类型 ignore 时:同时屏蔽发件人、其域名或此重复情况,使其永不再出现。 |
| verdict | string(phishing | legitimate) | 使用 type report:用户对信任信号的判定。Phishing 关闭该事项,将发件人静音并关闭其其他活跃事项;legitimate 清除可疑判定及其原因。 |
| plan_id | string | 当 type 为 approve 或 reject 时:等待中的行动计划(提议的或上报的)。 |
| reason | string | 当 type 为 reject 时:原因,保留在计划中。 |
| type* | string(choose | instruct | take_over | snooze | ignore | correct | delegate | approve | reject | report | tag) | |
| add | string[] | 当 type 为 tag:要放到事项上的标签(确认一个建议的标签,或手动添加;小写,字母、数字和连字符)。添加过一次的标签会被学习:同一项目的下一个事项将自动获得它。 |
| remove | string[] | 当 type 为 tag:要从事项上移除的标签(此处指定的建议会被拒绝)。learned 页面会永久遗忘一个标签。 |
| agent_slug | string | null | 当类型为 delegate 时:要将该事项交给的智能体 slug,或传 null 以收回。 |
| member_id | string | null | 使用 type delegate:您工作区成员的用户 ID,用于将项目移交给他们而不是智能体;他们在 Today 的 handed_to_you 下找到该项目,并在自己的访问权限下通过 tasks 端点处理它 |
| work_item_version* | integer | |
| decision_id | string | |
| decision_version | integer | |
| option_id | string | |
| instruction | string | |
| until | string (date-time) | |
| remind_at | string (date-time) | |
| field | string | |
| correction | string | |
| idempotency_key* | string |
回应 200
| ok | boolean | |
| work_item | AssistantWorkItem | |
| plan_id | string | null |
/api/assistant/action-plans/{id}通过不透明 ID 获取精确的操作预览
返回已准备的 Action 计划的精确回复身份、收件人、正文、承诺和副作用,以及其过期时间和源版本,以便客户端可以在用户通过现有回复端点使用 assistant_plan_id 发送之前显示将会发生什么。需要 assistant:read 范围。
参数
| id* | string | 不透明的 Action 计划 ID |
回应 200
| id | string | |
| status | string | |
| expires_at | string | |
| source_revision | integer | |
| effects | object[] |
/api/assistant/activity获取内容最小化的助手 Activity
列出归属于调用者的近期交互和回执,不包含消息正文。需要 assistant:read 范围。
参数
| limit | integer |
回应 200
| type | string | |
| as_of | string | |
| events | object[] |
/api/assistant/data导出派生的助手数据
将分析、已接受的声明、Decision、交互、回执和模型使用情况导出为 JSON 附件。绝不包含源电子邮件正文或附件字节。需要 assistant:write 范围。还需要 email:auth_secrets(否则返回 403 INSUFFICIENT_SCOPE):派生状态可能包含助手在身份验证邮件被排除之前从中提取的内容。
回应 200
| format | string | |
| exported_at | string | |
| note | string |
/api/assistant/data删除助手派生数据
幂等地删除派生智能、作业、模型使用情况、设备、导入和设置,同时保留源邮件。需要 assistant:write 授权。
回应 200
| ok | boolean | |
| deleted | object | |
| source_mail_deleted | boolean |
响应示例
{
"ok": true,
"deleted": {
"work_items": 12,
"claims": 40,
"entities": 9,
"jobs": 52
},
"source_mail_deleted": false
}/api/assistant/devices注册设备以接收已脱敏的 Now 提醒
为一个应用安装和环境注册或轮换加密的推送令牌。仅原生应用调用此接口,需要活跃的助手和 assistant:write 授权。
请求正文
| installation_id* | string | |
| platform* | string(ios | android) | |
| environment* | string(development | preview | production) | |
| push_token* | string | |
| locale* | string | |
| lock_screen_detail | string(redacted | sender_only) |
回应 200
| ok | boolean | |
| device | object |
/api/assistant/devices撤销设备注册
撤销一个安装的所有推送注册,例如在退出登录时。需要 assistant:write 授权。
参数
| installation_id* | string |
回应 200
| ok | boolean |
邮件
/api/domains/{domain}/email/check检查电子邮件 DNS 运行状况(MX、SPF、DMARC、DKIM)
检查域的电子邮件 DNS 配置:MX 记录、SPF、DMARC 和 DKIM。从 MX 记录中自动检测电子邮件提供商(Google Workspace、Proton、Fastmail)。
参数
| domain* | string | 您拥有的域名 |
回应 200
| domain | string | |
| provider | string | null | 自动检测到的电子邮件提供商(google-workspace、proton、fastmail),未检测到时为 null |
| mx | object | |
| spf | object | |
| dmarc | object | |
| dkim | object |
响应示例
{
"domain": "mysite.com",
"provider": "google-workspace",
"mx": {
"configured": true,
"records": [
"1 aspmx.l.google.com",
"5 alt1.aspmx.l.google.com"
]
},
"spf": {
"configured": true,
"value": "v=spf1 include:_spf.google.com ~all"
},
"dmarc": {
"configured": true,
"value": "v=DMARC1; p=quarantine; rua=mailto:dmarc@mysite.com"
},
"dkim": {
"configured": true,
"selectors": [
"google"
]
}
}示例
curl https://domani.run/api/domains/mysite.com/email/check \ -H "Authorization: Bearer domani_sk_xxx"
/api/domains/{domain}/email/deliverability获取所有者范围内的电子邮件送达率健康状况
分别呈现确定性身份验证就绪度、按收件人加权的 30 天投递结果、帐户安全状态和实测服务商收件箱位置。就绪度分数并非进入收件箱的概率,未测量的位置返回为 not_tested。
参数
| domain* | string | 您拥有的域名 |
回应 200
| domain | string | |
| status | string | |
| confidence | string | |
| checked_at | string (date-time) | |
| window_days | integer | |
| readiness | object | 确定性 DNS 配置准备情况。分数不是收件箱概率。 |
| sending_health | object | |
| placement | object | |
| actions | object[] | |
| caveats | string[] |
示例
curl https://domani.run/api/domains/mysite.com/email/deliverability \ -H "Authorization: Bearer domani_sk_xxx"
/api/domains/{domain}/email/setup在域上设置电子邮件
在域名上预配置电子邮件 DNS(可选)。当需要时,create_mailbox 会自动调用此函数。传递 force=true 以覆盖现有电子邮件提供商(Google Workspace、Fastmail、Proton)。
参数
| domain* | string | 域名 |
请求正文
| force | boolean | 覆盖现有电子邮件提供商(Google Workspace、Fastmail、Proton)。默认值:假 |
回应 200
| domain | string | |
| status | string | |
| verified_at | string | null | |
| receiving_verified | boolean | 当该域的 MX 指向平台的接收服务器,从而其地址的邮件被接受时为 true。 |
| sending_configured | boolean | |
| sending_verified | boolean | |
| records | DnsRecord[] | |
| hint | string |
/api/domains/{domain}/email/setup从域名中移除电子邮件
从域中删除电子邮件,删除所有邮箱和消息,并将 emailEnabled 设置为 false。此操作会更改整个域名的邮件,因此受邮箱限定的令牌会收到 403 MAILBOX_CONFINED。
参数
| domain* | string | 域名 |
/api/domains/{domain}/email/status检查电子邮件 DNS 状态
检查域的电子邮件 DNS 验证状态。返回域是否已验证并准备就绪、DNS 记录详细信息和邮箱计数。
参数
| domain* | string | 域名 |
回应 200
| domain | string | |
| enabled | boolean | |
| verified | boolean | 仅当接收和出站发送都经过验证时才为 True |
| receiving_verified | boolean | 当该域的 MX 指向平台的接收服务器,从而其地址的邮件被接受时为 true。 |
| sending_configured | boolean | |
| sending_verified | boolean | |
| records | DnsRecord[] | |
| mailbox_count | integer | |
| dns_managed | boolean | 当 Domani 自行写入该域的区域时为 true:待处理的记录由每小时一次的审计发布并修复,无需手动添加。对于外部区域为 false,待处理的记录必须在 DNS 服务商处添加。 |
| unreachable_addresses | string[] | 域名上被其接收 MX 拒绝的地址(托管域名上尚未在邮件主机注册的 api 邮箱)。当每个地址都能接收时为空;注册会自动重试。 |
| provider_status | string | |
| mailbox_plan_key | string | 此处适用于自定义域名邮箱的工作区套餐键(工作区自己的订阅,不一定是当前登录用户的个人套餐)。 |
| mailbox_limit | integer | null | 套餐在整个工作区允许的自定义域名邮箱数量。null 表示无限制。 |
| mailbox_limit_reached | boolean | 工作区达到其套餐的邮箱上限时为 True:要在此域名上再添加邮箱,需先升级。 |
| mailbox_upgrade_plan | object | null | 能再容纳一个邮箱的最便宜套餐。已无限制时为 null。 |
| hint | string |
/api/email在 domani.run 上创建邮箱
在 domani.run 上创建一个免费电子邮件地址(例如 hello@domani.run)。无需域名所有权。每个用户仅限 1 个免费 @domani.run 邮箱。许多常见的蛞蝓都是保留的。
请求正文
| slug* | string | 电子邮件地址的本地部分(例如 hello@domani.run 的“hello”) |
| name | string | 显示名称(默认为大写的 slug) |
回应 201
| id | string | |
| address | string | |
| name | string | null | |
| slug | string | |
| domain | string | |
| kind | string | |
| workspace_id | string | null | |
| access_role | string | |
| effective_capabilities | MailboxEffectiveCapabilities | |
| collaboration_enabled | boolean | |
| shared | boolean | 除调用者外,是否至少还有一人可以读取此邮箱 |
| message_count | integer | |
| webhook_url | string | null | |
| header_names | string[] | 配置的 webhook 身份验证标头名称;值永远不会返回 |
| forward_to | string | null | |
| signing_secret | string | null | |
| created_at | string (date-time) | |
| hint | string |
/api/email列出所有邮箱
列出代理主体可以跨所有域访问的每个邮箱,包括工作区授权。
参数
| domain | string | 按域过滤 |
回应 200
| mailboxes | object[] |
/api/emails创建邮箱
创建一个电子邮件地址(邮箱)。提供完整的地址,例如“hello@mysite.com”。电子邮件 DNS 会在首次使用时自动配置。传递force=true来覆盖现有的电子邮件提供商。自定义域邮箱容量由活动帐户或工作区计划决定。每个帐户都可以使用 POST /api/email 单独创建一个免费的@domani.run 邮箱。 传递workspace_id 在您拥有的工作区中创建邮箱。对于自定义域,这会显式地、原子地将该域及其所有未指定范围的同级邮箱采用到该工作区中;域永远不能跨工作区分割。 通过 kind="hosted" 在您自己的域上创建真正的 IMAP/SMTP 邮箱(连接 Apple Mail、Thunderbird 或任何客户端),而不是默认的 API 邮箱(通过 API + webhooks 发送/接收)。托管邮箱返回要发布的 DNS 记录、邮件客户端设置和一次性应用程序密码。需要您拥有的域。
请求正文
| address* | string | 完整的电子邮件地址,例如 hello@mysite.com |
| name | string | 出站电子邮件的显示名称(例如“John Doe”) |
| force | boolean | 覆盖现有 MX 记录。默认值:假 |
| kind | string(api | hosted) | “api”(默认:通过 API + webhooks 发送/接收)或“hosted”(您域中的真实 IMAP/SMTP 邮箱) |
| workspace_id | string | 拥有邮箱的工作区。只有工作区所有者才能采用资源。 |
回应 201
| id | string | |
| address | string | |
| name | string | null | |
| domain | string | |
| slug | string | |
| kind | string | |
| workspace_id | string | null | |
| access_role | string | |
| effective_capabilities | MailboxEffectiveCapabilities | |
| collaboration_enabled | boolean | |
| shared | boolean | 除调用者外,是否至少还有一人可以读取此邮箱 |
| message_count | integer | |
| webhook_url | string | null | |
| header_names | string[] | 配置的 webhook 身份验证标头名称;值永远不会返回 |
| forward_to | string | null | |
| signing_secret | string | null | 用于验证入站 Webhook 有效负载的 HMAC 密钥(在创建时显示一次) |
| host_id | string | 托管邮箱的邮件主机主体 ID |
| dns_records | DnsRecord[] | |
| dns_status | string | |
| receiving_status | string | |
| sending_status | string | |
| sending_error | object | |
| client_settings | object | |
| credential | object | |
| storage_quota_bytes | integer | |
| created_at | string (date-time) | |
| hint | string |
/api/emails列出所有邮箱
列出代理主体可以访问的每个邮箱,包括工作区授权。与 GET /api/email 相同。
参数
| domain | string | 按域过滤 |
回应 200
| mailboxes | object[] |
/api/emails/{address}获取邮箱详细信息
通过完整电子邮件地址(URL 编码,例如 hello%40mysite.com)获取特定邮箱的详细信息。
参数
| address* | string | 完整的电子邮件地址(URL 编码,例如 hello%40mysite.com) |
回应 200
| id | string | |
| address | string | |
| slug | string | |
| domain | string | |
| kind | string | |
| workspace_id | string | null | |
| access_role | string | |
| effective_capabilities | MailboxEffectiveCapabilities | |
| webhook_url | string | null | |
| forward_to | string | null | |
| signing_secret | string | null | 管理者的 HMAC 秘密;观看者/响应者为空 |
| message_count | integer | |
| storage_quota_bytes | integer | null | |
| storage_used_bytes | integer | null | |
| storage_measured_at | string (date-time) | null | |
| created_at | string (date-time) |
/api/emails/{address}更新邮箱
通过完整电子邮件地址更新邮箱的显示名称、Webhook URL 或转发电子邮件地址。设置为 null 以禁用/清除。
参数
| address* | string | 完整的电子邮件地址(URL 编码) |
请求正文
| name | string | null | 邮箱的显示名称。设置为 null 即可清除。 |
| webhook_url | string | null | 入站电子邮件 Webhook 的 HTTPS URL,或 null 以清除 |
| forward_to | string | null | 将入站电子邮件转发到的电子邮件地址,或为空以清除 |
| drop_spam | boolean | 丢弃(不存储或 webhook)标记为垃圾邮件的入站邮件 |
| tone_notes | string | null | 智能体从此邮箱起草邮件前阅读的口吻提示(语气、签名、措辞宜忌)。设置为 null 即可清除。 |
回应 200
| id | string | |
| address | string | |
| slug | string | |
| domain | string | |
| name | string | null | |
| webhook_url | string | null | |
| forward_to | string | null | |
| tone_notes | string | null | |
| signing_secret | string | 用于验证入站 Webhook 负载的 HMAC 密钥 |
/api/emails/{address}删除邮箱
通过完整电子邮件地址删除邮箱。请求正文中必须包含 confirm=true;否则返回包含 message_count 的预览。
参数
| address* | string | 完整的电子邮件地址(URL 编码) |
请求正文
| confirm | boolean | 必须为 true 才能真正删除。省略预览。 |
/api/emails/{address}/send发送电子邮件
从由完整电子邮件地址标识的邮箱发送电子邮件。服务器首先运行强制版本化策略:拒绝客观安全故障,同时返回声誉和内容质量结果作为警告。对于协作线程回复,传递撰写租约、观察到的reply_version和稳定的幂等性密钥;服务器在发送之前自动拒绝过时或重复的回复。每条消息最多 20 个唯一收件人。速率限制:每个邮箱每小时 100 个收件人。
参数
| address* | string | 发件人电子邮件地址(URL 编码) |
请求正文
| to* | any | 收件人电子邮件地址 |
| cc | any | 抄送收件人 |
| bcc | any | 密件抄送收件人 |
| subject | string | |
| text | string | 纯文本正文 |
| html | string | HTML 正文 |
| reply_to | string | 回复地址 |
| in_reply_to | string | 正在回复的电子邮件的消息 ID(用于线程) |
| references | string | 空格分隔的消息 ID 链(用于线程) |
| idempotency_key | string | 稳定的密钥可防止重复发送 |
| send_at | string (date-time) | 安排发送时间(ISO 8601,从现在起 30 秒到 30 天)。邮件以状态 'scheduled' 存储并在服务器端派发;在此之前将其移至垃圾箱即可取消。send_at 尚不支持附件。 |
| coordination | object | 需要进行谨慎的协作回复。 |
| allow_risky_content | boolean | 已弃用的兼容性字段。允许公共 HTTPS 第三方身份验证链接,但会出现警告;客观安全块不能被覆盖。 |
| attachments | object[] | 文件附件(最多 10 个,总共最大 40MB)。内容必须采用 base64 编码。 |
回应 200
| id | string | |
| message_id | string | RFC 5322 消息 ID |
| from | string | |
| to | string | |
| bcc | string | null | 你发送时的 Bcc 收件人,仅在你自己发出的邮件上返回;从不作为头部投递,也从不出现在你收到的邮件上。 |
| status | string | |
| attachments_count | integer | |
| suppressed | string[] | |
| deliverability | object | 应用于本次发送的版本化策略报告;检查决定和分类检查 |
/api/emails/{address}/deliverability-check对出站电子邮件进行预检
运行发送端点使用的确切版本化服务器端策略,而无需发送或消耗电子邮件配额。允许第三方域上的公共 HTTPS 身份验证链接,但带有信誉警告。本地/私有 URL、非 HTTPS 身份验证链接和可执行附件被阻止;超过 102 KB 的主体会产生剪辑警告。
参数
| address* | string | 发件人电子邮件地址(URL 编码) |
请求正文
| subject | string | |
| text | string | |
| html | string | |
| idempotency_key | string | |
| allow_risky_content | boolean | 已弃用的兼容性字段;客观安全块不能被覆盖。 |
| attachments | object[] |
回应 200
| policy_version | string | |
| decision | string | |
| safe_to_send | boolean | 向后兼容的布尔值相当于决策!=拒绝 |
| risk | string | |
| score | integer | |
| authentication_message | boolean | |
| checks | object[] | |
| blocked_reasons | string[] | |
| warnings | string[] | |
| override_used | boolean |
/api/emails/{address}/messages列出电子邮件
在规范文件夹或虚拟视图中列出电子邮件。默认为收件箱。文件夹位置与邮件方向和垃圾邮件判定无关。 身份验证邮件(OTP/验证码、密码重置、魔术链接)标记为security: "auth"”。没有email:auth_secrets范围的令牌会看到那些主题和正文已隐藏(redacted: true)的消息 - 元数据(来自、日期)保持可见。subject、q 和 attachments 筛选条件只匹配调用方可以读取的内容:没有该范围时,此类邮件只按已隐藏的主题和正文匹配,因此搜索其中的验证码不会找到任何结果。
参数
| address* | string | 邮箱电子邮件地址(URL 编码) |
| cursor | string | 上一个响应的分页光标 |
| limit | integer | 返回的最大消息数 |
| direction | string(in | out | all) | 按方向过滤(默认:全部) |
| folder | string(inbox | archive | sent | spam | trash) | 系统文件夹。与景观相互排斥。默认为收件箱。 |
| label | string | 逗号分隔的标签:仅包含携带其中任何一个标签的消息 |
| view | string(starred | all | needs_human | scheduled) | 虚拟视图。与文件夹互斥。 |
| since | string | ISO 时间戳 - 仅返回在此日期之后创建的消息 |
| until | string | ISO 时间戳 - 仅返回在此日期之前创建的消息 |
| from | string | 按发件人地址过滤 |
| to | string | 按收件人地址过滤 |
| subject | string | 按主题过滤 |
| q | string | 跨发件人、收件人、主题和纯文本正文的广泛不区分大小写的搜索 |
| unread | boolean | 仅返回未读消息 |
| attachments | boolean | 返回仅包含附件的邮件 |
| spam | boolean | 按垃圾邮件标记过滤(传递 false 以隐藏带有垃圾邮件标记的入站) |
回应 200
| messages | object[] | |
| next_cursor | string | null |
/api/emails/search按含义和词语搜索邮件
搜索您可以读取的邮箱,或使用 mailbox 搜索一个邮箱。默认混合模式:消息嵌入(pgvector, cosine)和加权词语索引通过倒数排名融合,并带有少量时效性提升,在一条语句中完成;why 说明哪个分支匹配。q 中的 Gmail 运算符: from: to: cc: subject: label: filename: mailbox: is:unread|read|starred|unstarred has:attachment in:inbox|archive|sent|spam|trash|anywhere after:2026/08/01 before: newer_than:7d older_than:2w (h/d/w/m/y)、"a phrase"、排除用 -word 或 -from:、a OR b。仅由运算符组成的查询按最新优先列出匹配的消息(why: filter)。登录验证码和链接、垃圾邮件和系统邮件从不被索引;智能体的 search_opt_out_mailbox_ids 中列出的邮箱仅按词语搜索。绑定到智能体身份的令牌仅搜索其智能体操作的邮箱。需要 email:read。没有 email:auth_secrets 时,收到的身份验证邮件会在排序之前被排除:任何词语、运算符或筛选条件都不会匹配它,因此搜索登录验证码不会找到任何结果。
参数
| mailbox | string | 限制为一个邮箱地址(slug@domain)。 |
| q* | string | 您要查找的内容,任何语言:姓名、引用或邮件描述,以及 Gmail 运算符 (`from:dave is:unread newer_than:7d -invoice "exact phrase"`)。 |
| mode | string(hybrid | semantic | keyword) | hybrid 按排名融合嵌入和词语;semantic 仅使用含义;keyword 仅使用词语。 |
| limit | integer | 返回的结果数。 |
| since | string | 仅此 ISO 时间戳之后收到的邮件。 |
| until | string | 仅此 ISO 时间戳之前收到的邮件。 |
| folder | string(inbox | archive | sent | spam | trash | anywhere) | 一个文件夹。除非指定或使用 `anywhere`,否则排除垃圾箱。 |
| from | string | 发件人地址包含。 |
| label | string | 逗号分隔的标签:仅包含携带其中任何一个标签的消息 |
回应 200
| results | object[] | |
| mode | string | |
| query | string | |
| took_ms | integer | |
| hint | string |
示例
curl "https://domani.run/api/emails/search?q=facture+tucows+ao%C3%BBt&limit=5" \ -H "Authorization: Bearer domani_sk_xxx"
/api/emails/connect/gmail开始连接 Gmail 收件箱
返回绑定到您的账户和导入界限的 Google 同意 URL。在浏览器中打开它;同意后,收件箱将成为其自己地址的已连接邮箱,在界限之后收到的邮件将被导入(默认:最近 24 小时),新邮件将在到达时跟随。永远不会导入整个收件箱:稍后使用 POST /api/emails/{address}/import 扩大范围。需要 email:write。服务器上必须配置 Google OAuth。
请求正文
| access | string(read | write) | read(默认)读取收件箱;write 还允许平台更改标签和已读状态,并以该用户身份发送邮件,实现常驻委托的效果。使用 write 重新连接以扩展只读授权。 |
| since | string (date-time) | 导入在此时刻之后收到的邮件 |
| window | string(24h | 7d | 30d | 1y) | 预设值而非 since;默认 24h |
| workspace_id | string | 邮箱所属的工作区;默认为您的个人工作区 |
| login_hint | string | 要预选的 Google 账户 |
| return_to | string | 同意后将浏览器发送到的应用路径 |
回应 200
| auth_url | string | |
| state | string | |
| import_since | string (date-time) | |
| expires_in | integer | |
| access | string |
/api/emails/connect/outlook开始连接 Outlook 收件箱
返回绑定到您的账户和导入边界的 Microsoft 同意 URL。在浏览器中打开它;同意后,收件箱将成为其自身地址的已连接邮箱,边界之后收到的邮件将被导入(默认:最近 24 小时),新邮件会在到达时跟进。永远不会导入整个收件箱:稍后使用 POST /api/emails/{address}/import 扩大范围。需要 email:write。服务器上必须配置 Microsoft OAuth。
请求正文
| access | string(read | write) | read(默认)读取收件箱;write 还允许平台更改标签和已读状态,并以该用户身份发送邮件,实现常驻委托的效果。使用 write 重新连接以扩展只读授权。 |
| since | string (date-time) | 导入在此时刻之后收到的邮件 |
| window | string(24h | 7d | 30d | 1y) | 预设值而非 since;默认 24h |
| workspace_id | string | 邮箱所属的工作区;默认为您的个人工作区 |
| login_hint | string | 要预选的 Microsoft 账户 |
| return_to | string | 同意后将浏览器发送到的应用路径 |
回应 200
| auth_url | string | |
| state | string | |
| import_since | string (date-time) | |
| expires_in | integer | |
| access | string |
/api/emails/connect/providers列出收件箱可以连接的方式
每个提供商一行(Gmail、Outlook、通过转发的任何收件箱、此处托管的地址):连接如何开始(同意屏幕、转发规则、创建的地址),连接可以做什么(读取,或读取和写入),是否导入较旧的邮件,以及此服务器是否为其设置。仅当 configured 为 true 时显示连接按钮;reason 为操作员命名缺失的变量。需要 email:read。
回应 200
| providers | MailProvider[] |
/api/emails/connect/forwarding通过转发连接收件箱
在收件箱自己的地址创建已连接的邮箱,并返回平台转发域上的转发地址,以及Gmail、Outlook和其他提供商的步骤。在提供商处添加转发规则;到达该地址的内容会被解包(原始发件人、日期、主题)并存储在已连接的邮箱下。Gmail会要求转发地址确认:代码和链接会出现在连接上。返回的第一封邮件,或探测(POST /api/emails/{address}/connector/verify),会使连接变为活动状态。只有新邮件会通过这种方式到达;旧邮件无法导入。需要email:write。转发域必须在服务器上配置。
请求正文
| address* | string | 要连接的收件箱,例如someone@gmail.com |
| workspace_id | string | 邮箱所属的工作区;默认为您的个人工作区 |
回应 200
| address | string | |
| mailbox_id | string | |
| status | string | |
| forwarding_address | string | |
| instructions | object | |
| guide | ForwardingGuide |
/api/emails/{address}/connector/verify通过转发规则发送探测
向已连接的收件箱发送邮件;当转发规则将其带回转发地址时,连接变为活动状态。仅适用于通过转发的连接。需要email:write。
参数
| address* | string | 已连接的地址,例如 someone@gmail.com |
回应 200
| sent_to | string | |
| forwarding_address | string |
/api/emails/{address}/connector读取已连接邮箱的连接
类型、状态、导入绑定、同步阶段(导入扫描,然后是历史记录)、导入进度(已扫描、已复制、待分析、已分析)、最后同步时间和最后错误。需要 email:read。转发确认(Gmail 的验证码和链接)属于身份验证邮件:没有 email:auth_secrets 时,其 code 和 url 为 null,并带有 redacted: true。受邮箱限定的令牌只能找到其自身的邮箱(否则返回 404)。
参数
| address* | string | 已连接的地址,例如 someone@gmail.com |
回应 200
| address | string | |
| mailbox_id | string | |
| kind | string | |
| status | string | |
| import_since | string (date-time) | null | 首次导入的界限:在此之前收到的邮件不会被复制 |
| phase | string | 列表会在导入扫描翻阅绑定后的邮件时进行,一旦新邮件遵循源的历史记录,历史记录就会更新 |
| paused_reason | string | null | |
| import_run | object | null | 此邮箱当前或最近一次的导入运行 |
| source_messages_total | integer | null | 源为整个收件箱报告的内容,用于规模参考 |
| last_sync_at | string (date-time) | null | |
| last_error | string | null | |
| backoff_until | string (date-time) | null | |
| verified_at | string (date-time) | null | |
| connected_at | string (date-time) | |
| cost_cap_usd | number | 每次导入运行允许的模型花费,以美元为单位 |
| access | string | null | 对于 Gmail 连接:授权允许的操作;write 表示可以双向管理标签并以该用户身份发送邮件 |
| forwarding | object | null | 通过转发的连接:转发地址、到达的内容、Gmail的确认、探测、步骤 |
/api/emails/{address}/connector断开已连接邮箱的连接
删除个人自己的副本(消息、附件、搜索行、待处理作业)和凭据;保留邮箱行、标记为已断开连接的链接,以及智能体所做的操作(回执)。只有已连接的邮箱才能断开连接。需要 email:write。
参数
| address* | string |
回应 200
| disconnected | boolean | |
| address | string | |
| removed_messages | integer | |
| removed_attachments | integer |
/api/emails/{address}/import导入已连接邮箱的较旧邮件
将导入扩展到更早的日期:新的导入运行会按到达顺序复制新绑定和当前绑定之间的邮件,在其自己的成本上限下进行。在导入扫描仍在运行时会被拒绝。需要 email:write。
参数
| address* | string |
请求正文
| since* | string (date-time) | 新界限,早于当前界限 |
回应 200
| import_run_id | string | |
| import_since | string (date-time) | |
| import_until | string (date-time) |
/api/emails/{address}/search按含义和词语搜索一个邮箱
与 GET /api/emails/search 相同的搜索,限制为此邮箱。需要 email:read。没有 email:auth_secrets 时,收到的身份验证邮件会在排序之前被排除:任何词语、运算符或筛选条件都不会匹配它,因此搜索登录验证码不会找到任何结果。
参数
| address* | string | 邮箱电子邮件地址(URL 编码) |
| q* | string | 您要查找的内容,任何语言:姓名、引用或邮件描述,以及 Gmail 运算符 (`from:dave is:unread newer_than:7d -invoice "exact phrase"`)。 |
| mode | string(hybrid | semantic | keyword) | hybrid 按排名融合嵌入和词语;semantic 仅使用含义;keyword 仅使用词语。 |
| limit | integer | 返回的结果数。 |
| since | string | 仅此 ISO 时间戳之后收到的邮件。 |
| until | string | 仅此 ISO 时间戳之前收到的邮件。 |
| folder | string(inbox | archive | sent | spam | trash | anywhere) | 一个文件夹。除非指定或使用 `anywhere`,否则排除垃圾箱。 |
| from | string | 发件人地址包含。 |
| label | string | 逗号分隔的标签:仅包含携带其中任何一个标签的消息 |
回应 200
| results | object[] | |
| mode | string | |
| query | string | |
| took_ms | integer | |
| hint | string |
/api/emails/{address}/threads列出邮箱的对话
消息按照邮件客户端的分组方式分组:回复会加入其回复的消息的线程(In-Reply-To,然后是 References 链),没有可用标头的邮件会加入三十天内具有相同主题和共同通信者的最近线程,其他所有邮件会开始一个新线程,其 id 为其第一条消息的 id。线程按最后活动时间排序;垃圾箱和垃圾邮件永远不参与,除非被指定为文件夹。folder=inbox|archive|sent 保留在那里有消息的线程,但仍计算整个对话。
参数
| address* | string | |
| folder | string(all | inbox | archive | sent | spam | trash) | |
| since | string | 仅包含此时间之后有活动的线程 |
| limit | integer | |
| cursor | string | 上一页的 next_cursor |
| label | string | 逗号分隔的标签:仅包含携带其中任何一个标签的消息的会话 |
回应 200
| threads | EmailThread[] | |
| next_cursor | string | null | |
| has_more | boolean |
/api/emails/{address}/threads/{id}读取一个对话,最旧的消息在前
该线程的每条消息(包括垃圾箱,因此故事中不会缺少任何内容),包含其文本,最旧的在前,加上参与者和未读计数。Auth mail 的编辑方式与消息读取相同。
参数
| address* | string | |
| id* | string | 线程 id(其任何消息的 thread_id) |
回应 200
| id | string | |
| subject | string | null | |
| participants | string[] | |
| message_count | integer | |
| unread_count | integer | |
| first_message_at | string (date-time) | |
| last_message_at | string (date-time) | |
| messages | object[] |
/api/emails/{address}/events流式传输邮箱事件(服务器发送事件)
返回 text/event-stream。不带游标时流从当前时刻开始;带 since(来自 /api/email/changes 的游标或任何更早事件的 id)时,它首先重放该点之后的每个变更,然后实时跟踪邮箱日志:每帧携带变更类型作为事件名称(message.received、message.updated、message.deleted、message.moved、message.status、mailbox.resync_required、assistant.item.delegated、assistant.item.recalled 等),变更作为 JSON data 及其可恢复的 cursor,以及同一游标作为帧 id。首帧是 ready,包含用于恢复的游标;每 20 秒到达一次保活注释;连接在约 5 分钟后关闭,带有 close 帧和 retry: 提示。使用 Last-Event-ID(或 since)重新连接以无间隙、无重复地恢复。智能体令牌仅限于智能体操作的邮箱。关于由身份验证邮件生成的工作项的条目,对于没有 email:auth_secrets 的令牌,其 title 和 ask 会被隐藏。
参数
| address* | string | |
| since | string | 要重放的游标;任何更早事件的 `cursor` 或来自 /api/email/changes 的 next_cursor |
/api/emails/{address}/folders列出电子邮件文件夹和计数
返回系统文件夹和虚拟视图的服务器派生计数,以及邮箱后端的生命周期功能。
参数
| address* | string |
回应 200
| folders | object[] | |
| views | object[] | |
| capabilities | object |
/api/emails/{address}/messages/actions对消息应用生命周期操作
移动、恢复、标记为已读、加注星标或永久删除最多 100 个显式消息 ID。移至垃圾箱是可逆的。永久删除需要email:delete,并且只接受垃圾箱中已有的邮件。每个响应都是持久操作收据,每个请求的 ID 都有一个结果。在标准Idempotency-Key标头或旧版idempotency_key JSON 字段中提供稳定的密钥,并在超时后重用它;精确的重试会返回存储的收据,而不会发生其他突变。如果提供了两种形式,则它们必须匹配。在不同的请求中重用密钥会返回 409。如果省略,服务器会创建一个密钥并在正文和Idempotency-Key标头中返回它。当只有部分批处理成功时,返回 207。
参数
| address* | string |
请求正文
| message_ids* | string[] | |
| action* | string(move | mark_read | star | restore | delete_permanently | label) | |
| destination | string(inbox | archive | sent | spam | trash) | |
| read | boolean | |
| starred | boolean | |
| add | string[] | label: 要添加的标签 |
| remove | string[] | label: 要移除的标签 |
| set | string[] | label: 替换每个标签(优先于添加和移除) |
| idempotency_key | string | 此精确逻辑批次的稳定密钥。超时后重用。 |
回应 200
| operation_id | string | |
| idempotency_key | string | |
| idempotent_replay | boolean | 当此响应重用不可变的已完成收据并且不执行新的突变时为真。 |
| action | string | |
| status | string | |
| results | object[] | |
| summary | object | |
| created_at | string (date-time) | |
| completed_at | string (date-time) | null |
/api/emails/{address}/messages/read将消息标记为已读或未读
重试安全读取状态更新的兼容性端点。返回规范的持久每项操作收据以及遗留计数。超时后提供并重用Idempotency-Key标头或兼容性idempotency_key字段。
参数
| address* | string | 邮箱电子邮件地址(URL 编码) |
请求正文
| message_ids* | string[] | 要标记的消息 ID |
| read* | boolean | true 标记为已读, false 标记为未读 |
| idempotency_key | string |
回应 200
| operation_id | string | |
| idempotency_key | string | |
| idempotent_replay | boolean | 当此响应重用不可变的已完成收据并且不执行新的突变时为真。 |
| action | string | |
| status | string | |
| results | object[] | |
| summary | object | |
| created_at | string (date-time) | |
| completed_at | string (date-time) | null | |
| count | integer |
/api/emails/{address}/messages/delete批量删除消息
可安全重试将邮件移至垃圾箱的兼容性端点。返回规范的持久每项操作收据以及遗留计数。超时后提供并重用Idempotency-Key标头或兼容性idempotency_key字段。
参数
| address* | string | 邮箱电子邮件地址(URL 编码) |
请求正文
| message_ids* | string[] | 要删除的消息 ID |
| idempotency_key | string |
回应 200
| operation_id | string | |
| idempotency_key | string | |
| idempotent_replay | boolean | 当此响应重用不可变的已完成收据并且不执行新的突变时为真。 |
| action | string | |
| status | string | |
| results | object[] | |
| summary | object | |
| created_at | string (date-time) | |
| completed_at | string (date-time) | null | |
| count | integer |
/api/emails/{address}/messages/{id}收到消息
按 ID 从由完整电子邮件地址标识的邮箱中获取单条消息。除非令牌具有 email:auth_secrets 范围,否则分类为身份验证邮件(OTP、密码重置、魔术链接)的消息将在主题/正文隐藏后返回。
参数
| address* | string | 邮箱电子邮件地址(URL 编码) |
| id* | string | 消息ID |
回应 200
| id | string | |
| thread_id | string | 该线程中每条消息共享的对话 id(根消息 id) |
| labels | string[] | 消息上的每个标签;`label` 是第一个 |
| thread_key | string | 规范后端命名空间对话密钥 |
| thread_aliases | string[] | 改变对话状态时传回的旧工作流密钥 |
| message_id | string | null | |
| direction | string | |
| from | string | 发件人的显示名称和地址,来自 From 头部(例如 'Alice <alice@example.com>'),邮件未携带名称时仅为裸地址。 |
| avatar_url | string (uri) | null | 发件人头像的隐私保护 Domani 代理 URL |
| to | string | 头部中的每一个 To 收件人,带显示名称,按发件人书写的顺序排列(不仅仅是把这封邮件路由到邮箱的信封地址)。 |
| cc | string | null | 头部中的每一个 Cc 收件人,带显示名称;邮件未携带 Cc 时为 null。 |
| bcc | string | null | Bcc 收件人,仅出现在你自己发出的邮件上(从不出现在你收到的邮件上,也从不作为头部投递)。 |
| reply_to | string | null | |
| subject | string | |
| text | string | null | |
| html | string | null | |
| in_reply_to | string | null | |
| references | string | null | |
| attachments | object[] | |
| status | string | |
| is_read | boolean | |
| read_at | string | null | |
| events | object[] | |
| created_at | string (date-time) |
/api/emails/{address}/messages/{id}删除一条消息
将邮件移至垃圾箱。这是可逆的。将生命周期操作与 delete_permanently 和 email:delete 令牌结合使用,以删除已在“垃圾箱”中的邮件。
参数
| address* | string | 邮箱电子邮件地址(URL 编码) |
| id* | string | 消息ID |
回应 200
| id | string | |
| deleted | boolean |
/api/emails/{address}/messages/{id}/reply回复消息
回复由完整电子邮件地址标识的邮箱中的邮件。线程标题是自动填充的,并且除非 quote 为 false,原始邮件会像邮件客户端一样引用在回复下方(使用账户语言的署名行、文本中的 > 行、HTML 中的 gmail_quote 块)。协作客户端应传递 compose 租约、观察到的reply_version 和稳定的幂等密钥;服务器在发送之前立即自动拒绝陈旧/双重回复。
参数
| address* | string | 邮箱电子邮件地址(URL 编码) |
| id* | string | 要回复的消息 ID |
请求正文
| text | string | 纯文本回复正文 |
| html | string | HTML 回复正文 |
| cc | any | 其他抄送收件人 |
| all | boolean | 回复全部:从原始收件人/抄送自动填充抄送 |
| quote | boolean | 在回复下方引用原始邮件;为 false 时仅发送所提供的文本或 HTML |
| idempotency_key | string | 幂等性密钥的主体兼容性形式 |
| coordination | object |
回应 200
| id | string | |
| message_id | string | |
| from | string | |
| to | string | |
| status | string | |
| reply_version | integer | 为受保护的回复保留的一代 |
/api/emails/{address}/messages/{id}/forward转发消息
将邮件从由其完整电子邮件地址标识的邮箱转发给另一个收件人。转发身份验证邮件(OTP、密码重置、魔术链接)需要 email:auth_secrets 范围 - 它会泄露秘密。
参数
| address* | string | 邮箱电子邮件地址(URL 编码) |
| id* | string | 转发的消息ID |
请求正文
| to* | string | 收件人电子邮件地址 |
| text | string | 可选的前置注释 |
回应 200
| id | string | |
| message_id | string | |
| from | string | |
| to | string | |
| status | string |
/api/emails/{address}/avatar获取邮箱头像信息
返回 Gravatar URL(如果设置)和由完整电子邮件地址标识的邮箱的注册链接。
参数
| address* | string | 邮箱电子邮件地址(URL 编码) |
回应 200
| address | string | |
| gravatar_url | string | null | |
| gravatar_signup | string | |
| has_avatar | boolean | |
| hint | string |
/api/emails/{address}/webhook获取邮箱 webhook 配置
返回 webhook URL、签名密钥、配置的身份验证标头名称以及邮箱状态。标头值永远不会返回。
参数
| address* | string | 邮箱电子邮件地址(URL 编码) |
回应 200
| address | string | |
| webhook_url | string | null | |
| signing_secret | string | null | |
| has_webhook | boolean | |
| events | string[] | 此 webhook 携带的事件:email.received、任何出站邮件的投递结果(email.delivered、email.bounced、email.failed、email.suppressed、email.complained、email.delayed)以及智能体移交通知(assistant.item.delegated、assistant.item.recalled);没有 webhook 时为空 |
| header_names | string[] | 配置的 auth 标头名称;值永远不会返回 |
| hint | string |
/api/emails/{address}/webhook设置邮箱 webhook
为 HMAC 签名的邮箱事件配置 HTTPS 目标:默认为入站邮件,另可(通过 events 选择加入)接收从该邮箱发出的邮件的投递结果。退信会在发送被接受后的几秒内送达发件人,而不是只留在消息记录里。实时入站投递会持久存储、立即尝试并最多重试 3 次。每次尝试都包括从 1 开始的 X-Domani-Delivery-Attempt。可选的授权或 X-API-Key 值会被加密并且永远不会返回;人类操作员应该通过 CLI 环境变量选项将它们提交到模型上下文之外。
参数
| address* | string | 邮箱电子邮件地址(URL 编码) |
请求正文
| url* | string | HTTPS 网络钩子 URL |
| events | string[] | 要推送的事件(assistant.item.delegated 和 assistant.item.recalled 告知智能体所有者将 Today 项目移交给它或收回;智能体操作的每个邮箱的 webhook 都会接收这些事件)。省略时保持当前订阅(新 webhook 仅接收入站邮件)。从该邮箱发送的邮件的投递结果需要选择加入,会发送到相同 URL 并使用相同签名:{event, mailbox, email, message: {id, message_id, to, subject, status, detail}}。 |
| headers | object | 可选的加密身份验证标头。仅接受授权和X-API-Key;发送 {} 进行清除。不要通过模型上下文传递值; CLI 支持 --authorization-env 和 --api-key-env。 |
回应 200
| address | string | |
| webhook_url | string | |
| signing_secret | string | |
| has_webhook | boolean | |
| events | string[] | 此 webhook 携带的事件:email.received、任何出站邮件的投递结果(email.delivered、email.bounced、email.failed、email.suppressed、email.complained、email.delayed)以及智能体移交通知(assistant.item.delegated、assistant.item.recalled);没有 webhook 时为空 |
| header_names | string[] | 配置的 auth 标头名称;值永远不会返回 |
| hint | string |
示例
curl -X PUT https://domani.run/api/emails/agent%40example.com/webhook \
-H "Authorization: Bearer domani_sk_xxx" \
-H "Content-Type: application/json" \
-d '{"url":"https://agent.example/webhook","events":["email.received","email.bounced","email.delivered"]}'/api/emails/{address}/webhook删除邮箱 webhook
从邮箱中删除 Webhook URL 和签名密钥。仅存储入站电子邮件。
参数
| address* | string | 邮箱电子邮件地址(URL 编码) |
回应 200
| address | string | |
| webhook_url | string | null | |
| signing_secret | string | null | |
| has_webhook | boolean | |
| events | string[] | 此 webhook 携带的事件:email.received、任何出站邮件的投递结果(email.delivered、email.bounced、email.failed、email.suppressed、email.complained、email.delayed)以及智能体移交通知(assistant.item.delegated、assistant.item.recalled);没有 webhook 时为空 |
| header_names | string[] | |
| hint | string |
/api/emails/{address}/webhook/rotate旋转 webhook 签名秘密
重新生成邮箱 Webhook 的 HMAC-SHA256 签名密钥。旧秘密立即失效。
参数
| address* | string | 邮箱电子邮件地址(URL 编码) |
回应 200
| address | string | |
| webhook_url | string | |
| signing_secret | string | |
| has_webhook | boolean | |
| hint | string |
/api/emails/{address}/webhook/test测试邮箱 webhook
将一个已签名的测试负载发送到邮箱 Webhook URL。返回 HTTP 状态以及投递是否成功。测试不会重试;实时入站投递最多重试 3 次。
参数
| address* | string | 邮箱电子邮件地址(URL 编码) |
回应 200
| address | string | |
| webhook_url | string | |
| status | integer | |
| success | boolean | |
| hint | string |
/api/emails/{address}/aliases列出邮箱别名
列出发送到邮箱的所有别名地址。别名允许多个地址(sales@、hello@、contact@)共享一个收件箱,而无需使用邮箱槽。
参数
| address* | string | 邮箱电子邮件地址(URL 编码) |
回应 200
| mailbox | string | |
| aliases | object[] | |
| hint | string |
/api/emails/{address}/aliases添加邮箱别名
添加传送到此邮箱的别名地址,而不使用邮箱槽。别名必须与邮箱位于同一域中。提供一个简单的地址(“sales”)或完整的地址(“sales@mysite.com”)。
参数
| address* | string | 邮箱电子邮件地址(URL 编码) |
请求正文
| alias* | string | 别名地址 - 同一域上的裸 slug 或完整 slug@domain |
回应 201
| address | string | |
| mailbox | string | |
| created_at | string (date-time) | |
| hint | string |
/api/emails/{address}/aliases/{alias}删除邮箱别名
从邮箱中删除别名。发送到该地址的电子邮件将停止发送。
参数
| address* | string | 邮箱电子邮件地址(URL 编码) |
| alias* | string | 要删除的别名地址(URL 编码,或裸露的 slug) |
回应 200
| address | string | |
| deleted | boolean | |
| hint | string |
/api/emails/{address}/client-settings获取邮件客户端设置(托管)
获取托管邮箱的 IMAP/SMTP 连接设置,以配置 Apple Mail、Thunderbird 或任何邮件客户端。用户名是完整的地址;密码是应用程序密码(使用 POST /api/emails/{address}/credentials 创建一个)。仅托管邮箱。
参数
| address* | string | 托管邮箱地址(URL 编码) |
回应 200
| mailbox | string | |
| username | string | |
| imap | object | |
| smtp | object | |
| hint | string |
/api/emails/{address}/credentials列出应用程序密码(托管)
列出托管邮箱的应用程序密码。秘密仅在创建时显示一次;这仅返回标签和元数据。仅托管邮箱。
参数
| address* | string | 托管邮箱地址(URL 编码) |
回应 200
| mailbox | string | |
| credentials | object[] | |
| hint | string |
/api/emails/{address}/credentials创建应用程序密码(托管)
为托管邮箱创建应用程序密码,用作邮件客户端 (IMAP/SMTP) 中的密码。秘密返回一次 - 现在存储它。仅托管邮箱。
参数
| address* | string | 托管邮箱地址(URL 编码) |
请求正文
| label | string | 用于识别此应用程序密码的标签,例如“笔记本电脑邮件” |
回应 201
| id | string | |
| label | string | |
| password | string | 应用程序密码 - 显示一次,立即存储 |
| client_settings | object | |
| hint | string |
/api/emails/{address}/credentials/{id}撤销应用程序密码(托管)
撤销应用程序密码。任何使用它的邮件客户端都会立即停止连接。仅托管邮箱。
参数
| address* | string | 托管邮箱地址(URL 编码) |
| id* | string | 应用程序密码 ID(来自列表端点) |
回应 200
| id | string | |
| revoked | boolean | |
| hint | string |
/api/emails/{address}/messages/{id}/escalate将邮件标记给人工
将邮件升级给帐户的人工(或使用 clear=true 清除标记)。在邮件上设置 needs_human,将其会话保持在 needs_human 状态,并触发 email.escalated Webhook + 应用内通知。这是 'answer the easy ones, stop on the one the human must decide' 背后的产品原语。
参数
| address* | string | 邮箱电子邮件地址(URL 编码) |
| id* | string | 要标记的邮件 ID |
请求正文
| reason | string | 为何需要人工 - 显示在通知中 |
| clear | boolean | 清除标记而不是设置它(人工已接手) |
回应 200
| id | string | |
| needs_human | boolean | |
| escalation_reason | string | null | |
| thread_key | string |
/api/emails/{address}/messages/{id}/remind设置跟进提醒
在邮件上设置(或使用 clear=true 清除)一次性跟进提醒。当 remind_at 到达而邮件仍未得到答复时(入站:未发送回复;出站:未收到入站回复),email.reminder_due 会以 Webhook + 应用内通知的形式触发,并且提醒会自行清除。
参数
| address* | string | 邮箱电子邮件地址(URL 编码) |
| id* | string | 要关注的邮件 ID |
请求正文
| remind_at | string (date-time) | 提醒时间(ISO 8601,从现在起 1 分钟到 90 天) |
| note | string | 提醒触发时显示的上下文 |
| clear | boolean | 清除待处理的提醒 |
回应 200
| id | string | |
| remind_at | string | null | |
| reminder_note | string | null |
/api/contacts列出联系人
帐户的通讯录,由邮件往来自动填充:通信者、邮件数量、最近活动和备注。默认按最近活跃排在最前(order=recent),用于展示:在分页扫描期间收到新邮件的联系人会移到游标之前,因此这次扫描可能会漏掉它。要同步整个通讯录,请传入 order=created:按创建时间再按 id 从旧到新排列,这个排序键永不改变,因此在整个扫描期间都存在的每个联系人都恰好返回一次,期间新建的联系人排在末尾。游标只能继续它所来自的排序(否则返回 400 INVALID_CURSOR)。会聚合每个邮箱的数据,因此受邮箱限定的令牌会被拒绝(400 MAILBOX_CONFINED)。
参数
| q | string | 按地址或名称子串过滤 |
| limit | integer | 要返回的联系人数量(默认 50) |
| cursor | string | 来自先前响应的分页光标 |
| order | string(recent | created) | 排序方式。recent(默认):最近活跃的排在最前,用于展示。created:按创建时间再按 id 从旧到新排列,适合完整扫描且保持稳定。其他任何值都会返回 400 INVALID_ORDER。 |
回应 200
| contacts | object[] | |
| next_cursor | string | null |
/api/contacts创建或更新联系人
保存联系人:设置显示名称并附加备注('prefers short emails'、'decision maker at Acme')。无论如何,邮件往来都会持续更新邮件数量。
请求正文
| address* | string | 联系人的电子邮件地址 |
| name | string | null | 显示名称(null 会清除它) |
| notes | string | null | 智能体和人工用于了解上下文的备注(null 会清除它们) |
/api/contacts/{address}删除联系人
从通讯录中移除联系人。如果对方再次来信,邮件往来会将其重新创建为自动联系人。
参数
| address* | string | 联系人的电子邮件地址(URL 编码) |
/api/emails/{address}/rules列出入站邮件规则
按应用的优先顺序列出邮箱的入站过滤规则(第一个匹配者获胜)。
参数
| address* | string | 邮箱电子邮件地址(URL 编码) |
回应 200
| mailbox | string | |
| rules | MailRule[] | |
| hint | string |
/api/emails/{address}/rules添加入站邮件规则
添加一条规则,用于匹配字段(from/to/subject/body)的入站邮件。操作:drop、mark_read、forward(action_arg = 地址)、webhook_only(跳过转发)和 label(action_arg = 标签)。规则按优先级从低到高应用;第一条匹配规则生效。
参数
| address* | string | 邮箱电子邮件地址(URL 编码) |
请求正文
| match_field* | string(from | to | subject | body) | |
| match_op* | string(contains | equals | regex) | |
| match_value* | string | |
| action* | string(drop | mark_read | forward | webhook_only | label | escalate) | |
| action_arg | string | 转发地址(用于 forward)、标签值(用于 label)或显示给人工的原因(用于 escalate) |
| priority | integer | 较低的先运行(默认 0) |
| enabled | boolean | 默认 true |
回应 201
| id | string | |
| priority | integer | 首先运行较低的运行 |
| match_field | string | |
| match_op | string | |
| match_value | string | |
| action | string | |
| action_arg | string | null | |
| enabled | boolean | |
| created_at | string (date-time) |
/api/emails/{address}/rules/{ruleId}删除入站邮件规则
从邮箱中删除入站过滤规则。
参数
| address* | string | 邮箱电子邮件地址(URL 编码) |
| ruleId* | string | 规则ID |
回应 200
| id | string | |
| deleted | boolean | |
| hint | string |
/api/domains/{domain}/email/catch-all设置域包罗万象
将发送到域中不匹配地址的每封电子邮件路由到指定邮箱。任何与邮箱、子地址或别名不匹配的内容都会被捕获。该邮箱必须已存在于域中。此操作会更改整个域名的邮件,因此受邮箱限定的令牌会收到 403 MAILBOX_CONFINED。
参数
| domain* | string | 域名 |
请求正文
| mailbox* | string | 包罗万象的邮箱 - 此域上的裸邮件或完整地址 |
回应 200
| domain | string | |
| catch_all | string | null | |
| hint | string |
/api/domains/{domain}/email/catch-all清晰的域名包罗万象
删除域上的所有内容。发送至不匹配地址的电子邮件将再次被丢弃。此操作会更改整个域名的邮件,因此受邮箱限定的令牌会收到 403 MAILBOX_CONFINED。
参数
| domain* | string | 域名 |
回应 200
| domain | string | |
| catch_all | string | null | |
| hint | string |
/api/email/changes增量同步一个邮箱
不使用游标进行调用以捕获有界完整快照之前的基线。然后传递next_cursor来重放该快照期间和之后发生的突变。游标是不透明的、签名的、邮箱绑定的,并在 30 天后过期。推送通知只是失效提示;该期刊是持久恢复来源。关于由身份验证邮件生成的工作项的条目,对于没有 email:auth_secrets 的令牌,其 title 和 ask 会被隐藏。
参数
| mailbox_id* | string | |
| cursor | string | 来自先前响应的不透明 next_cursor |
| limit | integer |
回应 200
| changes | MailboxChange[] | |
| next_cursor | string | |
| has_more | boolean | |
| requires_full_sync | boolean | |
| reason | string |
/api/suppressions列出被抑制的地址
在禁止列表中列出地址 - 硬退回邮件和投诉(从递送事件中自动提取)以及手动输入。发送到这些地址的邮件将被跳过。光标分页。
参数
| cursor | string | 来自先前响应的分页光标 |
| limit | integer | 最大条目数(默认 50,最大 100) |
回应 200
| suppressions | object[] | |
| next_cursor | string | null | |
| hint | string |
/api/suppressions添加抑制
手动将地址添加到禁止列表中,以便将来的发送跳过它。自动添加硬退回邮件和投诉;将此用于您想要停止发送电子邮件的地址。幂等。
请求正文
| address* | string | 要抑制的电子邮件地址 |
| reason | string(manual | hard_bounce | complaint) | 原因(默认:手动) |
回应 201
| address | string | |
| reason | string | |
| source | string | |
| created_at | string (date-time) | |
| hint | string |
/api/suppressions/{address}移除抑制
从黑名单中删除某个地址,以便您可以再次通过电子邮件发送该地址(例如,在收件人修复其邮箱后)。
参数
| address* | string | 隐藏的电子邮件地址(URL 编码) |
回应 200
| address | string | |
| deleted | boolean | |
| hint | string |
Collaboration
/api/workspaces/{id}/ownership-transfer请求工作区所有权转让
仅限域名所有者。向现有会员发送 48 小时接受链接。在经过身份验证的成员接受之前,不会发生任何变化。
参数
| id* | string |
请求正文
| membership_id* | string |
/api/workspaces/{id}/ownership-transfer/{transferId}撤销待定的所有权转让
参数
| id* | string | |
| transferId* | string |
/api/workspaces/ownership-transfers/accept接受工作区所有权
仅限目标。以原子方式传输工作空间、范围域和邮箱;以前的所有者成为管理员,现有的付款人保持不变。
请求正文
| token* | string |
认证
/api/auth/register公共创建一个新帐户
通过发送登录邮件链接开始创建新账户(或登录已有账户);此处不会返回API密钥。在浏览器中点击该链接的人会直接进入已登录状态的控制台。没有浏览器会话的CLI或智能体应改用设备登录流程(先 POST /api/auth/cli 再轮询 GET /api/auth/cli/poll),该流程会通过邮件发送同样的批准,并在批准后返回API密钥 - 响应中的 next_steps 会说明这一点。传入 ref 代码会将新用户永久关联到推荐人 - 推荐人将从该用户此后所有的域名购买中获得佣金。
请求正文
| email* | string (email) | |
| ref | string | 推荐代码 - 将此用户永久链接到推荐人。推荐人在每次购买域名时都会赚取佣金。 |
回应 202
| ok | boolean | |
| verification_required | boolean | |
| message | string | |
| hint | string | |
| next_steps | string[] |
响应示例
{
"ok": true,
"verification_required": true,
"message": "Check your email for a sign-in link to finish creating your account.",
"hint": "A human must open that email and click the link in a browser to finish verification; no API key is issued yet.",
"next_steps": [
"If a person can click the email link, nothing else to do: they land on the dashboard already signed in.",
"If you are a CLI or agent without a browser session, start a device-login flow instead: POST /api/auth/cli, then poll GET /api/auth/cli/poll?code=... until status is \"complete\" - the same email approves it and hands back an API key, no browser needed on your side."
]
}示例
curl -X POST https://domani.run/api/auth/register \
-H "Content-Type: application/json" \
-d '{"email": "dev@example.com"}'/api/auth/login公共发送魔术链接登录电子邮件
将登录链接发送到提供的电子邮件。如果用户不存在,请先创建一个帐户。魔术链接重定向到带有身份验证凭据的仪表板。对于编程式 API 访问,请使用 POST /api/auth/register 直接获取 API 密钥。
请求正文
| email* | string (email) |
回应 200
| ok | boolean | |
| message | string |
响应示例
{
"ok": true,
"message": "Check your email for a sign-in link."
}示例
curl -X POST https://domani.run/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "dev@example.com"}'/api/auth/verify公共验证魔法链接令牌
验证魔术链接令牌并使用身份验证凭据重定向到仪表板。由魔术链接电子邮件使用 - 通常不由智能体直接调用。智能体应改用 POST /api/auth/register。
参数
| token* | string | 来自电子邮件的神奇链接令牌(base64url 编码) |
/api/auth/handoff生成一次性跨主机登录代码
仅限浏览器:让已在 domani.run 或 mailzero.run 登录的用户无需第二封魔法链接即可在另一个主机上恢复会话。返回一个 URL,其片段携带一个有效期 60 秒、一次性且绑定主机的代码;该代码从不写入日志,也不会通过查询字符串发送。在浏览器会话之外没有用处,因此不作为智能体工具公开。
请求正文
| target* | string(mail | domani) | |
| path* | string |
回应 200
| url | string |
响应示例
{
"url": "https://mailzero.run/auth/handoff#code=xxx&next=%2Finbox"
}/api/auth/handoff/redeem公共兑换一次性跨主机登录代码
仅限浏览器:由目标主机上的 /auth/handoff 页面调用,用 URL 片段中的代码换取会话,与 GET /api/auth/verify 处理魔法链接的方式完全相同。代码必须与此请求到达的 Host 一致。不是智能体工具。
请求正文
| code* | string |
回应 200
| ok | boolean | |
| next | string |
响应示例
{
"ok": true,
"next": "/inbox"
}账户
/api/me获取当前帐户详细信息
返回经过身份验证的用户的帐户信息,包括电子邮件、付款状态、联系信息状态、推荐代码和使用计数。智能体应在身份验证后调用此方法,以在尝试购买之前检查has_payment_method和has_contact。
回应 200
| id | string | |
| string (email) | ||
| plan | string | 活跃的个人 Domani 计划密钥 |
| workspace_plans | string[] | 用户可以访问的工作区上的不同活动 Mailzero 计划密钥 |
| has_payment_method | boolean | 用户是否有备案卡(购买域名前需要) |
| preferred_payment_method | string | null | |
| preferred_locale | string | Domani 界面和事务通信使用的区域设置 |
| has_contact | boolean | 用户是否已设置 WHOIS 联系信息。购买时为可选 (在设置之前,由 Domani 的联系人代表用户持有新域名),转入域名之前为必填。 |
| contact | RegistrantContact | 注册人联系信息(如果未设置则为空) |
| referral_code | string | 您独特的推荐代码 |
| referral_rate | integer | 推荐购买的佣金百分比 |
| balance | number | 以美元计的市场信用余额(从销售中赚取) |
| domain_count | integer | 拥有的域名数量 |
| token_count | integer | 活跃 API 令牌数量 |
| features | string[] | 为此帐户启用的功能标志(GA 功能加上授予该用户的预览功能),例如 mailzero_assistant |
| can_manage_assistant | boolean | 调用令牌是否具有 assistant:read 范围。独立于 `features`:功能标志表示该帐户有资格使用助手,而这表示此特定令牌(完全访问权限,或范围 CLI/OAuth/委托令牌)是否可以读取或更改其设置。 |
| is_admin | boolean | |
| mailbox_entitlement | object | 账户个人工作区中的自定义域名邮箱容量。它有自己的套餐,而不是上面的 `plan`:工作区可以拥有自己的 Mailzero 订阅,而用户本人的套餐仍为免费。 |
| created_at | string (date-time) |
响应示例
{
"id": "cm5abc123",
"email": "dev@example.com",
"plan": "agent",
"workspace_plans": [
"mail_pro"
],
"has_payment_method": true,
"has_contact": true,
"referral_code": "x7k9m2",
"referral_rate": 20,
"domain_count": 3,
"token_count": 2,
"created_at": "2025-01-15T10:30:00.000Z"
}示例
curl https://domani.run/api/me \ -H "Authorization: Bearer domani_sk_xxx"
/api/me更新帐户偏好设置
更新经过身份验证的用户的首选付款方式和/或 BCP 47 区域设置。 API 响应保持结构化且不进行翻译。
请求正文
| preferred_payment_method | string | null(card | usdc) | 购买时的默认付款方式(card、usdc,自动选择时为 null) |
| preferred_locale | string(en | fr | es | pt-BR | ja | zh-Hans | it) | Domani 界面和事务通信使用的区域设置 |
回应 200
| preferred_payment_method | string | null | |
| preferred_locale | string | |
| hint | string |
/api/me删除帐户(在持有域名时被阻止)
永久删除经过身份验证的用户的帐户、令牌、Webhooks、邮箱和其他应用程序数据。注册的域不会随帐户一起删除:请求失败并显示 409 HAS_DOMAINS,直到每个域都转出。此操作无法撤消。
回应 200
| deleted | boolean | |
| hint | string |
/api/me/activation获取真实的激活状态和建议的下一步操作
返回服务器派生的产品里程碑和功能感知的下一步操作。令牌创建、令牌使用、页面浏览量和客户端清单状态均被故意排除。
回应 200
| version | integer | |
| account_created_at | string (date-time) | |
| entry | object | |
| milestones | object | |
| status | string | |
| recommended_actions | object[] | |
| available_paths | string[] | |
| dismissed_version | integer | |
| pending_claim | object | null |
示例
curl https://domani.run/api/me/activation \ -H "Authorization: Bearer domani_sk_xxx"
/api/me/activation取消或恢复首轮指导
仅存储呈现首选项。它无法完成产品里程碑。
请求正文
| dismissed_version* | integer |
回应 200
| dismissed_version | integer | |
| hint | string |
/api/me/contact获取注册者联系信息
返回已认证用户的 WHOIS 注册人联系信息。购买时为可选 (在设置之前,由 Domani 的联系人代表用户持有新域名),转入域名之前为必填。
回应 200
| has_contact | boolean | |
| contact | RegistrantContact |
响应示例
{
"has_contact": true,
"contact": {
"first_name": "Jane",
"last_name": "Doe",
"address1": "123 Main St",
"city": "New York",
"state": "NY",
"postal_code": "10001",
"country": "US",
"phone": "+1.2125551234",
"email": "jane@example.com"
}
}示例
curl https://domani.run/api/me/contact \ -H "Authorization: Bearer domani_sk_xxx"
/api/me/contact设置注册者联系信息
设置或更新你的 WHOIS 注册人联系信息。购买时为可选,转入域名之前为必填。它会成为你的域名的注册人和账单联系人:在设置之前,由 Domani 的联系人代表你持有这些域名。更新后,新的联系信息会推送到支持联系人变更的注册商处你的所有有效域名,使你成为这些域名的注册人;注册商可能会发邮件请你在 15 天内确认。
回应 200
| contact | RegistrantContact |
示例
curl -X PUT https://domani.run/api/me/contact \
-H "Authorization: Bearer domani_sk_xxx" \
-H "Content-Type: application/json" \
-d '{"first_name":"Jane","last_name":"Doe","address1":"123 Main St","city":"New York","state":"NY","postal_code":"10001","country":"US","phone":"+1.2125551234","email":"jane@example.com"}'/api/me/resend-verification重新发送联系电子邮件验证
重新发送帐户联系电子邮件地址的验证电子邮件。每封电子邮件的频率限制为每 15 分钟一次。
请求正文
| string (email) | 用于验证的电子邮件地址(默认为帐户联系电子邮件) |
回应 200
| sent | boolean | |
| already_verified | boolean | |
| hint | string |
/api/sessions列出已登录的设备
已登录该账户的每个浏览器、移动应用和终端,调用方自己的会话排在最前 (current)。每次登录都会打开独立的会话,因此在新设备上登录绝不会让其他设备退出。位置是设备登录时所在的地点(根据其 IP 得出的国家和城市),未知时省略。API 密钥不是会话:请使用 GET /api/tokens 列出。
回应 200
| sessions | object[] | |
| hint | string |
响应示例
{
"sessions": [
{
"id": "cm5ses123",
"current": true,
"kind": "web",
"product": "domani",
"device": {
"type": "desktop",
"os": "macOS",
"browser": "Chrome"
},
"location": {
"country": "FR",
"city": "Paris"
},
"signed_in_at": "2026-10-01T10:00:00.000Z",
"last_active_at": "2026-10-18T09:12:00.000Z"
},
{
"id": "cm5ses456",
"current": false,
"kind": "mobile",
"product": null,
"device": {
"type": "mobile",
"os": "iOS",
"browser": null
},
"location": {
"country": "FR",
"city": "Lyon"
},
"signed_in_at": "2026-09-20T18:30:00.000Z",
"last_active_at": "2026-10-17T21:04:00.000Z"
}
],
"hint": "Sign a device out with DELETE /api/sessions/{id}, or every device but this one with DELETE /api/sessions."
}示例
curl https://domani.run/api/sessions \ -H "Authorization: Bearer domani_sk_xxx"
/api/sessions让其他所有设备退出登录
让账户中除发起请求的会话以外的所有会话退出登录。这些设备在下一次请求时需要重新登录。API 密钥保持不变。
回应 200
| revoked | integer | |
| hint | string |
响应示例
{
"revoked": 2,
"hint": "Every other device is signed out. API keys are unchanged."
}示例
curl -X DELETE https://domani.run/api/sessions \ -H "Authorization: Bearer domani_sk_xxx"
/api/sessions/{id}让设备退出登录
让一个会话退出登录。current 指发起请求的会话(自己退出无需任何范围);其他任何会话都需要 tokens:write。
参数
| id* | string | 会话 ID(来自 GET /api/sessions),或 `current` |
回应 200
| success | boolean | |
| current | boolean | 调用方自己退出登录时为 true:其密钥不再有效 |
| hint | string |
响应示例
{
"success": true,
"current": false,
"hint": "That device is signed out and will be asked to sign in again."
}示例
curl -X DELETE https://domani.run/api/sessions/cm5ses456 \ -H "Authorization: Bearer domani_sk_xxx"
API令牌
/api/agents/identity/{slug}/tokens列出智能体身份的 API 令牌
绑定到此智能体身份的令牌(掩码密钥、作用域、邮箱限制、最后使用时间)。智能体绑定令牌是该智能体对每个 assistant 和邮件界面的视图。
参数
| slug* | string | 智能体身份句柄。 |
/api/agents/identity/{slug}/tokens一次调用为智能体提供其自己的 API 密钥
创建绑定到此智能体身份的令牌,限制在智能体操作的邮箱内,具有智能体所需的最小作用域(assistant:read、assistant:write、email:read、email:write)。使用该密钥,智能体只能读取自己的 Today、其邮箱和交给它的项目;命名另一个智能体会返回 403,仅限所有者的路由(设置、回填、导出)会拒绝它。完整密钥仅在此响应中返回。需要 tokens:write。不运营任何邮箱的智能体默认不会获得邮件范围,请求这些范围会返回 400 AGENT_MAILBOXES_REQUIRED:没有邮箱的密钥将能访问该帐户的所有邮箱。
参数
| slug* | string | 智能体身份句柄。 |
请求正文
| name | string | 默认为 '<<slug>> agent'。 |
| scopes | string[] | 默认为 assistant:read、assistant:write、email:read、email:write。不能超过调用者自己的作用域。 |
| mailboxes | string[] | 令牌限制的邮箱地址。默认为智能体操作的邮箱。 |
| expires_in | integer | 到期前的秒数(最多一年)。 |
回应 201
| success | boolean | |
| token | object | |
| agent | object | |
| hint | string |
示例
curl -X POST https://domani.run/api/agents/identity/dave/tokens \
-H "Authorization: Bearer domani_sk_xxx" \
-H "Content-Type: application/json" \
-d '{"name": "Dave on the laptop"}'/api/agents/identity/{slug}/tokens/{id}撤销智能体的 API 令牌
撤销绑定到此智能体身份的令牌。它会立即停止工作。需要 tokens:write。
参数
| slug* | string | |
| id* | string |
回应 200
| success | boolean | |
| hint | string |
/api/tokens列出您的 API 令牌
返回经过身份验证的用户的所有 API 令牌。为了安全起见,密钥被屏蔽(前 12 个 + 后 4 个字符可见)。使用它来审核活动令牌。
回应 200
| tokens | TokenInfo[] |
响应示例
{
"tokens": [
{
"id": "cm5abc123",
"name": "Default",
"key": "domani_sk_a...wxyz",
"lastUsed": "2025-02-18T10:30:00.000Z",
"expiresAt": null,
"expired": false,
"scopes": [
"*"
],
"createdAt": "2025-01-15T10:30:00.000Z",
"max_per_tx": null,
"max_per_month": null,
"spent_this_month": 0,
"parent_token_id": null,
"agent_identity": null
},
{
"id": "cm5def456",
"name": "CI/CD",
"key": "domani_sk_b...vwxy",
"lastUsed": null,
"expiresAt": "2025-05-01T14:00:00.000Z",
"expired": false,
"scopes": [
"domains:read",
"domains:write"
],
"createdAt": "2025-02-01T14:00:00.000Z"
}
]
}示例
curl https://domani.run/api/tokens \ -H "Authorization: Bearer domani_sk_xxx"
/api/tokens创建新的 API 令牌
创建一个新的 API 令牌。仅在此响应中返回完整密钥 - 安全地存储它。您可以创建多个令牌来分隔不同应用程序的访问。
请求正文
| name | string | 用于识别此令牌的人类可读名称 |
| expires_in | integer | 令牌生命周期(以秒为单位)(最小值 3600 = 1 小时,最大值 31536000 = 1 年)。省略则不会过期。 |
| expires_at | string (date-time) | 绝对有效期 (ISO 8601)。 expires_in 的替代方案。 |
| scopes | string[] | 此令牌的权限范围。使用 ['*'] 获得完全访问权限(默认)。令牌只能授予其已拥有的范围(范围衰减)。范围:domains:read (GET /api/domains, GET /api/domains/{domain}, GET /api/domains/{domain}/dns, /dnssec, /status, /email/check, /auth-code, /transfer-away, /transfer-status, /analytics)、domains:write (PUT /api/domains/{domain}/dns, POST/DELETE /api/domains/{domain}/dnssec, POST /connect, POST /verify, PUT /settings, PUT /parking, PUT/DELETE /api/domains/{domain}/for-sale, POST /api/domains/import, POST /import/verify)、domains:transfer (POST /api/domains/buy, POST /transfer, POST /renew (涉及付款,包括市场购买))、tokens:read (GET /api/tokens)、tokens:write (POST /api/tokens, DELETE /api/tokens/{id})、webhooks:read (GET /api/webhooks, GET /api/webhooks/{id}/deliveries)、webhooks:write (POST /api/webhooks, PATCH /api/webhooks/{id}, DELETE /api/webhooks/{id})、email:read (GET /api/emails, /api/emails/{address}, /api/emails/{address}/messages, /api/emails/{address}/aliases, /api/email/changes, /api/domains/{domain}/email/status, /api/domains/{domain}/email/deliverability, /api/suppressions, GET /api/contacts)、email:write (POST /api/emails, POST /api/emails/{address}/send, POST /api/domains/{domain}/email/setup, aliases + catch-all, POST/DELETE /api/suppressions, POST/DELETE /api/contacts)、email:delete (永久删除已在垃圾箱中的邮件。将邮件移至垃圾箱仅需要 email:write。仅将此范围授予允许不可逆地删除电子邮件内容的智能体)、email:manage_mailboxes (创建邮箱 (POST /api/emails),仅此而已。这是一个狭窄的管理范围,供可以为新项目创建地址 (partners@, launch@) 但无法读取或发送邮件、管理域名或触碰令牌的智能体使用)、email:auth_secrets (读取被分类为身份验证邮件的邮件 (OTP / 验证码、密码重置、魔术链接)。没有它,email:read 仍会列出这些邮件,但主题和正文会以隐藏形式返回 - 因此被盗的智能体令牌无法收集 2FA 验证码。仅将其授予确实需要完成登录的智能体)、account:read (GET /api/me, GET /api/agents/identity)、account:write (DELETE /api/me, POST /api/billing/setup, POST /api/billing/subscribe, POST /api/billing/cancel, POST /api/me/resend-verification, POST/PATCH/DELETE /api/agents/identity)、billing:read (GET /api/billing/invoices)、search (GET /api/domains/search, /suggest, /whois, /dns-check, GET /api/tlds)、deals:read (GET /api/deals, GET /api/deals/{id})、deals:write (POST /api/domains/sell, PATCH /api/deals/{id})、notifications:read (GET /api/notifications, GET /api/notifications/count)、backorders:read (GET /api/backorders, GET /api/backorders/{id})、backorders:write (POST /api/backorders, DELETE /api/backorders/{id})、assistant:read (读取 Mailzero 助手设置、Today 队列、Work 项目、精确操作预览、历史导入进度和内容最小化的 Activity)、assistant:write (更改 Mailzero 助手设置、记录同意并启动历史导入、记录对 Work 项目的人工 Decisions、重试导入以及导出或删除派生助手数据。从不发送邮件)。 |
| max_per_tx | number | 每笔交易的美元支出上限。任何高于此值的单次收费都会失败,并返回 403 SPEND_CAP_EXCEEDED。令牌只能授予等于或低于其自身的上限(否则为 CAP_ESCALATION)。 |
| max_per_month | number | 使用此令牌进行的所有付费操作的滚动日历月支出上限(美元)。 |
| agent_identity_id | string | 此帐户拥有的智能体身份的可选 ID。使用令牌进行的邮件操作归因于该智能体。 |
| http_route_policy | object | 具有 http-routes:read 或 http-routes:write 的范围令牌所需的结构化权限。 |
| mailboxes | string[] | 将令牌限定到这些邮箱地址(slug@domain)。受限定的令牌只能查看并操作这些邮箱;受限定的调用者只能委派其自身邮箱的子集(否则返回 400 MAILBOX_ESCALATION)。 |
回应 201
| id | string | |
| name | string | |
| key | string | 完整的 API 密钥 - 保存它,它不会再次显示 |
| expiresAt | string (date-time) | null | 当此令牌过期时(null = 从不) |
| scopes | string[] | 授予该令牌的权限范围 |
| createdAt | string (date-time) | |
| max_per_tx | number | null | 每笔交易支出上限(以美元为单位)(空=无上限) |
| max_per_month | number | null | 每月支出上限(美元)(空=无上限) |
| mailbox_ids | string[] | 此令牌被限定到的邮箱 ID |
| http_route_policy | HttpRoutePolicy | |
| agent_identity | object | null |
响应示例
{
"id": "cm5ghi789",
"name": "CI/CD Pipeline",
"key": "domani_sk_x1Y2z3A4b5C6d7E8f9G0hIjK",
"expiresAt": "2025-03-20T10:30:00.000Z",
"scopes": [
"domains:read",
"domains:write"
],
"createdAt": "2025-02-18T10:30:00.000Z",
"max_per_tx": 25,
"max_per_month": 100,
"mailbox_ids": [],
"http_route_policy": null
}示例
curl -X POST https://domani.run/api/tokens \
-H "Authorization: Bearer domani_sk_xxx" \
-H "Content-Type: application/json" \
-d '{"name": "CI/CD Pipeline"}'/api/tokens/{id}撤销 API 令牌
永久撤销 API 令牌。任何使用此令牌的应用程序将立即失去访问权限。此操作无法撤消。
参数
| id* | string | 令牌 ID(来自 GET /api/tokens 响应) |
回应 200
| success | boolean |
响应示例
{
"success": true
}示例
curl -X DELETE https://domani.run/api/tokens/cm5abc123 \ -H "Authorization: Bearer domani_sk_xxx"
/api/audit列出安全审核事件
按从新到旧返回账户安全审计记录,包括令牌生命周期(创建、撤销、提权尝试)、支出上限和 max_price 拒绝、扣款、付款请求以及被阻止的账户删除。可用于监控智能体令牌的行为。
参数
| limit | integer | 每页事件数 |
| cursor | string | 分页光标(上一页的 next_cursor) |
| type | string | 按事件类型过滤(例如 token.created、purchase.charged、purchase.denied_cap) |
回应 200
| events | object[] | |
| next_cursor | string | null | |
| hint | string |
响应示例
{
"events": [
{
"id": "evt1",
"tokenId": "cm5abc123",
"type": "purchase.charged",
"targetType": "domain",
"targetId": "mysite.com",
"metadata": {
"amountCents": 1450,
"operation": "buy",
"method": "card"
},
"createdAt": "2026-07-11T10:00:00.000Z"
},
{
"id": "evt2",
"tokenId": "cm5abc123",
"type": "purchase.denied_cap",
"targetType": "domain",
"targetId": "expensive.ai",
"metadata": {
"amountCents": 8470
},
"createdAt": "2026-07-11T09:58:00.000Z"
}
],
"next_cursor": null,
"hint": "Security-relevant events for this account."
}示例
curl "https://domani.run/api/audit?limit=50" \ -H "Authorization: Bearer domani_sk_xxx"
Webhooks
/api/webhooks列出网络钩子
列出为您的帐户配置的所有 Webhook 端点。返回每个 Webhook 的 URL、订阅事件和活动状态。秘密在创建后永远不会返回。受邮箱限定的令牌只能看到限定在其自身邮箱内的 Webhook。
回应 200
| webhooks | object[] | |
| hint | string |
响应示例
{
"webhooks": [
{
"id": "cm5wh001",
"url": "https://example.com/webhooks/domani",
"events": [
"domain.purchased",
"dns.updated"
],
"active": true,
"created_at": "2026-02-25T10:00:00.000Z"
}
],
"hint": "1 webhook(s)."
}示例
curl https://domani.run/api/webhooks \ -H "Authorization: Bearer domani_sk_xxx"
/api/webhooks创建网络钩子
注册新的 HTTPS Webhook 端点。可选的授权或 X-API-Key 值静态加密并包含在每次投递中。签名秘密仅返回一次。每个帐户最多 5 个 Webhook。由受邮箱限定的令牌创建的 Webhook 会被限定在相同的邮箱内:它不会收到任何其他邮箱的邮件事件。
请求正文
| url* | string (uri) | 将接收 webhook POST 请求的 HTTPS URL |
| events* | string[] | 要订阅的事件类型。使用 GET /api/webhooks/events 列出可用类型。 |
| headers | object | 可选的加密身份验证标头。仅接受授权和 X-API-Key。 |
回应 200
| id | string | |
| url | string (uri) | |
| events | string[] | |
| secret | string | HMAC-SHA256 签名秘密(显示一次) |
| active | boolean | |
| header_names | string[] | 配置的 auth 标头名称;值永远不会返回 |
| created_at | string (date-time) | |
| hint | string |
响应示例
{
"id": "cm5wh001",
"url": "https://example.com/webhooks/domani",
"events": [
"domain.purchased",
"dns.updated"
],
"secret": "whsec_aBcDeFgHiJkLmNoPqRsTuVwXyZ012345",
"active": true,
"created_at": "2026-02-25T10:00:00.000Z",
"hint": "Webhook created. Save the secret - it won't be shown again. Use it to verify incoming payloads with HMAC-SHA256."
}示例
curl -X POST https://domani.run/api/webhooks \
-H "Authorization: Bearer domani_sk_xxx" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/hook","events":["domain.purchased","dns.updated"],"headers":{"Authorization":"Bearer sender_key_xxx"}}'/api/webhooks/{id}更新网络钩子
更新 Webhook 的 URL、订阅事件、活动状态或加密的身份验证标头。仅发送您要更改的字段。受邮箱限定的令牌只能访问限定在其自身邮箱内的 Webhook(否则返回 404)。
参数
| id* | string | 网络钩子 ID |
请求正文
| url | string (uri) | 新的 HTTPS 网址 |
| events | string[] | 新的事件类型列表 |
| active | boolean | 设置 false 暂停,设置 true 恢复 |
| headers | object | 替换加密的身份验证标头;发送 {} 进行清除。仅接受授权和 X-API-Key。 |
回应 200
| id | string | |
| url | string (uri) | |
| events | string[] | |
| active | boolean | |
| header_names | string[] | 配置的 auth 标头名称;值永远不会返回 |
| hint | string |
/api/webhooks/{id}删除网络钩子
删除 Webhook 端点。所有待处理的投递都将被取消。此操作无法撤消。受邮箱限定的令牌只能访问限定在其自身邮箱内的 Webhook(否则返回 404)。
参数
| id* | string | 网络钩子 ID |
回应 200
| success | boolean | |
| hint | string |
/api/webhooks/{id}/deliveries列出 webhook 投递
获取 Webhook 最近的投递尝试。显示事件类型、HTTP 状态、尝试次数和任何错误。对于调试失败的投递很有用。受邮箱限定的令牌只能访问限定在其自身邮箱内的 Webhook(否则返回 404)。
参数
| id* | string | 网络钩子 ID |
| limit | integer | 返回的最大投递记录数 |
回应 200
| deliveries | object[] | |
| hint | string |
响应示例
{
"deliveries": [
{
"id": "cm5del001",
"replay_of_id": null,
"event_type": "domain.purchased",
"status": "delivered",
"http_status": 200,
"attempts": 1,
"last_error": null,
"created_at": "2026-02-25T10:05:00.000Z"
}
],
"hint": "1 delivery(ies) for this webhook."
}/api/webhooks/{id}/deliveries/{deliveryId}/replay重播 webhook 投递
克隆并立即重新传递不可变的 Webhook 事件。事件负载和事件 ID 保持相同; HMAC 签名收到新的时间戳。所需的幂等性密钥可保证调用者重试不会发送两次。受邮箱限定的令牌只能访问限定在其自身邮箱内的 Webhook(否则返回 404)。相同负载有一个例外:从身份验证邮件复制的主题会以隐藏形式发送,因为 Webhook 的 URL 可能自首次投递以来已经更改。
参数
| id* | string | 网络钩子 ID |
| deliveryId* | string | 原始投递 ID |
请求正文
| idempotency_key* | string |
回应 200
| delivery_id | string | |
| original_delivery_id | string | |
| event_type | string | |
| status | string | |
| http_status | integer | null | |
| attempts | integer | |
| idempotency_key | string | |
| idempotent_replay | boolean | |
| created_at | string (date-time) | |
| hint | string |
/api/webhooks/events列出 Webhook 事件类型
列出所有可用的 Webhook 事件类型及其说明。无需身份验证。
回应 200
| events | object[] |
响应示例
{
"events": [
{
"type": "domain.purchased",
"description": "A new domain was successfully registered"
},
{
"type": "dns.updated",
"description": "DNS records were changed for a domain"
},
{
"type": "transfer.completed",
"description": "A domain transfer completed successfully"
}
]
}示例
curl https://domani.run/api/webhooks/events
通知
/api/notifications列出通知
使用基于光标的分页列出您的应用内通知。包括交易事件、挂牌更新和系统警报。 需要notifications:read范围。 在邮件主题于写入时隐藏之前写下的通知,对于没有 email:auth_secrets 的令牌,其 body 和 data.subject 中身份验证邮件的主题会以隐藏形式读取。
参数
| limit | integer | 返回的最大通知数 |
| cursor | string | 分页光标(来自先前响应的 next_cursor) |
回应 200
| notifications | object[] | |
| has_more | boolean | |
| next_cursor | string | null |
/api/notifications/count获取未读通知数
用于轮询未读通知计数的轻量级端点。 需要notifications:read范围。
回应 200
| unread_count | integer |
响应示例
{
"unread_count": 3
}/api/notifications/{id}将通知标记为已读
将单个通知标记为已读。 需要notifications:read范围。
参数
| id* | string | 通知ID |
请求正文
| read* | boolean | 设置为 true 以标记为已读 |
回应 200
| ok | boolean |
/api/notifications/read-all将所有通知标记为已读
将所有未读通知标记为已读。 需要notifications:read范围。
回应 200
| ok | boolean | |
| count | integer | 标记为已读的通知数量 |
/api/notifications/preferences获取通知首选项
返回用户对每个类别和渠道(in_app、email)的通知偏好。缺少的偏好默认启用。 需要 notifications:read 范围。
回应 200
| preferences | object[] | |
| expiry_alert_days | integer[] | 到期前天,用户会收到续订提醒(默认为 30/7/1)。空=没有到期提醒。 |
/api/notifications/preferences更新通知首选项
更新特定类别和渠道的通知首选项。 需要notifications:read范围。
请求正文
| preferences | object[] | |
| expiry_alert_days | integer[] | 到期前几天接收续订提醒。空数组=没有到期提醒。 |
回应 200
| ok | boolean |
顶级域名
/api/tlds公共列出 Domani 销售的 TLD 及其定价
返回 Domani 销售的 TLD,包括注册、续订和转移定价。这是我们注册商的目录,并非所有现存的 TLD:部分根区 TLD(如 gov 或 edu)无法通过 Domani 注册。每个条目都有一个 kind:tld(IANA 根区中的 TLD)、second_level(其下提供的名称,如 co.uk)或 alt_root(根区之外的名称,在公共 DNS 中无法解析)。除非 kind 参数请求,否则不返回 alt_root 条目。支持按价格范围过滤、按TLD名称搜索、排序以及通过limit/offset分页。分页时,包含带有下一页 URL 的Link标头。 公共端点 - 无需身份验证。经过身份验证的请求获得更高的速率限制(60/分钟 vs 30/分钟)。
参数
| max_price | number | 最高注册价格(美元) |
| min_price | number | 最低注册价格(美元) |
| sort | string(tld | price | renewal) | 排序字段 -“tld”(按字母顺序)、“price”(注册)或“renewal” |
| order | string(asc | desc) | 排序顺序 |
| search | string | 过滤包含此字符串的 TLD 名称 |
| limit | integer | 每页最大结果数 |
| offset | integer | 要跳过的结果数 |
| kind | string | 要返回的类型,以逗号分隔:`tld`、`second_level`、`alt_root`。默认值:`tld,second_level`,即在公共 DNS 中可以解析的条目。`alt_root` 条目(位于 IANA 根区之外)仅在明确请求时返回。 |
回应 200
| tlds | TldInfo[] | |
| total | integer | 匹配 TLD 总数(分页前) |
| offset | integer | |
| limit | integer | null |
响应示例
{
"tlds": [
{
"tld": "xyz",
"registration": 4.04,
"renewal": 4.04,
"transfer": 4.04,
"kind": "tld"
},
{
"tld": "com",
"registration": 10.88,
"renewal": 13.08,
"transfer": 13.08,
"kind": "tld"
},
{
"tld": "co.uk",
"registration": 10.75,
"renewal": 10.75,
"transfer": 10.75,
"kind": "second_level"
}
],
"total": 743,
"offset": 0,
"limit": null
}示例
curl https://domani.run/api/tlds?max_price=10&sort=price
域名搜索
/api/domains/search公共检查域名的可用性和定价
通过 RDAP + 零售定价检查一个或多个域的可用性和定价。RDAP 认为未注册的名称随后会向注册商确认:注册局的高级名称或保留名称会返回 available: false,并附带 registry_status 和 reason。使用q表示单个域(返回平面对象)或使用domains表示多个域(返回数组)。通过 Accept: text/event-stream 标头支持 SSE 流 - 关闭连接会取消服务器端所有正在进行的 RDAP 查找。每个请求最多 200 个域。 公共端点 - 无需身份验证。经过身份验证的请求获得更高的速率限制(60/分钟 vs 20/分钟)。
参数
| q | string | 包括 TLD(简写 - 返回平面对象)的单一域。与`domains`互斥。 |
| domains | string | 要检查的完整域名的逗号分隔列表(最多 200 个)。返回数组结果。 |
| max_price | number | 仅包含低于此价格(美元)的域名 |
| sort | string(price | tld) | 按价格或 TLD 名称对结果进行排序 |
| source | string(all | primary | secondary) | 按来源过滤结果:“primary”(仅限注册商可用性)、“secondary”(仅限 Domani 市场挂牌)或“all”(两者) |
| order | string(asc | desc) |
回应 200
| available | boolean | 该域名是否可以注册 |
| domain | string | 包含 TLD 的完整域名 |
| price | number | 指定货币的注册价格 |
| currency | string | ISO 4217 货币代码(始终为 USD) |
| error | boolean | 如果 RDAP 查找失败则为 true(可用性未知) |
| for_sale | object | 当域名挂牌出售时出现(在 Domani 市场上或在外部二级市场上检测到) |
| tld_kind | string | 域名后缀的根区类型:`tld`、`second_level` 或 `alt_root`。`alt_root` 域名位于 IANA 根区之外,在公共 DNS 中无法解析:不会对其进行检查,`reason` 会说明原因。 |
| registry_status | string | 当注册局保留了 RDAP 认为未注册的名称时设置:`premium`(注册局自行定价,参见 `registry_price`)或 `reserved`(无法注册)。此类结果为 `available: false`,因为 `POST /api/domains/buy` 无法注册它,`reason` 会说明原因。 |
| registry_price | number | 当注册商给出报价时出现在 `premium` 结果中:注册局设定的首年价格(USD)。`price` 仍为该 TLD 的标准价格,不适用于此名称。 |
| renewal_price | number | 在将注册该名称的注册商处,第一年之后每年的费用(USD),即续订时收取的金额。未知时不返回。对于 `premium` 结果,它与 `price` 一样是该 TLD 的标准价格。 |
| reason | string | 未提供该域名的原因:名称不在公共 DNS 中(`tld_kind` `alt_root`),或被注册局保留(`registry_status`)。 |
示例
curl "https://domani.run/api/domains/search?q=mysite.com"
/api/domains/suggest公共人工智能驱动的域名建议和可用性
给定项目描述,生成具有创意 TLD 的完整域名(例如 codebuddy.dev、wavify.fm),检查可用性,并仅返回带有定价的可用域。使用代理循环重试,直到找到足够的可用域。通过Accept: text/event-stream支持 SSE 流 - 关闭连接会取消正在进行的 LLM 生成和服务器端 RDAP 查找。 公共端点 - 无需身份验证。
参数
| prompt* | string | 项目描述或用于生成域建议的关键字(至少 3 个字符) |
| count | integer | 要返回的可用域数(默认 10) |
| exclude | string | 要从建议中排除的以逗号分隔的域列表(例如,从上一批) |
| tlds | string | 以逗号分隔的首选 TLD(不带点)。结果将强烈支持这些 TLD。 |
| style | string(single | creative | short | brandable | keyword) | 名称风格偏好:“single”(一个词)、“creative”(唤起性/隐喻性)、“short”(3-6 个字符)、“brandable”(发明)、“keyword”(描述性)。 |
| lang | string(japanese | spanish | french | italian | latin | nordic | arabic | sanskrit) | 名字的语言/文化灵感。名称将取自该语言的文字、美学和文化。 |
回应 200
| suggestions | object[] | 可用域名及定价 |
| checked | integer | 检查的域总数 |
| iterations | integer | LLM轮数 |
响应示例
{
"suggestions": [
{
"domain": "codebuddy.dev",
"price": 13,
"currency": "USD",
"renewal_price": 13
},
{
"domain": "aiforge.sh",
"price": 33,
"currency": "USD"
},
{
"domain": "devcraft.app",
"price": 13,
"currency": "USD"
}
],
"checked": 42,
"iterations": 2
}示例
curl "https://domani.run/api/domains/suggest?prompt=AI+coding+assistant"
/api/domains/dns-check公共基于 DNS 的快速域存在检查
测试是否使用 DNS 查询同时在多个 TLD 中获取域名(比搜索更快,无定价)。返回“taken”(明确注册)和“candidates”(可能可用)数组。在调用搜索定价之前,请使用此功能来缩小范围。 公共端点 - 无需身份验证。
参数
| name* | string | 没有 TLD 的域名,例如'myapp' |
| tlds* | string | 要检查的以逗号分隔的 TLD,例如'com,dev,ai,io' |
回应 200
| name | string | |
| taken | string[] | 已明确注册的 TLD |
| candidates | string[] | 可能可用的 TLD |
域名
/api/domains列出您所有注册的域名
返回经过身份验证的用户拥有的所有域,按购买日期排序(最新的在前)。包括域名、状态、购买日期和到期日期。
回应 200
| domains | DomainRecord[] |
响应示例
{
"domains": [
{
"domain": "mysite.com",
"status": "active",
"purchasedAt": "2025-01-15T10:30:00.000Z",
"expiresAt": "2026-01-15T10:30:00.000Z",
"emailEnabled": true,
"emailVerified": true,
"emailVerifiedAt": "2025-01-15T10:35:00.000Z",
"mailboxCount": 2
},
{
"domain": "myapp.dev",
"status": "active",
"purchasedAt": "2025-02-01T14:00:00.000Z",
"expiresAt": "2026-02-01T14:00:00.000Z",
"emailEnabled": false,
"emailVerified": false,
"emailVerifiedAt": null,
"mailboxCount": 0
}
]
}示例
curl https://domani.run/api/domains \ -H "Authorization: Bearer domani_sk_xxx"
/api/agents/identity申请自由智能体身份 (<handle>.domani.run)
为智能体提供<slug>.domani.run的免费身份 - 实时个人资料页面,无需立即购买域名。无摩擦的启动方式;稍后升级到真正拥有的域名。需要account:write。
请求正文
| slug* | string | 句柄 - 变为 <slug>.domani.run |
| name | string | 显示名称 |
| bio | string | |
| emoji | string | 阿凡达表情符号 |
| string (email) | 公共联系方式(例如您的免费@domani.run收件箱) | |
| links | object[] |
回应 200
| id | string | 用于绑定作用域 API 令牌的稳定身份 ID |
| slug | string | |
| url | string | 身份子域(规范) |
| page_url | string | 始终有效的路径后备 |
| name | string | null | |
| bio | string | null | |
| emoji | string | null | |
| string | null | ||
| links | object[] | |
| views | integer | |
| created_at | string (date-time) |
响应示例
{
"success": true,
"id": "agent_abc123",
"slug": "myagent",
"url": "https://myagent.domani.run",
"page_url": "https://domani.run/agents/myagent",
"name": "My Agent",
"bio": "I broker domains.",
"emoji": "🤖",
"email": null,
"links": [],
"views": 0,
"created_at": "2026-07-11T00:00:00.000Z"
}示例
curl -X POST https://domani.run/api/agents/identity \
-H "Authorization: Bearer domani_sk_xxx" \
-H "Content-Type: application/json" \
-d '{"slug": "myagent", "name": "My Agent", "bio": "I broker domains.", "emoji": "🤖"}'/api/agents/identity列出您的智能体身份
列出您已声明的免费身份 (<handle>.domani.run)。需要account:read。
回应 200
| identities | AgentIdentity[] |
/api/agents/identity/{slug}更新智能体身份
更新免费身份的 name/bio/emoji/email/links 字段。需要 account:write。
参数
| slug* | string | 要更新的句柄 |
请求正文
| name | string | |
| bio | string | |
| emoji | string | |
| string | ||
| links | object[] |
回应 200
| id | string | 用于绑定作用域 API 令牌的稳定身份 ID |
| slug | string | |
| url | string | 身份子域(规范) |
| page_url | string | 始终有效的路径后备 |
| name | string | null | |
| bio | string | null | |
| emoji | string | null | |
| string | null | ||
| links | object[] | |
| views | integer | |
| created_at | string (date-time) |
/api/agents/identity/{slug}释放智能体身份
释放一个免费的身份句柄,以便它再次可用。需要account:write。
参数
| slug* | string | 释放手柄 |
回应 200
| success | boolean | |
| slug | string | |
| released | boolean |
/api/agents/provision在一次呼叫中提供完整的智能体身份
在单个请求中为 AI 智能体提供完整的互联网身份:购买域(如果尚未拥有)、设置电子邮件 DNS、创建邮箱,并可选择为入站电子邮件和域事件注册经过身份验证的 Webhook。 webhook_headers 仅接受 Authorization 和 X-API-Key;值在静态时被加密并且永远不会返回。重复相同的域、邮箱 slug 和 Webhook URL 会重复使用这些资源。 在购买域名或收费之前,每个 Webhook 输入都会经过验证。域名购买是唯一可以收费的步骤,也是唯一的硬性先决条件;如果失败,整个调用就会失败(付款402,如果被其他帐户占用则409)。电子邮件设置、邮箱创建和 Webhook 注册都是尽力而为:暂时性问题(例如 DNS 仍在传播)会在warnings中返回,而不是调用失败,因此智能体始终会获取其域。 付款方式与 POST /api/domains/buy 完全相同(卡、市场余额或通过PAYMENT-SIGNATURE标头/两步流程的 USDC)。
请求正文
| domain* | string | 给予智能体的域名。如果尚未拥有,则已购买。 |
| slug | string | 邮箱本地部分(hi@domain)。默认值为 'hi'。 |
| name | string | 出站电子邮件的显示名称。 |
| webhook_url | string (uri) | 用于接收入站电子邮件 + 域事件的可选 HTTPS URL。 |
| webhook_headers | object | 可选的投递身份验证。值在静态时加密且永不返回;响应仅公开 header_names。 |
| webhook_events | string[] | Webhook 事件类型。默认为 email.received/delivered/bounced。 |
| payment_method | string(card | usdc | balance) | 如何支付域名费用。 |
| payment_tx | string | USDC tx 哈希(两步流程)。 |
| payment_chain | string(base | ethereum) | |
| years | integer | |
| max_price | number | 域名费用上限(美元)。如果实际价格超过它,请求会失败并返回 400 PRICE_ABOVE_MAX,且不收取任何费用。错误中的 `price` 字段是需要接受的总额;请先与用户确认,再以该 max_price 重试。 |
回应 200
| domain | string | |
| domain_status | string | |
| mailbox | object | null | |
| webhook | object | null | |
| warnings | string[] | |
| hint | string | |
| next_steps | string[] |
示例
curl -X POST https://domani.run/api/agents/provision \
-H "Authorization: Bearer domani_sk_xxx" \
-H "Content-Type: application/json" \
-d '{"domain":"myagent.run","slug":"hi","webhook_url":"https://my-agent.example.com/inbox","webhook_headers":{"Authorization":"Bearer sender-key"}}'/api/domains/buy购买一个或多个域名
购买一个或多个域名并立即注册。单个域名发送 {"domain": "..."},批量购买发送 {"domains": ["...", "..."]}(最多 10 个)。 如果域名在 Domani 市场上架,此端点会自动转为市场购买,而不是新注册。响应包含 years: 0 和 marketplace_purchase: true,用于与注册区分。市场购买仅支持单个域名。买家支付完整标价;卖家收到扣除平台佣金后的金额(默认 10%)。 批量购买会独立处理每个域名;某个失败不会阻止其他购买。响应包含 results(成功)、errors(失败)以及带计数的 summary。 支持三种付款方式: 1. 银行卡(默认):需要先通过 POST /api/billing/setup 添加银行卡。每个域名单独扣款。 2. USDC(两步):第一次不付款调用会返回 402,其中 payment_options.crypto 包含钱包地址、金额和链。在链上发送 USDC 后,在请求正文中使用 payment_tx 和 payment_chain 重试。 3. x402 USDC(原子):在 PAYMENT-SIGNATURE 标头中包含一笔在 Base 上签名的 USDC 付款。 批量购买需要已添加的银行卡(USDC 不支持多域名)。如果单个域名未提供付款,则返回 HTTP 402 和付款说明。
请求正文
| domain | string | 购买单个域名(例如 mysite.com) |
| domains | string[] | 要购买的域名数组(最多 10 个,需要存档卡) |
| payment_method | string(card | usdc | balance) | 付款方式:“card”(默认)、“usdc”(x402 - 首次调用返回 402 以及付款说明)或“balance”(使用市场信用)。 |
| payment_tx | string | USDC 付款的交易哈希值已发送到链上。在两步 USDC 流程的第二次调用时需要。 |
| payment_chain | string(base | ethereum) | 发送 USDC 付款的链(例如“base”或“ethereum”)。 |
| years | integer | 注册年数(1-10,默认 1)。价格乘以年数。 |
| max_price | number | 总扣费的上限(美元)。如果实际价格超过该值,请求会以 400 PRICE_ABOVE_MAX 失败且不收取任何费用,这是自主智能体的安全带。未提供 max_price 时,上限为搜索显示的价格:当只有更贵的注册商能注册该名称时,购买同样会失败。错误中的 `price` 是需要接受的总额,旁边附有 `listed_price` 和 `renewal_price`;请先与用户确认,再用该 max_price 重试。 |
| ref | string | 推荐代码(可选)- 推荐人赚取佣金 |
示例
curl -X POST https://domani.run/api/domains/buy \
-H "Authorization: Bearer domani_sk_xxx" \
-H "Content-Type: application/json" \
-d '{"domain": "mysite.com"}'/api/domains/{domain}获取有关您拥有的域的详细信息
返回有关域名的全面信息:状态、购买日期、到期日、付款方式、安全锁、WHOIS 隐私、自动续订状态和注册日期。如果扩展数据不可用,则registrar对象可以为null。
参数
| domain* | string | 您拥有的域名 |
回应 200
| domain | string | |
| status | string | |
| auto_renew | boolean | 是否启用自动续订 |
| purchased_at | string (date-time) | |
| expires_at | string (date-time) | |
| days_until_expiry | integer | 域名到期前的天数 |
| renewal_price | number | null | 在持有该域名的注册商处续订一年的费用(USD);续订 N 年的费用为其 N 倍。当 domani 无法续订该域名或价格未知时为 Null。 |
| payment_method | string | 域名的付费方式 |
| payment_tx | string | null | 链上交易哈希(USDC 支付) |
| registrant | string | 注册局登记的域名注册人。`customer`:您自己的联系信息(来自 set_contact)。`domani`:Domani 的默认联系人,在您通过 set_contact 添加自己的信息之前代您持有该域名,添加后您即成为注册人。`unknown`:尚未检查。无论哪种情况,WHOIS 隐私保护都会隐藏这些信息。 |
| transfer_out | object | 将域名转移到其他注册商的方式。`mode` `api`:get_auth_code 直接返回转移码。`manual`:注册商没有相应的 API,由 Domani 团队在 1 个工作日内手动获取。null:该域名不支持。 |
| registrar_status | string | 实时注册商数据是否已刷新或由外部管理 |
| registrar_checked_at | string (date-time) | 当尝试刷新注册商时 |
| registrar | object | null | 域名注册详细信息(如果不可用则为空) |
响应示例
{
"domain": "mysite.com",
"status": "active",
"auto_renew": true,
"purchased_at": "2025-06-01T12:00:00.000Z",
"expires_at": "2026-06-01T12:00:00.000Z",
"days_until_expiry": 365,
"payment_method": "card",
"registrant": "customer",
"transfer_out": {
"mode": "api",
"locked_until": null,
"request": null
},
"registrar_status": "connected",
"registrar_checked_at": "2025-06-01T12:00:00.000Z",
"registrar": {
"security_lock": true,
"whois_privacy": true,
"auto_renew": true,
"create_date": "2025-06-01T12:00:00Z",
"expire_date": "2026-06-01T12:00:00Z"
}
}示例
curl https://domani.run/api/domains/mysite.com \ -H "Authorization: Bearer domani_sk_xxx"
/api/domains/{domain}/settings更新域设置
更新您拥有的域的设置。支持auto_renew、whois_privacy和security_lock。必须至少提供一个字段。
参数
| domain* | string | 您拥有的域名 |
请求正文
| auto_renew | boolean | 是否启用该域名的自动续订 |
| whois_privacy | boolean | 是否启用WHOIS隐私保护 |
| security_lock | boolean | 是否锁定域名以防止转移 |
回应 200
| domain | string | |
| auto_renew | boolean | |
| whois_privacy | boolean | |
| security_lock | boolean | |
| hint | string |
示例
curl -X PUT https://domani.run/api/domains/mysite.com/settings \
-H "Authorization: Bearer domani_sk_xxx" \
-H "Content-Type: application/json" \
-d '{"auto_renew": false}'/api/domains/{domain}/parking更新停放设置
更新您拥有的域的停放和挂牌设置。启用/禁用停放页面并设置“待售”标价。启用停放后,域的访问者会看到品牌页面。设置挂牌价格后,访问者会看到带有联系表格的“待售”页面。
参数
| domain* | string | 域名 |
请求正文
| enabled | boolean | 是否启用停放页面 |
| listing_price | number | null | 销售价格以美元为单位,或为空以删除挂牌 |
回应 200
| domain | string | |
| parking_enabled | boolean | |
| listing_price | number | null | |
| hint | string |
/api/domains/{domain}/redirect将域转发到 URL
将您拥有的域名转发到另一个 URL(例如brand.com -> https://brand.dev) - 对于多 TLD 品牌很有用。该域名必须指向 domani 的名称服务器/停放 IP 才能提供重定向服务。默认为永久 (308) 或临时 (307)。需要 domains:write 范围。
参数
| domain* | string | 域名 |
请求正文
| url* | string | 要转发到的目标 URL(或裸域),例如https://brand.dev |
| permanent | boolean | true = 永久(308,默认),false = 临时(307) |
回应 200
| domain | string | |
| redirect_url | string | null | |
| permanent | boolean |
/api/domains/{domain}/redirect停止转发域名
删除域名的重定向,使其恢复到停放页面。需要 domains:write 范围。
参数
| domain* | string | 域名 |
回应 200
| domain | string | |
| redirect_url | string | null |
/api/domains/{domain}/for-sale挂牌出售域名
在 Domani 市场挂牌出售您拥有的域名。买家可以直接通过 API 购买。域名必须处于活动状态且尚未挂牌。 费用: Domani 对成交收取平台佣金(默认 10%)。卖家获得挂牌价减去佣金后的金额;买家支付完整挂牌价。 需要 domains:write 范围。
参数
| domain* | string | 待售域名 |
请求正文
| price* | number | 销售价格(美元) |
| description | string | 可选挂牌描述 |
回应 200
| listing | object | |
| hint | string |
响应示例
{
"listing": {
"id": "lst_abc123",
"domain": "example.com",
"price": 5000,
"currency": "USD",
"description": null,
"status": "active",
"created_at": "2026-03-14T12:00:00.000Z"
},
"hint": "example.com listed for sale at $5,000. Buyers can purchase it on the marketplace."
}/api/domains/{domain}/for-sale更新域名挂牌
更新活跃市场挂牌的价格和/或描述。必须至少提供一个字段。需要 domains:write 范围。
参数
| domain* | string | 活跃挂牌中的域名 |
请求正文
| price | number | 新售价(美元) |
| description | string | null | 新描述(空以清除) |
回应 200
| listing | object | |
| hint | string |
响应示例
{
"listing": {
"id": "lst_abc123",
"domain": "example.com",
"price": 7000,
"currency": "USD",
"description": "Premium domain",
"status": "active",
"created_at": "2026-03-14T12:00:00.000Z"
},
"hint": "Listing for example.com has been updated. New price: $7,000."
}/api/domains/{domain}/for-sale取消域名挂牌
删除您拥有的域名的有效待售挂牌。该域名仍保留在您的帐户中,但无法再在市场上购买。需要 domains:write 范围。
参数
| domain* | string | 取消列出的域名 |
回应 200
| domain | string | |
| status | string | |
| hint | string |
响应示例
{
"domain": "example.com",
"status": "cancelled",
"hint": "Listing for example.com has been cancelled."
}/api/domains/{domain}/analytics获取停放分析
获取托管域的访客分析 - 页面浏览量、查询、转化率、30 天每日细分和最近查询。
参数
| domain* | string | 域名 |
回应 200
| domain | string | |
| views_7d | integer | 过去 7 天内的总页面浏览量 |
| views_30d | integer | 过去 30 天内的总页面浏览量 |
| inquiries_30d | integer | 过去 30 天内的查询总数 |
| conversion_rate | number | 查询率与浏览率(百分比) |
| daily_views | object[] | 过去 30 天的每日观看次数 |
| recent_inquiries | object[] | 最近 5 条询问 |
| hint | string |
响应示例
{
"domain": "example.com",
"views_7d": 42,
"views_30d": 156,
"inquiries_30d": 3,
"conversion_rate": 1.92,
"daily_views": [
{
"date": "2026-02-25",
"views": 7
}
],
"recent_inquiries": [
{
"email": "buyer@example.com",
"offer": 500,
"date": "2026-02-25T10:00:00Z"
}
],
"hint": "example.com received 156 views and 3 inquiries in the last 30 days (1.92% conversion)."
}/api/domains/{domain}/auth-code获取EPP授权码
获取将域名转移到另一个注册商所需的 EPP/授权码。如果域名被锁定,则自动解锁。持有授权码的人可以转移该域名及其邮件:读取它需要 email:auth_secrets 范围和未受邮箱限定的令牌(否则返回 403 INSUFFICIENT_SCOPE 或 403 MAILBOX_CONFINED),每次读取都会记录在审计日志中。部分注册商没有提供转移码的 API:此时首次调用返回 202 和 status: "requested",同时 Domani 团队会解锁域名并手动获取转移码(1 个工作日内,expected_by);就绪后用户会收到邮件,之后的调用返回 200、status: "ready" 和转移码。在注册或转入后 60 天内,此类域名会返回 409 TRANSFER_LOCKED 和 available_at。
参数
| domain* | string | 您拥有的域名 |
回应 200
| domain | string | |
| status | string | `ready`:转移码在 auth_code 中。`requested`:Domani 团队正在向注册商获取转移码;就绪后用户会收到邮件。 |
| auth_code | string | null | 提供给新注册商的 EPP 授权码。状态为 requested 时为 null。 |
| was_unlocked | boolean | 域名是否已解锁以允许转移 |
| requested_at | string (date-time) | 申请转移码的时间(适用于没有相应 API 的注册商) |
| expected_by | string (date-time) | Domani 团队最迟获得转移码的时间(状态为 requested 时) |
| hint | string | |
| next_steps | string[] |
/api/domains/{domain}/transfer-away获取域名转出状态
检查域名转出的状态。在获取授权码并于新注册商处发起转移后使用。transfer_out.mode 为 manual 的域名不支持此操作。
参数
| domain* | string | 您拥有的域名 |
回应 200
| domain | string | |
| status | string | |
| gaining_registrar | string | |
| request_date | string (date-time) | |
| hint | string |
/api/domains/{domain}/transfer-status检查域名转入状态
检查入站域转移的状态。返回带有可操作提示的详细状态。使用 POST /api/domains/transfer 启动传输后使用。
参数
| domain* | string | 您拥有的域名 |
回应 200
| domain | string | |
| status | string | |
| timestamp | string | 上次状态更新的时间戳 |
| hint | string | 基于当前状态的可行指导 |
| continuity | object | 捕获授权和传输后验证以确保安全传输。 |
/api/domains/import导入外部域
导入您在其他注册商(GoDaddy、Namecheap、Cloudflare 等)处拥有的域名,以通过 domani.run 进行管理。免费,无需域名转移。返回 TXT 记录以进行基于 DNS 的所有权验证。
请求正文
| domain* | string | 要导入的域 |
回应 200
| domain | string | |
| status | string | |
| token | string | |
| txt_record | object | |
| hint | string |
/api/domains/import/verify验证并完成域导入
验证 DNS TXT 记录并完成域导入。添加 POST /api/domains/import 返回的 TXT 记录后调用。使用 Cloudflare DNS-over-HTTPS 检查传播。
请求正文
| domain* | string | 要验证的域名 |
回应 201
| domain | string | |
| status | string | |
| expires | string (date-time) | |
| registrar | string | |
| payment_method | string | |
| hint | string |
/api/domains/adoption-plan规划如何采用现有域
连接或转移现有域之前对其进行只读检查。返回当前注册商、权威域名服务器、DNS 提供商、DNSSEC 状态、帐户状态、转移价格、安全不变量以及确切的下一个 API 操作。在请求 EPP 代码之前调用此方法。连接使注册商和 DNS 保持不变。转移会保留名称服务器并且不会迁移 DNS。
参数
| domain* | string | 要检查的现有域,例如mysite.com |
回应 200
| version | integer | |
| domain | string | |
| registered | boolean | |
| account_state | string | |
| recommended_action | string | |
| current | object | |
| options | object | |
| invariants | string[] | |
| warnings | string[] |
/api/domains/transfer-check预先检查转让资格
在开始之前检查域名是否符合转移条件。返回转让价格、资格状态和任何阻止因素(不支持的 TLD、ICANN 等待期、域名锁定)。在 POST /api/domains/transfer 之前调用此方法。
参数
| domain* | string | 要检查的域,例如mysite.com |
回应 200
| domain | string | |
| tld | string | |
| eligible | boolean | |
| price | number | null | 美元转让价格(如果不支持 TLD,则为空) |
| currency | string | |
| renewal_price | number | 仅在符合条件时返回:在域名转入的注册商处,转让之后每年的费用(USD)。未知时不返回。 |
| reason | string | 如果不符合条件,则提供人类可读的原因 |
| code | string | |
| eligible_at | string (date) | 域名符合资格的 ISO 日期(ICANN 等待期) |
| hint | string |
/api/domains/transfer-watch观察域名的转移资格
监控域名,并在其符合转移条件时接收通知(电子邮件 + transfer.eligible webhook)。使用 RDAP 检查 EPP 状态代码和 ICANN 60 天锁定期。如果已经符合条件,则立即返回而不创建监控。
请求正文
| domain* | string | 要观看的域名,例如mysite.com |
回应 200
| domain | string | |
| eligible | boolean | 该域名当前是否符合转移条件 |
| eligible_at | string (date) | 域名符合资格的 ISO 日期(如果尚不符合资格) |
| hint | string | 可行的指导 |
| watching | boolean | 是否设置了通知 |
/api/domains/transfer从其他提供商转移域名
在 planDomainAdoption 和明确的价格确认后启动域名转入。需要当前提供商的授权/EPP 代码。现有的权威域名服务器得到保留和验证。 DNS 迁移从来都不是隐式的。转移通常需要 1-5 天才能完成。通过银行卡或 USDC 预先付款。
请求正文
| domain* | string | 要转移的域名,例如mysite.com |
| auth_code* | string | 当前提供商的授权/EPP 代码 |
| payment_method | string(card | usdc | balance) | 付款方式:“card”(默认)、“usdc”或“balance”(市场信用)。 |
| payment_tx | string | USDC 付款的交易哈希值已发送到链上。 |
| payment_chain | string(base | ethereum) | 链上 USDC 付款已发送。 |
| extra_subdomains | string[] | 要包含在传输前 DNS 快照中的其他子域。我们通过 CT 日志、SPF、MX/DKIM 推理和通用单词列表自动发现子域 - 将其用于我们可能错过的任何自定义子域。 |
| max_price | number | 转移费用的上限(美元)。如果实际价格超过该值,请求会以 400 PRICE_ABOVE_MAX 失败且不收取任何费用。未提供 max_price 时,上限为显示的转移价格:当只有更贵的注册商能办理时,转移同样会失败。错误中的 `price` 是需要接受的总额;请先与用户确认,再用该 max_price 重试。 |
回应 202
| domain | string | |
| status | string | |
| expires | string (date-time) | |
| price | number | |
| currency | string | |
| payment_method | string | |
| payment_tx | string | |
| auto_renew | boolean | |
| hint | string | |
| dns_snapshot | object | 传输前捕获的恢复备份摘要。除非需要显式恢复操作,否则不会应用它。 |
| nameservers_preserved | boolean | |
| dns_migration | string | |
| continuity | object |
示例
curl -X POST https://domani.run/api/domains/transfer \
-H "Authorization: Bearer domani_sk_xxx" \
-H "Content-Type: application/json" \
-d '{"domain": "mysite.com", "auth_code": "EPP-AUTH-CODE"}'/api/domains/{domain}/renew续订域名
将您拥有的域名续订额外年数 (1-10)。付款是预先收取的。新的到期日期将在响应中返回。如果域名的注册商拒绝续订(过去 30 天内已续订,或其不销售该年限),请求会在任何扣费之前失败并返回 400 RENEWAL_NOT_ELIGIBLE。价格为 GET /api/domains/{domain} 返回的 renewal_price 乘以 years:将该总额作为 max_price 发送,这样价格变动时请求会在任何扣费之前失败。
参数
| domain* | string | 您拥有的域名 |
请求正文
| years | integer | 续订年数(默认 1) |
| payment_method | string(card | usdc | balance) | 付款方式:“card”(默认)、“usdc”或“balance”(市场信用)。 |
| payment_tx | string | USDC 付款的交易哈希值已发送到链上。 |
| payment_chain | string(base | ethereum) | 链上 USDC 付款已发送。 |
| max_price | number | 续订费用的上限(美元)。如果实际价格超过该价格,则请求会失败并显示 400 PRICE_ABOVE_MAX,并且不收取任何费用。错误中的 `price` 字段是需要接受的总额;请先与用户确认,再以该 max_price 重试。 |
回应 200
| domain | string | |
| renewed_years | integer | |
| new_expiry | string (date-time) | |
| price | number | |
| currency | string | |
| payment_method | string | |
| payment_tx | string |
示例
curl -X POST https://domani.run/api/domains/mysite.com/renew \
-H "Authorization: Bearer domani_sk_xxx" \
-H "Content-Type: application/json" \
-d '{"years": 1}'/api/domains/{domain}/buy-aftermarket购买二级市场域名
通过 Domani 以立即购买价格购买在二级市场 (Afternic / Sedo) 上出售的已占用域名。收费前会重新实时核对挂牌价格;通过 max_price 来限制您将支付的费用。此处无法购买仅限报价的挂牌 - 请使用经纪人(POST /api/broker)来协商价格。付款方式类似于注册:卡、USDC on Base (x402) 或市场余额。需要domains:transfer范围。成功后,域名将进入您的帐户(status: active,或分阶段转移完成时的provisioning)。
参数
| domain* | string | 可购买的二级市场挂牌域名 |
请求正文
| max_price | number | 以美元计价的硬性价格上限。默认为挂牌的立即购买价格;如果实时价格超过此价格,则购买将被拒绝。 |
| payment_method | string(card | usdc | balance) | 付款方式:“card”(默认)、“usdc”或“balance”(市场信用)。 |
| payment_tx | string | USDC 付款的交易哈希值已发送到链上。 |
| payment_chain | string(base | ethereum) | 链上 USDC 付款已发送。 |
回应 201
| domain | string | |
| status | string | 购买完成时为“active”,或分阶段转移完成时为“provisioning”。 |
| price | number | |
| currency | string | |
| payment_method | string | |
| payment_tx | string | |
| marketplace | string | 域名是在二级市场购买的(例如“Afternic”、“Sedo”)。 |
| hint | string | |
| next_steps | string[] |
示例
curl -X POST https://domani.run/api/domains/coolname.com/buy-aftermarket \
-H "Authorization: Bearer domani_sk_xxx" \
-H "Content-Type: application/json" \
-d '{}'域名系统
/api/domains/{domain}/dns获取您拥有的域的 DNS 记录
返回为您拥有的域配置的所有 DNS 记录(A、AAAA、CNAME、MX、TXT、NS,...),每个记录都有一个稳定的id,加上一个zone_version令牌(也作为 ETag 标头发送)。将 zone_version 传递回 PUT 以检测并发区域更改。
参数
| domain* | string | 您拥有的域名 |
回应 200
| domain | string | |
| records | DnsRecord[] | |
| zone_version | string | 整个区域的乐观并发令牌。将其传递回 PUT(主体 zone_version 或 If-Match 标头)以失败并出现 409 DNS_VERSION_CONFLICT,而不是破坏并发更改。 |
响应示例
{
"domain": "mysite.com",
"records": [
{
"id": "rec_1a2b3c4d5e6f",
"type": "A",
"name": "@",
"value": "76.76.21.21",
"ttl": 3600
},
{
"id": "rec_2b3c4d5e6f7a",
"type": "CNAME",
"name": "www",
"value": "mysite.com",
"ttl": 3600
},
{
"id": "rec_3c4d5e6f7a8b",
"type": "MX",
"name": "@",
"value": "mail.example.com",
"ttl": 3600,
"priority": 10
}
],
"zone_version": "zv_9f8e7d6c5b4a3f2e"
}示例
curl https://domani.run/api/domains/mysite.com/dns \ -H "Authorization: Bearer domani_sk_xxx"
/api/domains/{domain}/dns为您拥有的域设置 DNS 记录
在 rrset 级别更新 DNS 记录:对于有效负载中存在的每个(类型,名称),该(类型,名称)的现有记录将替换为您发送的记录;有效负载中未提及的 rrset 会被保留,并且 NS 记录永远不会被触及。每次写入之前都会自动对区域进行服务器端备份。 并发:从先前的 GET(正文字段或 If-Match 标头)传递zone_version。如果此后区域发生更改,则写入会失败并返回 409 DNS_VERSION_CONFLICT,并返回当前记录 + 版本,以便您可以重新合并并重试。 邮件路由:更改域名邮件的投递目的地(其 MX 或 NS 记录、区域内 MX 主机解析所经过的地址记录,或接收 Domani 邮件且未发布 MX 的主机的地址记录)需要 email:auth_secrets 范围,因为谁收到邮件,谁就收到其中的登录验证码。没有该范围时,请求会在任何更改发生之前返回 403 INSUFFICIENT_SCOPE;受邮箱限定的令牌即使拥有该范围也会返回 403 MAILBOX_CONFINED。其他记录只需要 domains:write。每次路由更改都会记录在审计日志中。
参数
| domain* | string | 您拥有的域名 |
请求正文
| records* | DnsRecord[] | |
| zone_version | string | 来自先前 GET 的 zone_version。如果不匹配,写入将被拒绝,并显示 409 DNS_VERSION_CONFLICT(未写入任何内容)。每当其他演员可能编辑同一区域时推荐使用。 |
回应 200
| success | boolean | |
| domain | string | |
| records | DnsRecord[] |
响应示例
{
"success": true,
"domain": "mysite.com",
"records": [
{
"type": "A",
"name": "@",
"value": "76.76.21.21",
"ttl": 3600
},
{
"type": "CNAME",
"name": "www",
"value": "cname.vercel-dns.com",
"ttl": 3600
}
]
}示例
curl -X PUT https://domani.run/api/domains/mysite.com/dns \
-H "Authorization: Bearer domani_sk_xxx" \
-H "Content-Type: application/json" \
-d '{"records": [
{"type": "A", "name": "@", "value": "76.76.21.21", "ttl": 3600},
{"type": "CNAME", "name": "www", "value": "cname.vercel-dns.com", "ttl": 3600}
]}'/api/domains/{domain}/dnssec列出您拥有的域的 DNSSEC DS 记录
返回在您拥有的域的注册表中发布的 DNSSEC 委托签名者 (DS) 记录,以及是否启用了 DNSSEC。与 DANE 的 TLSA 记录(通过 DNS 端点设置)配对。
参数
| domain* | string | 您拥有的域名 |
回应 200
| domain | string | |
| enabled | boolean | 当至少发布一条 DS 记录时为 true |
| records | DsRecord[] |
响应示例
{
"domain": "mysite.com",
"enabled": true,
"records": [
{
"keyTag": "12345",
"algorithm": "13",
"digestType": "2",
"digest": "A1B2C3..."
}
]
}示例
curl https://domani.run/api/domains/mysite.com/dnssec \ -H "Authorization: Bearer domani_sk_xxx"
/api/domains/{domain}/dnssec发布 DNSSEC DS 记录(启用 DNSSEC)
在注册表中发布委托签名者 (DS) 记录,为域启用 DNSSEC。签署区域后,从您的 DNS/区域提供商处获取 DS 值。
参数
| domain* | string | 您拥有的域名 |
回应 200
| success | boolean | |
| domain | string | |
| enabled | boolean | |
| records | DsRecord[] |
示例
curl -X POST https://domani.run/api/domains/mysite.com/dnssec \
-H "Authorization: Bearer domani_sk_xxx" \
-H "Content-Type: application/json" \
-d '{"keyTag": "12345", "algorithm": "13", "digestType": "2", "digest": "A1B2C3..."}'/api/domains/{domain}/dnssec删除 DNSSEC DS 记录(禁用 DNSSEC)
通过密钥标签删除注册表中的委托签名者 (DS) 记录。删除所有 DS 记录会禁用域的 DNSSEC。
参数
| domain* | string | 您拥有的域名 |
| keyTag* | string | 要删除的 DS 记录的键标签 |
回应 200
| success | boolean | |
| domain | string | |
| enabled | boolean | |
| records | DsRecord[] |
示例
curl -X DELETE "https://domani.run/api/domains/mysite.com/dnssec?keyTag=12345" \ -H "Authorization: Bearer domani_sk_xxx"
/api/domains/{domain}/dns/snapshot捕获 DNS 快照
通过公共 DNS 查找 (Cloudflare DoH) 捕获域的所有 DNS 记录。从证书透明度日志、SPF 记录和通用名称中发现子域。快照也存储在服务器端作为备份。
参数
| domain* | string | 您拥有的域名 |
请求正文
| extra_subdomains | string[] | 要包含在快照中的其他子域 |
回应 200
| domain | string | |
| records | DnsRecord[] | |
| subdomains | string[] | |
| sources | string[] | |
| capturedAt | string (date-time) |
响应示例
{
"domain": "mysite.com",
"records": [
{
"type": "A",
"name": "@",
"value": "76.76.21.21",
"ttl": 3600
},
{
"type": "CNAME",
"name": "www",
"value": "mysite.com",
"ttl": 3600
},
{
"type": "MX",
"name": "@",
"value": "aspmx.l.google.com",
"ttl": 3600,
"priority": 1
}
],
"subdomains": [
"www",
"mail",
"api"
],
"sources": [
"ct",
"wordlist"
],
"capturedAt": "2026-03-06T12:00:00.000Z"
}示例
curl -X POST https://domani.run/api/domains/mysite.com/dns/snapshot \ -H "Authorization: Bearer domani_sk_xxx"
/api/domains/{domain}/dns/restore从快照恢复 DNS
将快照中的 DNS 记录应用到域的当前注册商。使用 diff 算法来避免重复已存在的记录。如果正文中未提供快照,则从服务器端备份(通过快照或传输创建)进行恢复。 邮件路由:更改域名邮件的投递目的地(其 MX 或 NS 记录、区域内 MX 主机解析所经过的地址记录,或接收 Domani 邮件且未发布 MX 的主机的地址记录)需要 email:auth_secrets 范围,因为谁收到邮件,谁就收到其中的登录验证码。没有该范围时,请求会在任何更改发生之前返回 403 INSUFFICIENT_SCOPE;受邮箱限定的令牌即使拥有该范围也会返回 403 MAILBOX_CONFINED。其他记录只需要 domains:write。每次路由更改都会记录在审计日志中。
参数
| domain* | string | 您拥有的域名 |
请求正文
| snapshot | object | DNS 快照对象(由快照端点返回)。如果省略,则使用存储的服务器端备份。 |
| dry_run | boolean | 仅预览:返回恢复将创建(would_apply)并跳过的内容,而不写入任何内容。 |
回应 200
| domain | string | |
| applied | integer | 创建的记录数 |
| skipped | integer | 已存在的记录数 |
| recordCount | integer | 快照中的总记录数 |
| errors | string[] | |
| dry_run | boolean | 当这是预览时确实如此 - 没有写任何内容 |
| would_apply | DnsRecord[] | 仅试运行:恢复将创建的记录 |
响应示例
{
"domain": "mysite.com",
"applied": 5,
"skipped": 2,
"recordCount": 7,
"errors": []
}示例
curl -X POST https://domani.run/api/domains/mysite.com/dns/restore \ -H "Authorization: Bearer domani_sk_xxx"
/api/domains/{domain}/dns/clone将另一个域的 DNS 克隆到此域上
将您拥有的源域的 DNS 设置复制到该域 - 对于共享相同 A/CNAME/MX 的多 TLD 品牌(brand.com → Brand.dev)非常有用。默认情况下合并(源记录在任何类型+名称冲突中获胜,保留该域的其他记录);设置replace: true作为精确镜像。 邮件路由:更改域名邮件的投递目的地(其 MX 或 NS 记录、区域内 MX 主机解析所经过的地址记录,或接收 Domani 邮件且未发布 MX 的主机的地址记录)需要 email:auth_secrets 范围,因为谁收到邮件,谁就收到其中的登录验证码。没有该范围时,请求会在任何更改发生之前返回 403 INSUFFICIENT_SCOPE;受邮箱限定的令牌即使拥有该范围也会返回 403 MAILBOX_CONFINED。其他记录只需要 domains:write。每次路由更改都会记录在审计日志中。
参数
| domain* | string | 目标域名(这里写的是DNS) |
请求正文
| from* | string | 从中复制 DNS 的源域(必须是您的) |
| replace | boolean | 精确镜像 - 删除源没有的目标记录。默认:合并 |
回应 200
| success | boolean | |
| from_domain | string | |
| to_domain | string | |
| records | DnsRecord[] |
示例
curl -X POST https://domani.run/api/domains/brand.dev/dns/clone \
-H "Authorization: Bearer domani_sk_xxx" \
-H "Content-Type: application/json" \
-d '{"from": "brand.com"}'/api/domains/{domain}/nameservers获取域的名称服务器
返回为您拥有的域配置的权威名称服务器。如果为空,则在分配名称服务器之前,DNS 操作(停放、电子邮件、连接)将失败。
参数
| domain* | string | 您拥有的域名 |
回应 200
| domain | string | |
| nameservers | string[] | |
| default_nameservers | string[] | 提供该域名区域解析的名称服务器:当 Domani 在区域主机上托管该区域时为区域主机,否则为注册商的默认值(未知时为 null) |
| dns_provider | string | 由谁应答该域名的区域:注册商自身的 DNS、Domani 托管在 Cloudflare 上的区域,或导入域名的外部提供商 |
| hint | string |
响应示例
{
"domain": "mysite.com",
"nameservers": [
"ns1.systemdns.com",
"ns2.systemdns.com",
"ns3.systemdns.com"
],
"default_nameservers": [
"ns1.systemdns.com",
"ns2.systemdns.com",
"ns3.systemdns.com"
],
"dns_provider": "registrar",
"hint": "3 nameservers configured for mysite.com."
}示例
curl https://domani.run/api/domains/mysite.com/nameservers \ -H "Authorization: Bearer domani_sk_xxx"
/api/domains/{domain}/nameservers为域设置名称服务器
替换您拥有的域的名称服务器。需要 2-13 个有效主机名。常用值:OpenSRS DNS(ns1.systemdns.com、ns2.systemdns.com、ns3.systemdns.com)。名称服务器决定域名所有邮件(包括登录验证码)的去向:更改它们需要 email:auth_secrets 范围和未受邮箱限定的令牌(否则返回 403 INSUFFICIENT_SCOPE 或 403 MAILBOX_CONFINED),每次更改都会记录在审计日志中。
参数
| domain* | string | 您拥有的域名 |
请求正文
| nameservers* | string[] | 名称服务器主机名(需要 2-13) |
回应 200
| success | boolean | |
| domain | string | |
| nameservers | string[] | |
| hint | string |
响应示例
{
"success": true,
"domain": "mysite.com",
"nameservers": [
"ns1.systemdns.com",
"ns2.systemdns.com",
"ns3.systemdns.com"
],
"hint": "Nameservers for mysite.com updated to ns1.systemdns.com, ns2.systemdns.com, ns3.systemdns.com. Changes may take up to 48 hours to propagate."
}示例
curl -X PUT https://domani.run/api/domains/mysite.com/nameservers \
-H "Authorization: Bearer domani_sk_xxx" \
-H "Content-Type: application/json" \
-d '{"nameservers": ["ns1.systemdns.com", "ns2.systemdns.com", "ns3.systemdns.com"]}'连接
/api/domains/{domain}/connect将域连接到托管或电子邮件提供商
通过从目标 URL 自动检测提供商或接受显式提供商名称,将域连接到托管或电子邮件提供商。 对于通过平台管理的域,会自动设置 DNS 记录(状态:dns_set)。对于导入的域名(外部注册商),按照说明返回记录,以便在您的注册商处手动添加(状态:manual_setup_required,记录的状态为pending)。 支持的托管提供商:vercel、netlify、cloudflare-pages、github-pages、railway、fly。 支持的电子邮件提供商:google-workspace、fastmail、proton。 使用 GET /api/domains/{domain}/connect 列出所有可用的提供程序和方法。 邮件路由:更改域名邮件的投递目的地(其 MX 或 NS 记录、区域内 MX 主机解析所经过的地址记录,或接收 Domani 邮件且未发布 MX 的主机的地址记录)需要 email:auth_secrets 范围,因为谁收到邮件,谁就收到其中的登录验证码。没有该范围时,请求会在任何更改发生之前返回 403 INSUFFICIENT_SCOPE;受邮箱限定的令牌即使拥有该范围也会返回 403 MAILBOX_CONFINED。其他记录只需要 domains:write。每次路由更改都会记录在审计日志中。
参数
| domain* | string | 您拥有的域名 |
请求正文
| target | string | 自动检测的目标 URL(例如 my-app.vercel.app) |
| provider | string | 明确的提供商名称(例如 vercel、google-workspace) |
| method | string | 连接方法(如果提供商有多个)(例如仅 cname) |
| dry_run | boolean | 仅预览:返回差异(create/replace/already_set/keep),不写入任何内容。 |
| confirm_replace_mx | boolean | 当连接替换指向另一个提供商的现有 MX 记录时需要(否则为 409 MX_REPLACEMENT_REQUIRES_CONFIRMATION) - 它会重新路由域的电子邮件。 |
回应 200
| domain | string | |
| provider | string | |
| category | string | |
| method | string | |
| records | DnsRecord[] | |
| docs | string (uri) | |
| status | string | dns_set = 自动写入记录。manual_setup_required = 域名已导入,请在注册商处添加记录。dry_run = 仅预览,不写入任何内容。 |
| hint | string | |
| next_steps | string[] | 设置 DNS 记录后要完成的特定于提供商的操作 |
| diff | object | 仅试运行:返回写入将执行的操作 - create、replace(将删除的现有记录)、already_set 和 keep(不变的 rrsets)。 |
示例
curl -X POST https://domani.run/api/domains/mysite.com/connect \
-H "Authorization: Bearer domani_sk_xxx" \
-H "Content-Type: application/json" \
-d '{"target": "my-app.vercel.app"}'/api/domains/{domain}/connect列出用于连接域的可用提供商
返回所有受支持的托管和电子邮件提供商及其连接方法。在调用 POST 之前,使用它来发现可用的提供程序。
参数
| domain* | string | 您拥有的域名 |
回应 200
| domain | string | |
| providers | object |
/api/domains/{domain}/verify验证提供商连接是否正常工作
运行提供商的验证检查以确认 DNS 记录已传播且连接处于活动状态。在 POST /api/domains/{domain}/connect 后使用进行验证。
参数
| domain* | string | 您拥有的域名 |
请求正文
| target | string | 自动检测目标 |
| provider | string | 提供商名称 |
| method | string | 方法名称 |
回应 200
| domain | string | |
| provider | string | |
| method | string | |
| verified | boolean | |
| message | string | |
| hint | string | |
| next_steps | string[] | 提供商特定的故障排除步骤(仅当验证为 false 时) |
示例
curl -X POST https://domani.run/api/domains/mysite.com/verify \
-H "Authorization: Bearer domani_sk_xxx" \
-H "Content-Type: application/json" \
-d '{"target": "my-app.vercel.app"}'状态
/api/domains/{domain}/status检查域名健康状况:DNS、SSL、电子邮件、过期
通过 DNS-over-HTTPS 检查域的运行状况:A/AAAA/CNAME/MX/TXT/NS 记录、SSL 证书状态、电子邮件配置和到期日期。通过Accept: text/event-stream支持 SSE 流 - 关闭连接会取消正在进行的 DNS/SSL 检查服务器端。连接后使用它来验证 DNS 传播。
参数
| domain* | string | 您拥有的域名 |
回应 200
| domain | string | |
| status | string | |
| expires | string (date-time) | |
| days_until_expiry | integer | |
| dns | object | |
| ssl | object | |
| object |
响应示例
{
"domain": "mysite.com",
"status": "active",
"expires": "2027-02-18T00:00:00.000Z",
"days_until_expiry": 365,
"dns": {
"propagated": true,
"a": [
"76.76.21.21"
],
"aaaa": [],
"cname": [],
"mx": [],
"txt": [],
"ns": [
"ns1.porkbun.com",
"ns2.porkbun.com"
],
"registrar_records": [
{
"type": "A",
"name": "@",
"value": "76.76.21.21",
"ttl": 3600
}
]
},
"ssl": {
"active": true
},
"email": {
"configured": false,
"mx": []
}
}示例
curl https://domani.run/api/domains/mysite.com/status \ -H "Authorization: Bearer domani_sk_xxx"
验证服务
/api/domains/{domain}/verify-service添加 DNS 记录以验证第三方服务的域所有权
添加正确的 DNS 记录(TXT、CNAME)以向第三方服务证明域所有权。支持 Stripe、Google Search Console、AWS SES、Postmark、Resend、Facebook、HubSpot 和 Microsoft 365。未知的服务名称会回退到通用 TXT 记录。 记录与现有 DNS 合并 - 保留现有记录。 邮件路由:更改域名邮件的投递目的地(其 MX 或 NS 记录、区域内 MX 主机解析所经过的地址记录,或接收 Domani 邮件且未发布 MX 的主机的地址记录)需要 email:auth_secrets 范围,因为谁收到邮件,谁就收到其中的登录验证码。没有该范围时,请求会在任何更改发生之前返回 403 INSUFFICIENT_SCOPE;受邮箱限定的令牌即使拥有该范围也会返回 403 MAILBOX_CONFINED。其他记录只需要 domains:write。每次路由更改都会记录在审计日志中。
参数
| domain* | string | 您拥有的域名 |
请求正文
| service* | string | 服务名称 (e.g. stripe, google-search-console, aws-ses, postmark, resend, facebook, hubspot, microsoft-365) |
| token* | string | 服务提供的验证令牌 |
回应 200
| domain | string | |
| service | string | |
| service_display_name | string | |
| known_service | boolean | |
| records_added | DnsRecord[] | |
| total_records | integer | |
| docs | string (uri) | null | |
| hint | string |
响应示例
{
"domain": "mysite.com",
"service": "stripe",
"service_display_name": "Stripe",
"known_service": true,
"records_added": [
{
"type": "TXT",
"name": "@",
"value": "stripe-verification=abc123def456",
"ttl": 3600
}
],
"total_records": 3,
"docs": "https://docs.stripe.com/identity/verification-checks/selfie#domain-verification",
"hint": "Stripe verification records added. Return to Stripe to complete verification."
}示例
curl -X POST https://domani.run/api/domains/mysite.com/verify-service \
-H "Authorization: Bearer domani_sk_xxx" \
-H "Content-Type: application/json" \
-d '{"service": "stripe", "token": "abc123def456"}'/api/domains/{domain}/verify-service列出域验证支持的服务
返回所有已知服务及其名称、描述和文档 URL。未知服务回退到通用 TXT 记录。
参数
| domain* | string | 您拥有的域名 |
回应 200
| domain | string | |
| services | object[] | |
| hint | string |
发现
/api/domains/{domain}/profile公共获取公共域配置文件
返回域的最新隐私安全、有证据支持的公共档案。此端点永远不会返回已隐藏的观察结果或原始注册联系方式。
参数
| domain* | string |
回应 200
| profile | PublicDomainProfile |
/api/domains/{domain}/profile公共研究或刷新公共领域配置文件
使用公共注册表、DNS、实时站点、结构化数据和存档源运行有界分析,然后存储规范公共页面的隐私安全配置文件。即时深度用于快速首次渲染; deep 是默认值,并添加了历史研究。
参数
| domain* | string | |
| depth | string(instant | deep) | 研究深度。默认为深。 |
回应 201
| profile | PublicDomainProfile |
/api/domains/whois公共通过 RDAP 查找域名注册数据
查询 RDAP(注册数据访问协议)网络以获取域注册数据。返回注册商、创建/到期/更新日期、到期天数、状态代码、名称服务器、DNSSEC 状态和联系信息(注册人、管理联系人、技术联系人、账单联系人、滥用举报联系人)。适用于任何域 - 无需所有权。 RDAP 是 WHOIS 的现代 JSON 本机替代品。对于没有 RDAP 的 TLD,回退到 WHOIS(端口 43),并在联系人缺失时使用 WHOIS 转介数据补充 RDAP(常见于 GDPR 后)。由于 GDPR 或隐私保护服务的原因,联系信息可能会被部分或全部编辑。 公共端点 - 无需身份验证。经过身份验证的请求获得更高的速率限制(30/分钟 vs 10/分钟)。
参数
| q* | string | 要查找的域(例如 example.com) |
回应 200
| domain | string | |
| registered | boolean | 该域名当前是否已注册 |
| registrar | string | null | 当前注册商名称 |
| registrar_url | string | null | 注册商网站 URL |
| registrar_iana_id | string | null | 注册商 IANA ID(来自 RDAP publicIds) |
| created | string | null | 注册日期(YYYY-MM-DD) |
| expires | string | null | 到期日期(YYYY-MM-DD) |
| updated | string | null | 最后更新日期 (YYYY-MM-DD) |
| days_until_expiry | integer | null | 距到期天数(如果未注册则为空) |
| status | string[] | EPP 状态代码 |
| nameservers | string[] | 权威域名服务器 |
| dnssec | boolean | 是否启用 DNSSEC |
| redacted | boolean | WHOIS/RDAP 数据是否经过隐私保护 (GDPR) |
| contacts | object | 按角色列出的联系信息(无可用数据时为空,编辑时字段可能为空) |
示例
curl "https://domani.run/api/domains/whois?q=google.com"
/api/domains/{domain}/og公共获取域的网站预览元数据
返回域的开放图谱元数据(标题、描述、图像、图标)。数据被延迟获取并缓存 7 天。首次请求域名可能需要 1-5 秒(实时获取);后续请求是即时的(缓存命中)。如果站点无法访问或没有 OG 标签,则返回空字段。 公共端点 - 无需身份验证。
参数
| domain* | string | 用于获取元数据的域(例如 google.com) |
回应 200
| title | string | null | 页面标题 (og:title > twitter:title > <title>) |
| description | string | null | 页面描述(og:description>元描述) |
| image | string | null | OG图像URL(绝对) |
| favicon | string | null | 网站图标 URL(绝对) |
示例
curl "https://domani.run/api/domains/google.com/og"
计费
/api/billing/setup获取用于添加付款方式的 URL
始终同时返回用于添加信用卡的 Stripe Checkout url 和 SetupIntent client_secret。无法运行 Stripe.js 的智能体应在浏览器中打开 url,并让用户在那里添加卡;直接嵌入 Stripe Elements 的前端(例如 Domani 控制台)则改用 client_secret。使用卡购买域名之前必须完成此步骤。用户完成结账后,会被重定向回控制台。
请求正文
| mode | string(setup_intent | checkout) | 已弃用:无论此值为何,`url` 和 `client_secret` 始终都会一起返回。保留只是为了向后兼容。 |
回应 200
| url | string (uri) | Stripe Checkout URL - 在浏览器中打开以添加卡 |
| client_secret | string | Stripe SetupIntent 客户端密钥,供直接使用 Stripe.js 的前端使用 |
| hint | string | 后续步骤指导 |
响应示例
{
"url": "https://checkout.domani.run/session/cs_abc123...",
"client_secret": "seti_abc123_secret_xyz",
"hint": "Open `url` in a browser to add your payment card."
}示例
curl -X POST https://domani.run/api/billing/setup \ -H "Authorization: Bearer domani_sk_xxx"
/api/billing/card删除已保存的付款方式
将用户保存的信用卡与其帐户分离。删除后,必须先添加新卡才能购买域名。
回应 200
| removed | boolean |
响应示例
{
"removed": true
}示例
curl -X DELETE https://domani.run/api/billing/card \ -H "Authorization: Bearer domani_sk_xxx"
/api/billing/connect获取市场支付状态
返回卖家的 Stripe Connect 加入状态和可用市场余额。入职完成后,payouts_enabled为 true,卖家可以收到银行付款。
回应 200
| onboarded | boolean | 卖家已提交 Connect 入职详细信息 |
| payouts_enabled | boolean | 银行付款活跃 |
| details_submitted | boolean | |
| balance_cents | integer | 可用市场余额(以美分为单位) |
响应示例
{
"onboarded": true,
"payouts_enabled": true,
"details_submitted": true,
"balance_cents": 45000
}示例
curl https://domani.run/api/billing/connect \ -H "Authorization: Bearer domani_sk_xxx"
/api/billing/connect开始银行付款入职
为市场卖家创建(或恢复)Stripe Connect Express 入门,并返回托管的入门 URL 以将用户重定向到。卖家可以将收入提取到银行之前需要这样做。
回应 200
| url | string (uri) | Stripe 托管的入门 URL |
响应示例
{
"url": "https://connect.stripe.com/setup/e/acct_123/..."
}示例
curl -X POST https://domani.run/api/billing/connect \ -H "Authorization: Bearer domani_sk_xxx"
/api/billing/connect/payout将市场余额提取至银行
将卖家的全部可用市场余额转移到其关联的银行账户。需要完成付款登录(POST /api/billing/connect)。余额在转账前保留,并在转账失败时恢复,因此失败永远不会损失资金。
回应 200
| amount_cents | integer | 转账金额(以美分为单位) |
| transfer_id | string | Stripe 转账 ID |
响应示例
{
"amount_cents": 45000,
"transfer_id": "tr_123"
}示例
curl -X POST https://domani.run/api/billing/connect/payout \ -H "Authorization: Bearer domani_sk_xxx"
/api/billing/invoices列出付款发票
返回已付发票列表,其中包含发票编号、金额、日期以及用于查看或下载 PDF 的链接。每次域名购买、续订和转让都会自动生成发票。
参数
| limit | integer | 可退回的最大发票数 |
回应 200
| invoices | object[] | |
| has_more | boolean | |
| hint | string |
示例
curl https://domani.run/api/billing/invoices \ -H "Authorization: Bearer domani_sk_xxx"
推荐人
/api/referrals获取推荐收入和历史记录
返回您的唯一推荐代码、佣金率 (20%)、收入明细(总计、已付款、待处理)以及所有推荐购买的历史记录。与其他人分享您的推荐代码 - 当他们使用您的代码注册时(通过ref参数),您将自动从他们未来购买的所有域名中赚取佣金。
回应 200
| referral_code | string | 您要分享的独特推荐代码 |
| referral_rate | integer | 佣金百分比(目前为 20%) |
| total_earned_cents | integer | 总收入(美分) |
| total_paid_cents | integer | 支付总额(以美分为单位) |
| total_pending_cents | integer | 待付款(以美分为单位) |
| referrals | object[] |
响应示例
{
"referral_code": "x7k9m2",
"referral_rate": 20,
"total_earned_cents": 400,
"total_paid_cents": 200,
"total_pending_cents": 200,
"referrals": [
{
"id": "cm5ref001",
"domains": [
"friend-site.com"
],
"earned_cents": 200,
"paid_out": true,
"created_at": "2025-01-20T10:00:00.000Z"
},
{
"id": "cm5ref002",
"domains": [
"another.dev"
],
"earned_cents": 200,
"paid_out": false,
"created_at": "2025-02-10T15:30:00.000Z"
}
]
}示例
curl https://domani.run/api/referrals \ -H "Authorization: Bearer domani_sk_xxx"
域名预订
/api/backorders对已占用的域名进行抢注预订
监控当前由他人注册的域名,并在其可用时自动尝试为您注册。系统每隔几分钟检查一次可用性,以便在释放后迅速处理。无需预付费用,只有注册成功才会扣款。价格上限可避免释放前注册价格上涨导致支出失控。 需要保存付款方式(银行卡)或使用 payment_method: "balance",以便在注册成功时付款。无法保证成功;竞争激烈的域名可能被专业服务商率先注册。
请求正文
| domain* | string | 当前已被注册、需要监控并在释放时尝试注册的域名。 |
| max_price | number | 注册该域名愿意支付的最高金额(USD)。默认为当前注册价格,且必须 >= 当前价格。 |
| payment_method | string(card | balance) | 注册成功时使用的付款方式。默认为您的首选方式。 |
回应 201
| backorder | Backorder | |
| hint | string |
示例
curl -X POST https://domani.run/api/backorders \
-H "Authorization: Bearer domani_sk_xxx" \
-H "Content-Type: application/json" \
-d '{"domain": "taken.com"}'/api/backorders列出您的抢注预订
按从新到旧返回您的域名抢注订单。可按 status(watching、caught、failed、cancelled、expired)筛选。
参数
| status | string(watching | caught | failed | cancelled | expired) | 按状态过滤。 |
回应 200
| backorders | Backorder[] |
/api/backorders/{id}获取抢注预订
参数
| id* | string | 抢注预订 ID。 |
回应 200
| backorder | Backorder |
/api/backorders/{id}取消抢注预订
停止监视域。只能取消处于watching状态的抢注预订。
参数
| id* | string | 抢注预订 ID。 |
回应 200
| id | string | |
| status | string | |
| hint | string |
市场
/api/domains/sell挂牌出售域名(公开市场)
在 Domani 市场挂牌出售任何域名,包括由其他注册商管理的域名。Domani 帐户中已有的域名会自动验证并立即挂牌(状态为 active)。外部域名需要进行 TXT 所有权验证(状态为 pending_verification)。 费用: 成交后收取 10% 的平台佣金。 需要 deals:write 范围。
请求正文
| domain* | string | 待售域名 |
| price* | number | 销售价格(美元) |
| description | string | 可选挂牌描述 |
回应 201
| listing | object | |
| txt_record | object | null | 要添加用于所有权验证的 TXT 记录(仅适用于外部域) |
| hint | string |
/api/domains/sell/verify验证外部挂牌的 TXT 所有权
验证是否已为外部域挂牌添加 TXT 所有权记录。成功后,挂牌状态将从pending_verification更改为active并变为可购买。 需要 deals:write 范围。
请求正文
| domain* | string | 需要验证的域名 |
回应 200
| listing | object | |
| hint | string |
/api/domains/sell/status检查挂牌和交易状态
检查域名挂牌的状态和任何有效交易。返回挂牌详细信息、交易渠道状态和上下文提示。 需要 deals:read 范围。
参数
| domain* | string | 需要检查的域名 |
回应 200
| listing | object | null | |
| deal | object | null | |
| hint | string |
/api/deals列出您的交易
列出您作为买家或卖家的市场交易。按角色或状态过滤。 需要 deals:read 范围。
参数
| role | string(buyer | seller) | 按角色过滤 |
| status | string(active | escrow_held | epp_pending | transfer_started | completed | refunded | expired) | 按状态过滤(“active”=所有非终端) |
| domain | string | 按域名过滤 |
| limit | integer | 返回的交易数量(默认 50,最多 100) |
| cursor | string | 来自先前响应的分页光标 |
回应 200
| deals | object[] | |
| has_more | boolean | 是否有更多结果可用 |
| next_cursor | string | null | 光标指向下一页 |
/api/deals购买外部域名(创建交易)
创建托管交易以购买市场上已挂牌的域名。买家的付款由第三方托管,直至域名转移完成。卖家会收到通知,并有 7 天时间提供 EPP/授权码。 需要 domains:transfer 范围。
请求正文
| domain* | string | 需要购买的域名 |
| payment_method | string(card | usdc | balance) | 付款方式:“card”(默认)、“usdc”或“balance”(市场信用)。 |
回应 201
| deal | object | |
| hint | string | |
| next_steps | string[] |
/api/deals/{id}通过时间表获取交易详细信息
获取交易的完整详细信息,包括价格明细、截止日期和活动时间表。买家和卖家都可以访问他们的交易。 需要 deals:read 范围。
参数
| id* | string | 交易 ID |
回应 200
| deal | object | |
| hint | string |
/api/deals/{id}提供EPP/授权码(卖家)
卖家提供 EPP/授权代码来启动域名转移。该代码静态加密并用于启动注册商传输。最多尝试 3 次。 需要 deals:write 范围。
参数
| id* | string | 交易 ID |
请求正文
| auth_code* | string | 当前注册商的 EPP/授权码 |
回应 200
| deal | object | |
| hint | string |
/api/deals/{id}/invoice获取交易收据/报表
返回市场交易的角色感知发票。买家获得购买收据;卖家会收到一份显示销售情况、平台佣金额度和净支出的报表。适用于每种付款方式(卡/USDC/余额)。需要 deals:read 范围。
参数
| id* | string |
回应 200
| invoice | DealInvoice |
/api/negotiations列出您的谈判
列出您作为买方或卖方的价格谈判。交易对手是匿名的(仅角色)。需要 deals:read 范围。
参数
| role | string(buyer | seller) | 按您的角色过滤 |
| status | string | 按状态过滤(open|agreed|completed|declined|expired|cancelled|all) |
回应 200
| negotiations | Negotiation[] |
/api/negotiations对挂牌域名报价
针对有效挂牌域名发起匿名价格协商并提交初始报价。卖家可以还价、接受或拒绝。接受后,买家完成付款,并按商定价格创建交易。需要 deals:write 范围。
请求正文
| domain* | string | 要协商的已挂牌域名 |
| offer* | number | 初始报价(美元) |
| message | string | 给卖家的可选消息 |
回应 201
| negotiation | Negotiation |
示例
curl -X POST https://domani.run/api/negotiations \
-H "Authorization: Bearer domani_sk_xxx" \
-H "Content-Type: application/json" \
-d '{"domain":"example.com","offer":500}'/api/negotiations/{id}获取谈判线索
返回带有完整报价线程的交易协商,匿名(报价标记为“you”或“counterparty”)。需要 deals:read 范围。
参数
| id* | string |
回应 200
| negotiation | Negotiation |
/api/negotiations/{id}抗辩、接受或拒绝
轮到您时,对桌面上的当前报价做出回应。 counter 需要一个新的金额; accept 将价格锁定在当前桌面上的金额; decline结束交易协商。需要 deals:write 范围。
参数
| id* | string |
请求正文
| action* | string(counter | accept | decline) | |
| counter | number | 新的美元金额(当操作 = 计数器时需要) |
| message | string |
回应 200
| negotiation | Negotiation |
/api/negotiations/{id}撤回谈判
买方撤回公开或商定的谈判。需要 deals:write 范围。
参数
| id* | string |
回应 200
| cancelled | boolean |
/api/negotiations/{id}/finalize完成商定的谈判(付费)
买方支付约定的价格以创建托管交易,然后运行标准转移流程。接受与市场购买相同的付款方式(卡、USDC、x402)。如果未提供付款,则返回 402 并附有付款说明。对于经纪人来源的收购,如果商定的价格高于您设置的max_budget,则返回 409BUDGET_EXCEEDED - 使用confirm_over_budget: true重新提交以继续。需要domains:transfer范围。
参数
| id* | string |
请求正文
| payment_method | string(card | usdc | balance) | |
| payment_signature | string | null | |
| payment_tx | string | |
| payment_chain | string | |
| confirm_over_budget | boolean | 对于经纪商交易:即使商定的价格超出您设置的 max_budget,仍继续进行。 |
/api/broker列出您的经纪人请求
列出您的域获取请求及其状态。需要 deals:read 范围。
参数
| status | string | 按状态或“all”过滤 |
回应 200
| requests | BrokerRequest[] |
/api/broker请求获取已占用的域
请 domani 代表您收购指定的已注册、未挂牌域名。智能体通过 RDAP 寻找所有者,以匿名方式联系并协商;仅在成交时收取佣金,无预付费用。所有者表示有意后会开启匿名协商。注意:许多所有者因 GDPR 隐去 WHOIS 信息而无法联系,此时请求将以 no_contact 结束。需要 deals:write 范围。
请求正文
| domain* | string | 您想要的域名 |
| max_budget | number | 您的美元上限(可选) |
回应 201
| request | BrokerRequest |
示例
curl -X POST https://domani.run/api/broker \
-H "Authorization: Bearer domani_sk_xxx" \
-H "Content-Type: application/json" \
-d '{"domain":"dream.com","max_budget":5000}'/api/broker/{id}获取经纪人请求
返回您的经纪人请求之一。需要 deals:read 范围。
参数
| id* | string |
回应 200
| request | BrokerRequest |
/api/broker/{id}取消经纪人请求
取消活动域获取请求。需要 deals:write 范围。
参数
| id* | string |
回应 200
| cancelled | boolean |
/api/broker/respond公共读取经纪人查询的状态(所有者方)
所有者智能体读取路径:在采取行动之前使用您的token轮询当前的匿名查询状态。返回域、买家在表中的报价、谁的举动以及现在可用的操作。切勿暴露买家的身份或预算。令牌授权。
参数
| token* | string | 您的查询电子邮件中的外展令牌。 |
回应 200
| domain | string | |
| status | string | |
| your_turn | boolean | 不管是主人的举动。 |
| current_offer_usd | number | null | 买家的报价摆在桌面上。 |
| agreed_price_usd | number | null | |
| actions | string[] | 现在可用的操作(offer/counter/accept/decline/opt_out 的子集)。 |
示例
curl "https://domani.run/api/broker/respond?token=<from your inbox>"
/api/broker/respond公共回复经纪人询问(域名所有者方)
所有者-智能体路径:使用发送到您收件箱的外展电子邮件中的token来响应经纪人的收购查询 - 这是通过电子邮件回复或单击人工索赔链接的完全自主替代方案。 offer/counter 以您的要价开启或推进匿名谈判; decline 和 opt_out 结束它。令牌授权(令牌是能力)- 不需要帐户或范围。
请求正文
| token* | string | 您的查询电子邮件中的外展令牌(回复为经纪人+<令牌>@)。 |
| action* | string(offer | counter | accept | decline | opt_out) | 使用 offer/counter 指定价格;accept 接受买家当前报价;decline 拒绝;opt_out 表示不再接受联系。 |
| price | number | 您的美元要价(报价/还价所需)。 |
回应 200
| handled | boolean | |
| outcome | string | 状态值:opted_out | declined | negotiation_opened | countered | ignored_not_your_turn | unclear |
| status | string | |
| negotiation_id | string | |
| domain | string |
示例
curl -X POST https://domani.run/api/broker/respond \
-H "Content-Type: application/json" \
-d '{"token":"<from your inbox>","action":"offer","price":800}'Auth
/api/oauth/register注册 OAuth 客户端(RFC 7591)
面向支持 OAuth 的 MCP 客户端(Claude.ai、ChatGPT、Grok Bot 连接器)的动态客户端注册。开放注册:它本身不授予任何权限 - 每次授权仍需经过用户授权页面。公共客户端(token_endpoint_auth_method=none)必须使用 PKCE S256。发现地址:/.well-known/oauth-authorization-server。
请求正文
| redirect_uris* | string[] | 精确的重定向 URI(https、环回地址上的 http,或原生自定义 scheme) |
| client_name | string | 显示在授权页面上 |
| token_endpoint_auth_method | string(none | client_secret_post | client_secret_basic) | |
| client_uri | string | |
| logo_uri | string |
回应 201
| client_id | string | |
| client_name | string | |
| redirect_uris | string[] | |
| token_endpoint_auth_method | string | |
| grant_types | string[] | |
| response_types | string[] | |
| client_id_issued_at | integer | |
| client_secret | string | 仅适用于机密客户端;仅返回一次 |
/api/oauth/tokenOAuth 令牌端点
使用授权码(附带 PKCE code_verifier)换取访问令牌,或使用 grant_type=refresh_token 进行轮换。访问令牌是普通的 domani API 令牌,携带已批准的范围和邮箱限定。授权码为一次性使用;刷新令牌每次使用时都会轮换。
回应 200
| access_token | string | |
| token_type | string | |
| expires_in | integer | |
| refresh_token | string | |
| scope | string |