hosting
POST /v1/sites/{siteId}/moodle-upgrade
Start the one-click Moodle upgrade.
Authentication
Send an API key as a bearer token. The key must carry the sites.view 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 POST https://api.zinndigital.com/v1/sites/{siteId}/moodle-upgrade \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'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
Starts a Temporal workflow that backs up the files and database, switches maintenance mode on, installs the offered release, runs Moodle's non-interactive upgrade, and health-checks the site (login page, Moodle's environment check, cron). Any failure restores the backup automatically: the run ends rolled_back and the site is back on the release it had. target_release null takes the offered release; any other value must equal available.release. Refused with 409 MOODLE_UPGRADE_REFUSED and a refusal.moodleUpgrade.* key (not checked yet, up to date, an upgrade already running, a release this server cannot run). Requires sites.view and hosting.applications.manage.
Parameters
| Name | Type | Required | What it is |
|---|---|---|---|
siteId (path) | Uuid | Yes | Site ID (UUIDv7). |
Request body
| Name | Type | Required | What it is |
|---|---|---|---|
target_release | string | No | The offered release (available.release), or null for it. |
Response
| Name | Type | Required | What it is |
|---|---|---|---|
site_id | string | Yes | — |
is_moodle | boolean | Yes | — |
installed | MoodleRelease | Yes | — |
available | MoodleRelease | Yes | The highest release this server can run that is newer than installed. |
blocked | MoodleBlockedRelease[] | Yes | — |
can_upgrade | boolean | Yes | — |
refusal | MoodleRefusal | Yes | — |
checked_at | string | Yes | — |
check_pending | boolean | Yes | — |
current_run | MoodleUpgradeRun | Yes | — |
runs | MoodleUpgradeRun[] | Yes | Newest first, at most ten. |
Errors this endpoint can return
401 · 403 · 404 · 409 · 422 · 429 · 503