hosting
PUT /v1/sites/{siteId}/maintenance-mode
Take a site into or out of maintenance.
Аутентификација
Пошаљите API кључ као bearer токен. Кључ мора имати дозволу sites.view; кључ без ње се одбија уз 403, а не 404.
Ова крајња тачка не прихвата id организације. Ваш кључ већ идентификује организацију којој припада, а одговор је ограничен на њу.
Испробајте
Замените све што је у угластим заградама сопственим вредностима, а чувар места кључа кључем са своје контролне табле.
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> }'Пријављени сте? API конзола на вашој контролној табли попуњава ваш прави id организације и ваш сопствени кључ, и покреће захтев према живом API-ју како бисте могли да видите стварни одговор. Отворите ову крајњу тачку у API конзоли
Детаљи
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.
Параметри
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
siteId (path) | Uuid | Да | Site ID (UUIDv7). |
Тело захтева
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
enabled | boolean | Да | 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… |
Одговор
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
available | boolean | Да | Whether the package exposes maintenance mode at all. False renders an explanation rather than an empty list. |
enabled | boolean | Да | ⛔ 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[] | Да | Each alias on the package and its own state. |
permitted | boolean | Да | Whether the package type includes maintenance mode. An absent vendor capability is a refusal, never an assumption that it is probably on. |
Грешке које ова крајња тачка може вратити
401 · 403 · 404 · 409 · 422 · 429 · 503