hosting

PUT /v1/sites/{siteId}/maintenance-mode

Take a site into or out of maintenance.

Alle hosting-eindpunten

Authenticatie

Stuur een API-sleutel mee als bearer token. De sleutel moet over de permissie sites.view beschikken; een sleutel zonder deze permissie wordt geweigerd met een 403 in plaats van een 404.

Dit eindpunt vereist geen organisatie-id. Uw sleutel identificeert al de organisatie waartoe deze behoort, en het antwoord is hierop afgestemd.

Probeer het

Vervang alles tussen punthaakjes door uw eigen waarden en de sleutelplaatsvervanger door een sleutel uit uw dashboard.

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> }'

Ingelogd? De API-console in je dashboard vult je echte organisatie-id en je eigen sleutel in, en voert het verzoek uit tegen de live API zodat je de daadwerkelijke respons kunt zien. Open dit eindpunt in de API-console

Details

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.

Parameters

NaamTypeVerplichtWat dit is
siteId (path)UuidJaSite ID (UUIDv7).

Aanvraaglichaam

NaamTypeVerplichtWat dit is
enabledbooleanJaWhether 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…

Reactie

NaamTypeVerplichtWat dit is
availablebooleanJaWhether the package exposes maintenance mode at all. False renders an explanation rather than an empty list.
enabledbooleanJa⛔ `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…
aliasesSiteMaintenanceAlias[]JaEach alias on the package and its own state.
permittedbooleanJaWhether the package type includes maintenance mode. An absent vendor capability is a **refusal**, never an assumption that it is probably on.

Fouten die dit eindpunt kan retourneren

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