POST /v1/mail/services/{mailServiceId}/provider
Move a domain's email to a different provider.
احراز هویت
یک کلید API را به عنوان یک توکن حامل ارسال کنید. این کلید باید دارای مجوز mail.manage باشد؛ کلیدی که فاقد آن باشد با خطای 403 رد میشود، نه 404.
این نقطه پایانی هیچ شناسه سازمانی را دریافت نمیکند. کلید شما در حال حاضر سازمان مربوطه را مشخص میکند و پاسخ در همان محدوده ارائه میشود.
امتحان کنید
هر چیزی را که داخل براکتهای زاویهدار قرار دارد با مقادیر خودتان جایگزین کنید، و نگهدارنده کلید را با کلیدی از داشبورد خود جایگزین نمایید.
curl -X POST https://api.zinndigital.com/v1/mail/services/{mailServiceId}/provider \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "provider": <MailProvider> }'وارد شدهاید؟ کنسول API در داشبورد شما شناسه سازمان واقعی و کلید خودتان را پر میکند و درخواست را روی API زنده اجرا میکند تا بتوانید پاسخ واقعی را ببینید. این نقطه پایانی را در کنسول API باز کنید
جزئیات
Repoints this domain at another mail provider — our own email, Google Workspace or Microsoft 365 — and, when moving **away from ours**, destroys the mailboxes we were hosting for it. ⛔ **Not the same as `DELETE`, and the difference is the post-condition.** A delete ends with no mail service at all; a switch ends with a **live** one on the new provider, publishing that provider's records. Using the delete for this would leave the domain with no email a moment after the customer chose some. **The order is the safety property:** the DNS records are repointed FIRST, and the mailboxes destroyed second. The reverse loses mail — between a destroy and a repoint the MX still names mailboxes that no longer exist, and everything sent in that window bounces. Doing it this way costs a brief period in which both could receive, which is the harmless failure. `confirm_fqdn` — the domain typed back — is **required when the switch destroys mailboxes we run**, and ignored otherwise. Owner ruling 2026-08-14: type the domain, no grace period. The mailboxes and their contents are gone at the vendor the moment this runs. Switching to the provider a domain is already on is a no-op that returns the service, so a retry is idempotent. Requires `mail.manage`.
پارامترها
| نام | نوع | الزامی | چیست |
|---|---|---|---|
mailServiceId (path) | Uuid | بله | Email service ID (UUIDv7). |
بدنه درخواست
| نام | نوع | الزامی | چیست |
|---|---|---|---|
provider | MailProvider | بله | Which provider serves a domain's mail. `custom` is **the reseller's own provider** (W40-MAIL, owner ruling 2026-09-06): a white-label reseller sells mail they buy elsewhere, dec… |
provider_config | MailProviderConfig | null | خیر | Required in effect when `provider` is `custom` (an empty MX list is refused); ignored otherwise. A `custom` → `custom` call with **different** values is a re-declaration — the c… |
confirm_fqdn | string | خیر | The domain, typed back by the customer. **Required when the switch destroys mailboxes we host** — i.e. when moving away from `zinn` on a domain that has any — and ignored otherw… |
پاسخ
| نام | نوع | الزامی | چیست |
|---|---|---|---|
id | Uuid | بله | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
fqdn | string | بله | The domain the mailboxes are on. |
provider_config | MailProviderConfig | null | خیر | The `custom` provider's declared values, served back so the domain screen can show and edit what was declared. `null` on every other provider, whose values are documented and de… |
site | MailServiceSite | null | خیر | The site currently serving this domain, or `null` when no site does. **Derived from the hostname, never stored**: mail attaches to a domain and a domain outlives the site on it,… |
mailbox_provisioning | MailboxProvisioning | بله | Whether **we** pre-create a starter mailbox on this domain. `managed` — we make one when the domain is provisioned (the Footprint-Free/PBN line and our own fleet); `self_service… |
mail_only | boolean | بله | **This domain uses us for mail and nothing else** — an active mail service on a hostname no website of ours serves. Published as one server-side answer because more than one con… |
domain_id | Uuid | null | خیر | The registered domain this serves, when we hold the registration. |
status | MailServiceStatus | بله | A mail service's lifecycle state. |
provider | MailProvider | بله | Which provider serves a domain's mail. `custom` is **the reseller's own provider** (W40-MAIL, owner ruling 2026-09-06): a white-label reseller sells mail they buy elsewhere, dec… |
mailbox_quota_mb | integer | بله | Size of each mailbox in MB, captured when the service was created. |
mailbox_limit | integer | بله | Mailboxes allowed on this domain; `-1` is uncapped. Captured when the service was created; a later downgrade is enforced against the live plan as well, so the number actually ap… |
mailboxes_used | integer | بله | How many mailboxes currently consume the allowance. |
dns_applied_at | object | خیر | When the mail DNS was last published. `null` means never — mailboxes that exist but receive nothing, which is the one state a customer must be told about. |
created_at | string | بله | — |
خطاهایی که این نقطه پایانی میتواند برگرداند
401 · 403 · 404 · 409 · 422 · 429 · 503