Autenticazione
Invia una chiave API come token di tipo bearer. La chiave deve disporre dell'autorizzazione hosting.php.manage; 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}/php-version \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "version": <string> }'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
Sets the site's desired PHP version and returns `202 Accepted`. The target must be a version currently offered for the site's product line (or the site's own current version); anything else is a `422`. A retired version an existing site already runs is kept — this call never forces a migration. Requires `hosting.php.manage`. **The machine serving the site is told before the row is written**, on both lines: one ack-checked vendor call on the resold range, and one idempotent `cloudlinux-selector set --current-version=` on our own fleet. A version the machine refuses is a `422` and the row is left alone, so the platform never claims a runtime the box is not running. `202` therefore under-promises rather than over-promises. A site with no hosting vendor and no placed worker has nothing serving it yet: the desired version is recorded and provisioning applies it. A machine that cannot be **reached at all** — its account does not exist yet, SSH is down, the vendor is unavailable — is a `503`, not a `422` and not a `500`: the request was valid and a retry can succeed. The stored version is left exactly as it was, so a `503` here means nothing changed anywhere.
Parametri
| Nome | Tipo | Obbligatorio | Che cos'è |
|---|---|---|---|
siteId (path) | Uuid | Sì | Site ID (UUIDv7). |
Corpo della richiesta
| Nome | Tipo | Obbligatorio | Che cos'è |
|---|---|---|---|
version | string | Sì | A version offered for the site's product line (or the site's current one). |
Risposta
| Nome | Tipo | Obbligatorio | Che cos'è |
|---|---|---|---|
version | string | Sì | The site's effective PHP version (its own, or its line's default). |
available | string[] | Sì | Versions the site may switch to — those offered for its product line, plus its own current version even if that has since been retired (grandfathered). |
applied | boolean | No | Whether the machine serving this site was actually told, and the change read back off it. Present on the `PUT` response only. `false` is not a failure: it means the site has no… |
Errori che questo endpoint può restituire
401 · 403 · 404 · 422 · 429 · 503