hosting
PUT /v1/sites/{siteId}/maintenance-mode
Take a site into or out of maintenance.
Autenticación
Envía una clave de API como token de portador. La clave debe tener el permiso sites.view; una clave que no lo tenga se rechazará con un código 403, no 404.
Este endpoint no requiere ningún id de organización. Su clave ya identifica la organización a la que pertenece, y la respuesta está delimitada a ella.
Pruébalo
Reemplaza cualquier elemento entre corchetes angulares por tus propios valores, y el marcador de posición key con una clave de tu panel de control.
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> }'¿Has iniciado sesión? La consola de la API en tu panel de control rellena el ID de tu organización real y tu propia clave, y ejecuta la solicitud contra la API en vivo para que puedas ver la respuesta real. Abre este endpoint en la consola de la API
Detalles
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.
Parámetros
| Nombre | Tipo | Obligatorio | ¿Qué es esto? |
|---|---|---|---|
siteId (path) | Uuid | Sí | Site ID (UUIDv7). |
Cuerpo de la solicitud
| Nombre | Tipo | Obligatorio | ¿Qué es esto? |
|---|---|---|---|
enabled | boolean | Sí | 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… |
Respuesta
| Nombre | Tipo | Obligatorio | ¿Qué es esto? |
|---|---|---|---|
available | boolean | Sí | Whether the package exposes maintenance mode at all. False renders an explanation rather than an empty list. |
enabled | boolean | Sí | ⛔ `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[] | Sí | Each alias on the package and its own state. |
permitted | boolean | Sí | Whether the package type includes maintenance mode. An absent vendor capability is a **refusal**, never an assumption that it is probably on. |
Errores que este endpoint puede devolver
401 · 403 · 404 · 409 · 422 · 429 · 503