hosting

POST /v1/sites/{siteId}/redirects

Add a redirect to a site.

सर्व hosting एंडपॉइंट्स

प्रमाणीकरण

बेरर टोकन म्हणून API की पाठवा. की मध्ये sites.view परवानगी असणे आवश्यक आहे; ती नसलेली की 404 ऐवजी 403 सह नाकारली जाते.

या एंडपॉइंटला कोणतीही संस्था आयडी (organisation id) लागत नाही. तुमची की (key) आधीच ती कोणत्या संस्थेशी संबंधित आहे हे ओळखते आणि प्रतिसाद त्यानुसार मर्यादित केला जातो.

प्रयत्न करा

कोनसांस्कृतिक कंसात (<>) असलेली कोणतीही गोष्ट तुमच्या स्वतःच्या मूल्यांनी बदला आणि key प्लेसहोल्डरला तुमच्या डॅशबोर्डवरील किने बदला.

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 विरुद्ध विनंती कार्यान्वित करतो जेणेकरून तुम्हाला वास्तविक प्रतिसाद पाहता येईल. एपी कन्सोलमध्ये हा एंडपॉइंट उघडा

तपशील

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