hosting
PUT /v1/sites/{siteId}/maintenance-mode
Take a site into or out of maintenance.
Uthibitishaji
Tuma ufunguo wa API kama tokeni ya kubeba. Ufunguo lazima uwe na ruhusa ya sites.view; ufunguo usio nayo unakataliwa kwa 403, si 404.
Endpoint hii haichukui kitambulisho cha shirika. Ufunguo wako tayari unalitambua shirika linalohusika, na jibu limewekewa kikomo kwa shirika hilo pekee.
Jaribu
Badilisha chochote kilicho ndani ya mabano ya pembe na maadili yako mwenyewe, na kishikiliaji cha ufunguo na ufunguo kutoka kwa dashibodi yako.
curl -X PUT https://api.zinndigital.com/v1/sites/{siteId}/maintenance-mode \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "enabled": <boolean> }'Umeingia kwenye akaunti? Dashibodi yako ya kiweko cha API inajaza kitambulisho chako halisi cha shirika na ufunguo wako mwenyewe, na kuendesha ombi dhidi ya API ya moja kwa moja ili uweze kuona jibu halisi. Fungua sehemu hii ya mwisho (endpoint) kwenye konsole ya API
Maelezo
Switches every alias at once and returns the whole new state, so the client re-renders from the server's answer rather than from what it asked for. `PUT` because the body states the desired end state: sending the same value twice is the same site. ⛔ The customer's own maintenance-page HTML travels with the vendor's row, and this operation carries it through unchanged. A toggle built from scratch blanks it, replacing a page the customer wrote with a default one — which is why the write reads the existing row first. Turning it **on** takes the site off the internet for every visitor, so the client confirms before calling. Requires `sites.view` **and** `sites.panel_access`. `404` for a site with no managed hosting package.
Vigezo
| Jina | Aina | Inayohitajika | Kilicho hiki |
|---|---|---|---|
siteId (path) | Uuid | Ndiyo | Site ID (UUIDv7). |
Mwili wa ombi
| Jina | Aina | Inayohitajika | Kilicho hiki |
|---|---|---|---|
enabled | boolean | Ndiyo | Whether visitors should be shown the maintenance page. There is no third value: `getSiteMaintenanceMode` may report a mixed set of aliases, but a caller asking to change it must… |
Majibu
| Jina | Aina | Inayohitajika | Kilicho hiki |
|---|---|---|---|
available | boolean | Ndiyo | Whether the package exposes maintenance mode at all. False renders an explanation rather than an empty list. |
enabled | boolean | Ndiyo | ⛔ `true` only when **every** alias is in maintenance. One alias still serving is a live site, and a single rounded boolean would hide that from a customer who believes they took… |
aliases | SiteMaintenanceAlias[] | Ndiyo | Each alias on the package and its own state. |
permitted | boolean | Ndiyo | Whether the package type includes maintenance mode. An absent vendor capability is a **refusal**, never an assumption that it is probably on. |
Hitilafu ambazo mwisho huu unaweza kurudisha
401 · 403 · 404 · 409 · 422 · 429 · 503