notifications
PUT /v1/outbound-mail
Attach or replace this organisation's own mail service.
المصادقة
أرسل مفتاح واجهة برمجة التطبيقات (API) كرمز حامل (bearer token). لا يحدد نقطة النهاية هذه إذنًا محددًا في المواصفات، لذا امنح مفتاحك الحد الأدنى الذي محتاجه وتحقق من الاستجابة بدلاً من الافتراض.
حيث يتم إدخال معرف مؤسستك
تأخذ نقطة النهاية هذه org_id كمعلمة استعلام. اتركه فارغاً ليغطي الاستدعاء شجرة مستأجريك بالكامل، أو أرسله لتضييق نطاق الاستدعاء ليشمل منظمة واحدة.
معرف مؤسستك موجود على شاشة مفاتيح واجهة برمجة التطبيقات (API) في لوحة تحكمك، بجوار المفتاح نفسه. وهو نفس المعرف في كل طلب تجريه.
جربه الآن
استبدل أي شيء بين أقواس زاوية بقيمك الخاصة، والعنصر النائب للمفتاح بمفتاح من لوحة تحكمك.
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
التفاصيل
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… |