hosting
PUT /v1/sites/{siteId}/repo/sync
Turn two-way sync on or off for a site.
ప్రమాణీకరణ
బీయర్ టోకెన్గా API కీని పంపండి. కీ తప్పనిసరిగా hosting.deploy.manage అనుమతిని కలిగి ఉండాలి; అది లేని కీని 404 కాకుండా 403తో తిరస్కరిస్తారు.
ఈ ఎండ్పాయింట్ ఎలాంటి సంస్థ ఐడీని తీసుకోదు. మీ కీ ఇప్పటికే అది ఏ సంస్థకు చెందుతుందో గుర్తిస్తుంది మరియు ప్రతిస్పందన దానికే పరిమితం చేయబడుతుంది.
ప్రయత్నించండి
కోణీయ బ్రాకెట్లలో ఉన్న దేన్నైనా మీ స్వంత విలువలతో భర్తీ చేయండి, మరియు కీ ప్లేస్హోల్డర్ను మీ డాష్బోర్డ్ నుండి తీసుకున్న కీతో భర్తీ చేయండి.
curl -X PUT https://api.zinndigital.com/v1/sites/{siteId}/repo/sync \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "enabled": <boolean> }'సైన్ ఇన్ చేశారా? మీ డ్యాష్బోర్డ్లోని API కాన్సోల్ మీ అసలైన సంస్థ ID మరియు మీ స్వంత కీని నింపుతుంది, అలాగే మీరు అసలైన ప్రతిస్పందనను చూడటానికి లైవ్ API ద్వారా ఆభ్యర్థనను రన్ చేస్తుంది. ఈ ఎండ్పాయింట్ను API కన్సోల్లో తెరిచండి
వివరాలు
Free, and refused with 422 unless the customer has connected their own GitHub account. Turning it on does not push anything by itself — the first run is either the scheduled sweep or an explicit run. Requires `hosting.deploy.manage`.
పారామీటర్లు
| పేరు | రకం | కావలసినది | ఇది ఏమిటి |
|---|---|---|---|
siteId (path) | Uuid | అవును | Site ID (UUIDv7). |
అభ్యర్థన బాడీ
| పేరు | రకం | కావలసినది | ఇది ఏమిటి |
|---|---|---|---|
enabled | boolean | అవును | — |
subdir | string | కాదు | Restrict the sync to one directory of the site. Empty syncs the whole document root, which for a WordPress site is usually not what the customer wants. |
స్పందన
| పేరు | రకం | కావలసినది | ఇది ఏమిటి |
|---|---|---|---|
site_id | string | అవును | — |
enabled | boolean | అవును | Whether the customer has switched two-way sync on. |
available | boolean | అవును | Whether 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_reason | string | కాదు | A sentence the customer reads when `available` is false. Null when it is available. |
subdir | string | కాదు | Which directory of the site syncs. Empty means the whole document root. |
state | string<idle, synced, conflict, adopt, error> | అవును | `conflict` and `adopt` are HELD, not failed — the sync stopped on purpose and is waiting for the customer to choose a side. |
branch | string | కాదు | — |
repository | string | కాదు | `owner/repo`, or null when no repository is connected. |
conflict_commit | string | కాదు | The commit in the repository that we have not seen — the one the customer needs to look at before choosing. Null unless held. |
last_sync_at | string | కాదు | — |
last_sync_note | string | కాదు | — |
runs | SiteRepoSyncRun[] | అవును | The most recent runs, newest first. Includes the no-ops. |
ఈ ఎండ్పాయింట్ తిరిగి ఇవ్వగల లోపాలు
401 · 403 · 404 · 422 · 429