notifications
PUT /v1/outbound-mail
Attach or replace this organisation's own mail service.
身份验证
请将 API 密钥作为 bearer 令牌发送。此端点在规范中未指明具体的权限,因此请为您的密钥赋予所需的最小权限,并通过检查响应来确认,而不是盲目假设。
您的组织 ID 应填在此处
此端点将 org_id 作为查询参数。不填则调用涵盖您的整个租户子树;发送该参数则将调用范围缩小到一个组织。
您的组织ID位于控制面板的API密钥屏幕上,就在密钥本身的旁边。这是您在每次调用时使用的相同ID。
免费试用
将尖括号中的内容替换为您自己的值,并将键占位符替换为您仪表板中的一个键。
curl -X PUT https://api.zinndigital.com/v1/outbound-mail \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "provider": <string<smtp, mailgun, sendgrid, postmark, ses, resend>>, "from_domain": <string>, "credential": <string> }'已登录?您仪表板中的 API 控制台会自动填入您真实的组织 ID 和您自己的密钥,并针对实时 API 运行请求,以便您查看实际的响应。 在 API 控制台中打开此端点
详细信息
PUT rather than POST because a From header is singular: an organisation has exactly one sending service, and the commonest reason to be on this screen is switching provider. The credential is write-only. It goes straight to the secret vault and the row keeps only a pointer; it is never returned by any endpoint in any state. Attaching does NOT switch the sender. A new or replaced credential resets the account to `unverified`, and only a completed round trip - a real test message, and the code out of it - makes it the From address. A provider that accepts a message and then bounces it is indistinguishable from a working one at the moment of the call, so acceptance is not proof.
参数
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
org_id (query) | string | 否 | The organization to act on. Omitted (or empty) means your own. |
请求正文
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
provider | string<smtp, mailgun, sendgrid, postmark, ses, resend> | 是 | `ses` is Amazon SES over its documented SMTP interface, so the credential is an SES SMTP username and password rather than an AWS access key. |
from_domain | string | 是 | The domain your From address will use - a domain, not an address. The local part still comes from the message type, so a receipt leaves as `billing@` and a password reset as `no… |
credential | string | 是 | The API key, server token or SMTP password. Never returned. |
config | object | 否 | The non-secret settings this provider needs - SMTP host/port/username, Mailgun domain and region, the SES region, the Postmark message stream. The exact fields are returned per… |
响应
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
can_configure | boolean | 是 | Whether this organisation's plan includes its own sending identity - the agency and reseller plans do, a plain client plan does not. A claim about the PLAN, never the authorisat… |
account | OutboundMailAccount | 是 | null when this organisation sends on the platform's account. |
providers | object[] | 是 | The provider catalogue AND the fields each one needs, served from the same definition the API validates against - so the form a customer fills in and the rules it must satisfy c… |
sending_as | string<own, platform> | 是 | Who is actually paying for this organisation's mail right now. `platform` whenever no account is attached OR the attached one has not completed its round trip. |
fallback_notice | string | 是 | Plain-language explanation shown when `sending_as` is `platform`; empty otherwise. Part of the contract rather than presentation - an empty state that does not say who is paying… |
client_orgs_held | integer | 是 | How many client organisations under this one currently have their non-essential notifications held because no own mail provider is connected (owner ruling 2026-09-03). `0` when… |