hosting
PUT /v1/sites/{siteId}/wordpress/themes/{themeName}
Activate or deactivate a theme on a site.
Autenticazione
Invia una chiave API come token di tipo bearer. La chiave deve disporre dell'autorizzazione sites.view; una chiave sprovvista di tale autorizzazione viene rifiutata con 403 anziché 404.
Questo endpoint non richiede alcun ID organizzazione. La tua chiave identifica già l'organizzazione a cui appartiene e la risposta è limitata ad essa.
Provalo
Sostituisci qualsiasi elemento tra parentesi angolari con i tuoi valori e il segnaposto key con una chiave dalla tua dashboard.
curl -X PUT https://api.zinndigital.com/v1/sites/{siteId}/wordpress/themes/{themeName} \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "active": <boolean> }'Hai effettuato l'accesso? La console API nella tua dashboard inserisce il tuo ID organizzazione reale e la tua chiave personale, ed esegue la richiesta sull'API live in modo da poter vedere la risposta effettiva. Apri questo endpoint nella console API
Dettagli
Switches the site's active theme and returns the whole theme list. Activating a theme changes what every visitor sees immediately, so the client confirms first. Refused `422` when the package type does not carry `wp_themes`, or when WordPress is not installed. `404` for a site with no vendor hosting package. Requires `sites.view` and `sites.panel_access`.
Parametri
| Nome | Tipo | Obbligatorio | Che cos'è |
|---|---|---|---|
siteId (path) | Uuid | Sì | Site ID (UUIDv7). |
themeName (path) | string | Sì | The theme's slug, exactly as `listSiteWordPressThemes` reports it. WordPress's identifier, not ours — percent-encode it. |
Corpo della richiesta
| Nome | Tipo | Obbligatorio | Che cos'è |
|---|---|---|---|
active | boolean | Sì | Whether the theme should be the site's active theme. |
Risposta
| Nome | Tipo | Obbligatorio | Che cos'è |
|---|---|---|---|
data | SiteWordPressTheme[] | Sì | The installed themes. |
Errori che questo endpoint può restituire
401 · 403 · 404 · 409 · 422 · 429 · 503