hosting

POST /v1/sites/{siteId}/redirects

Add a redirect to a site.

सभी hosting एंडपॉइंट्स

प्रमाणन

बेरर टोकन के रूप में एक API कुंजी भेजें। कुंजी के पास sites.view अनुमति होनी चाहिए; इसके बिना एक कुंजी को 404 के बजाय 403 के साथ अस्वीकार कर दिया जाता है।

यह एंडपॉइंट कोई संगठन आईडी नहीं लेता है। आपकी कुंजी पहले से ही उस संगठन की पहचान करती है जिससे वह संबंधित है, और प्रतिक्रिया उसी के दायरे में है।

इसे आज़माएँ

कोणार्कित ब्रैकेट्स में दी गई किसी भी चीज़ को अपने मानों से बदलें, और की प्लेसहोलर को अपने डैशबोर्ड की एक की से बदलें।

curl -X POST https://api.zinndigital.com/v1/sites/{siteId}/redirects \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "domain": <string>, "path": <string>, "destination": <string> }'

साइन इन हैं? आपके डैशबोर्ड में मौजूद API कंसोल आपकी वास्तविक संगठन आईडी और आपकी अपनी कुंजी स्वतः भर देता है, और लाइव API के विरुद्ध अनुरोध चलाता है ताकि आप वास्तविक प्रतिक्रिया देख सकें। इस एंडपॉइंट को API कंसोल में खोलें

विवरण

Adds one rule. ⛔ **The vendor endpoint behind this is a whole-set write**, so the engine reads the existing rules, appends, and sends the set back — last writer wins. Two people adding a redirect at the same moment is the one case where one of the two additions is lost, and there is no vendor primitive that would prevent it. `destination` is checked before anything is written to the customer's `.htaccess`: a protocol-relative `//evil.example/` passes a naive "starts with a slash" test and redirects the site's visitors to somebody else's server, so it is refused `422` here. `type` is a closed set (`301`, `302`) checked in this layer **and** in the driver, because the platform types it as a free string and an unreviewed token would be written straight into the file. `404` for a site with no managed hosting package. Requires `sites.view` and `sites.panel_access`.

पैरामीटर

नामप्रकारआवश्यकयह क्या है
siteId (path)UuidहाँSite ID (UUIDv7).

अनुरोध बॉडी

नामप्रकारआवश्यकयह क्या है
domainstringहाँThe domain or alias on the package the rule applies to.
pathstringहाँThe path being redirected. ⛔ Named `path` and never `source` — `source` is a reserved attribute on every serializer field one layer down, and a field of that name silently reads…
destinationstringहाँWhere the visitor is sent. A protocol-relative value is refused: it hands the customer's visitors to another server while looking like a local path.
typestring<301, 302>नहींThe redirect status. `301` is permanent and is cached by browsers and search engines; `302` is temporary. Nothing else is accepted.

प्रतिक्रिया

नामप्रकारआवश्यकयह क्या है
idstringहाँ⛔ **Ours, not the vendor's** — this platform mints no identifier for a redirect, so this encodes the domain/type/path triple that addresses one. Opaque, stable across reads, and…
domainstringहाँThe domain or alias the rule applies to.
pathstringहाँThe path being redirected. ⛔ Named `path` and never `source`, which is a reserved attribute one layer down and would silently read the wrong value.
destinationstringहाँWhere the visitor is sent.
typestring<301, 302>हाँThe redirect status — permanent or temporary.

त्रुटियाँ जो यह एंडपॉइंट लौटा सकता है

401 · 403 · 404 · 409 · 422 · 429 · 503