hosting

POST /v1/sites/{siteId}/repo/sync/run

Sync this site with its repository now.

All hosting endpoints

Authentication

Send an API key as a bearer token. The key must carry the hosting.deploy.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 POST https://api.zinndigital.com/v1/sites/{siteId}/repo/sync/run \
  -H "Authorization: Bearer zdk_live_…"

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

Commits whatever has changed in the site's files and pushes it to the connected branch. A 200 whose `state` is `conflict` or `adopt` is a successful call reporting a HELD sync — the repository moved since we last agreed with it, so nothing was pushed and nothing was overwritten on either side. Never force-pushes and never merges. Requires `hosting.deploy.manage`.

Parameters

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

Response

NameTypeRequiredWhat it is
site_idstringYes
enabledbooleanYesWhether the customer has switched two-way sync on.
availablebooleanYesWhether it is permitted at all — true only once the customer has connected their OWN git account. False here makes `enabled` irrelevant; the engine will not sync either way.
unavailable_reasonstringNoA sentence the customer reads when `available` is false. Null when it is available.
subdirstringNoWhich directory of the site syncs. Empty means the whole document root.
statestring<idle, synced, conflict, adopt, error>Yes`conflict` and `adopt` are HELD, not failed — the sync stopped on purpose and is waiting for the customer to choose a side.
branchstringNo
repositorystringNo`owner/repo`, or null when no repository is connected.
conflict_commitstringNoThe commit in the repository that we have not seen — the one the customer needs to look at before choosing. Null unless held.
last_sync_atstringNo
last_sync_notestringNo
runsSiteRepoSyncRun[]YesThe most recent runs, newest first. Includes the no-ops.

Errors this endpoint can return

401 · 403 · 404 · 422 · 429