hosting

PUT /v1/sites/{siteId}/repo/sync

Turn two-way sync on or off for a site.

تمام hosting اینڈ پوائنٹس

توثيقِ شناخت

ایک بیرر ٹوکن کے طور پر ایک 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).

درخواست کا باڈی

نامقسملازمییہ کیا ہے
enabledbooleanہاں
subdirstringنہیں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_idstringہاں
enabledbooleanہاںWhether the customer has switched two-way sync on.
availablebooleanہاں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_reasonstringنہیںA sentence the customer reads when `available` is false. Null when it is available.
subdirstringنہیںWhich directory of the site syncs. Empty means the whole document root.
statestring<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.
branchstringنہیں
repositorystringنہیں`owner/repo`, or null when no repository is connected.
conflict_commitstringنہیں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_atstringنہیں
last_sync_notestringنہیں
runsSiteRepoSyncRun[]ہاںThe most recent runs, newest first. Includes the no-ops.

وہ خرابیان جو یہ اینڈ پوائنٹ واپس کر سکتا ہے

401 · 403 · 404 · 422 · 429