hosting

PUT /v1/sites/{siteId}/php-version

Switch a site's PHP version.

Tous les points de terminaison hosting

Authentification

Envoyez une clé API en tant que jeton du porteur. La clé doit posséder l'autorisation hosting.php.manage ; une clé qui ne l'a pas est refusée avec le code 403, et non 404.

Cet endpoint ne prend aucun identifiant d'organisation. Votre clé identifie déjà l'organisation à laquelle elle appartient, et la réponse y est limitée.

Essayer

Remplacez tout ce qui se trouve entre crochets par vos propres valeurs, et le espace réservé à la clé par une clé de votre tableau de bord.

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

Connecté ? La console d'API de votre tableau de bord saisit votre véritable ID d'organisation ainsi que votre propre clé, et exécute la requête sur l'API de production afin que vous puissiez voir la réponse réelle. Ouvrir ce point de terminaison dans la console API

Détails

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.

Paramètres

NomTypeObligatoireQu'est-ce que c'est
siteId (path)UuidOuiSite ID (UUIDv7).

Corps de la requête

NomTypeObligatoireQu'est-ce que c'est
versionstringOuiA version offered for the site's product line (or the site's current one).

Réponse

NomTypeObligatoireQu'est-ce que c'est
versionstringOuiThe site's effective PHP version (its own, or its line's default).
availablestring[]OuiVersions the site may switch to — those offered for its product line, plus its own current version even if that has since been retired (grandfathered).
appliedbooleanNonWhether 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…

Erreurs que cet point de terminaison peut renvoyer

401 · 403 · 404 · 422 · 429 · 503