hosting

PATCH /v1/sites/{siteId}/cdn/canonical-host

Choose www or non-www, and whether to force HTTPS.

جميع نقاط نهاية hosting

المصادقة

أرسل مفتاح واجهة برمجة التطبيقات (API key) كرمز حامل (bearer token). يجب أن يحمل المفتاح إذن hosting.cdn.manage؛ والمفتاح الذي لا يملكه يُرفض بالرمز 403 وليس 404.

لا يقبل هذا الطرف أي معرف للمؤسسة. يحدد مفتاحك بالفعل المؤسسة التي ينتمي إليها، وتكون الاستجابة محصورة في نطاقها.

جربه الآن

استبدل أي شيء بين أقواس زاوية بقيمك الخاصة، والعنصر النائب للمفتاح بمفتاح من لوحة تحكمك.

curl -X PATCH https://api.zinndigital.com/v1/sites/{siteId}/cdn/canonical-host \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{  }'

هل سجلت الدخول؟ تقوم وحدة تحكم واجهة برمجة التطبيقات في لوحة التحكم الخاصة بك بربط معرف مؤسستك الحقيقي ومفتاحك الخاص، وتنفذ الطلب مقابل واجهة برمجة التطبيقات المباشرة لتتمكن من رؤية الاستجابة الفعلية. افتح هذه النهاية الطرفية في وحدة تحكم API

التفاصيل

A **merge**: only the fields present in the body change. An absent field is left alone rather than reset, so a client written before one of these existed cannot switch it off on every save. `force_https` defaults to `true` on every new site. The insecure choice has to be made explicitly; it is never reached by omitting a field. A site whose primary domain is a **deeper subdomain** (`shop.blog.example.com`) has no `www` counterpart, and the request is a `422` rather than a stored preference whose plan can never be built. Refusing at write time is deliberate: the alternative saves cleanly and then fails later inside provisioning, where the customer sees a stuck deploy instead of the bad input. An empty body is a `422`, not a no-op success. Requires `hosting.cdn.manage`.

المعلمات

الاسمالنوعمطلوبما هو هذا
siteId (path)UuidنعمSite ID (UUIDv7).

جسم الطلب

الاسمالنوعمطلوبما هو هذا
canonical_hoststring<apex, www>لا
force_httpsbooleanلا

الاستجابة

الاسمالنوعمطلوبما هو هذا
canonical_hoststring<apex, www>نعم
force_httpsbooleanنعمRedirect http to https at the edge. Defaults to true on every new site.
serves_onstringنعمThe hostname that actually serves.
redirects_fromstringنعمThe hostname that permanently redirects to `serves_on`.
redirect_statusintegerنعمAlways 301. A 302 tells search engines to keep indexing the alias, which leaves the duplicate-content problem unsolved while looking correct in a browser.
certificate_hostsstring[]نعم**Both** hostnames, always. TLS is negotiated on the name being redirected from, so a certificate covering only `serves_on` puts a security interstitial in front of the alias an…
apex_deliverystring<native, alias, a_records, unsupported>نعمHow the zone apex is made to resolve. A bare apex cannot be a `CNAME`, so on a pull-zone CDN it resolves only through CNAME-flattening/ALIAS at the DNS provider, or through A/AA…
apex_deliverablebooleanنعم`false` when neither mechanism is available for this CDN/DNS pairing. The combination is refused rather than accepted, because the alternative provisions cleanly, reports health…

الأخطاء التي يمكن أن تُرجعها نقطة النهاية هذه

401 · 403 · 404 · 422 · 429