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 کنسول آپ کی حقیقی تنظیم کی آئی ڈی اور آپ کی اپنی کلید خود بخود پُر کر دیتا ہے، اور لائیو 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