hosting
PUT /v1/sites/{siteId}/wordpress/themes/{themeName}
Activate or deactivate a theme on a site.
Authentifizierung
Senden Sie einen API-Schlüssel als Bearer-Token. Der Schlüssel muss über die Berechtigung sites.view verfügen; ein Schlüssel ohne diese wird mit 403 statt 404 abgelehnt.
Dieser Endpunkt erfordert keine Organisations-ID. Ihr Schlüssel identifiziert bereits die zugehörige Organisation, und die Antwort ist entsprechend eingeschränkt.
Ausprobieren
Ersetzen Sie alles in spitzen Klammern durch Ihre eigenen Werte und den Platzhalter für den Schlüssel durch einen Schlüssel aus Ihrem 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> }'Angemeldet? Die API-Konsole in Ihrem Dashboard trägt automatisch Ihre echte Organisations-ID sowie Ihren eigenen Schlüssel ein und führt die Anfrage gegen die Live-API aus, sodass Sie die tatsächliche Antwort sehen können. Öffnen Sie diesen Endpunkt in der API-Konsole
Details
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`.
Parameter
| Name | Typ | Erforderlich | Was es ist |
|---|---|---|---|
siteId (path) | Uuid | Ja | Site ID (UUIDv7). |
themeName (path) | string | Ja | The theme's slug, exactly as `listSiteWordPressThemes` reports it. WordPress's identifier, not ours — percent-encode it. |
Anfragekörper
| Name | Typ | Erforderlich | Was es ist |
|---|---|---|---|
active | boolean | Ja | Whether the theme should be the site's active theme. |
Antwort
| Name | Typ | Erforderlich | Was es ist |
|---|---|---|---|
data | SiteWordPressTheme[] | Ja | The installed themes. |
Fehler, die dieser Endpunkt zurückgeben kann
401 · 403 · 404 · 409 · 422 · 429 · 503