hosting

POST /v1/sites/{siteId}/moodle-upgrade

Start the one-click Moodle upgrade.

All hosting endpoints

All developer docs →

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

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

Request body

NameTypeRequiredWhat it is
target_releasestringNoThe offered release (available.release), or null for it.

Response

NameTypeRequiredWhat it is
site_idstringYes—
is_moodlebooleanYes—
installedMoodleReleaseYes—
availableMoodleReleaseYesThe highest release this server can run that is newer than installed.
blockedMoodleBlockedRelease[]Yes—
can_upgradebooleanYes—
refusalMoodleRefusalYes—
checked_atstringYes—
check_pendingbooleanYes—
current_runMoodleUpgradeRunYes—
runsMoodleUpgradeRun[]YesNewest first, at most ten.

Errors this endpoint can return

401 · 403 · 404 · 409 · 422 · 429 · 503