hosting

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

Switch a site's PHP version.

All hosting endpoints

Authentication

Send an API key as a bearer token. The key must carry the hosting.php.manage permission; a key without it is refused with 403, not 404.

This endpoint takes no organisation id. Your key already identifies the organisation it belongs to, and the response is scoped to it.

Try it

Replace anything in angle brackets with your own values, and the key placeholder with a key from your 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> }'

Signed in? The API console in your dashboard fills in your real organisation id and your own key, and runs the request against the live API so you can see the actual response. Open this endpoint in the API console

Details

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.

Parameters

NameTypeRequiredWhat it is
siteId (path)UuidYesSite ID (UUIDv7).

Request body

NameTypeRequiredWhat it is
versionstringYesA version offered for the site's product line (or the site's current one).

Response

NameTypeRequiredWhat it is
versionstringYesThe site's effective PHP version (its own, or its line's default).
availablestring[]YesVersions the site may switch to — those offered for its product line, plus its own current version even if that has since been retired (grandfathered).
appliedbooleanNoWhether 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…

Errors this endpoint can return

401 · 403 · 404 · 422 · 429 · 503