توثيقِ شناخت
ایک بیرر ٹوکن کے طور پر ایک API کی بھیجیں۔ کی کے پاس members.role.assign اجازت ہونی چاہیے؛ اس کے بغیر کی کو 404 کے بجائے 403 کے ساتھ مسترد کر دیا جاتا ہے۔
جہاں آپ کی تنظیم کی آئی ڈی آتی ہے
یہ اینڈ پوائنٹ URL میں ہی آپ کی تنظیم کی شناخت (organization id) بطور orgId لیتا ہے۔ اسے پاتھ میں تبدیل کریں — ایسا کوئی ہیڈر یا کیوری پیرامیٹر نہیں ہے جو اس کی جگہ لے سکے۔
آپ کی تنظیم کی آئی ڈی آپ کے ڈیش بورڈ پر API کیز کی سکرین پر، خود کلید کے ساتھ موجود ہوتی ہے۔ یہ آپ کی کی جانے والی ہر کال میں ایک ہی آئی ڈی ہوتی ہے۔
آزمائیں
کوئی بھی چیز جو زاویہ دار قوسین میں ہو اسے اپنی اقدار سے بدلیں، اور کلیدی پلیس ہولڈر کو اپنے ڈیش بورڈ کی کسی کلید سے بدلیں۔
curl -X PATCH https://api.zinndigital.com/v1/orgs/{orgId}/members/{userId} \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "role": <string> }'لاگ ان ہیں؟ آپ کے ڈیش بورڈ میں موجود API کنسول آپ کی حقیقی تنظیم کی آئی ڈی اور آپ کی اپنی کلید خود بخود پُر کر دیتا ہے، اور لائیو API پر درخواست چلاتا ہے تاکہ آپ اصل ردعمل دیکھ سکیں۔ اس اینڈ پوائنٹ کو API کنسول میں کھولیں
تفصیلات
Sets this member's role in the organization. Requires `members.role.assign` **on that org**. ⛔ **Replaces** the member's roles with the one given rather than adding to them — a person may hold several `Membership` rows, and collapsing them can only ever reduce what they hold, so no path through this endpoint escalates by accident. Three refusals, and they are the same rules an invitation is held to: **403** if the member holds a permission the caller does not (`more_privileged`), **403** if the *role being granted* holds one (`role_not_grantable` — this is what stops any holder of the key promoting themselves to `owner`), and **409** for the org's last owner (`last_owner`). An unknown role is a **422**, never a 403, so a typo is distinguishable from a permission you lack.
پیرامیٹرز
| نام | قسم | لازمی | یہ کیا ہے |
|---|---|---|---|
orgId (path) | Uuid | ہاں | Organization ID (UUIDv7). |
userId (path) | Uuid | ہاں | The user to remove from the organization. |
درخواست کا باڈی
| نام | قسم | لازمی | یہ کیا ہے |
|---|---|---|---|
role | string | ہاں | A role key from `GET /v1/orgs/{orgId}/roles`. |
جواب
| نام | قسم | لازمی | یہ کیا ہے |
|---|---|---|---|
user_id | Uuid | ہاں | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
email | string | ہاں | — |
name | string | ہاں | Display name; may be empty for an account that never set one. |
roles | string[] | ہاں | Every role this person holds in this org, sorted. |
joined_at | string | ہاں | When their EARLIEST membership of this org was created. |
is_self | boolean | ہاں | Whether this row is the calling user. |
removable | boolean | ہاں | — |
not_removable_reason | OrgMemberRemovalBlock | null | ہاں | Why not, when `removable` is false. Null when removable — and also null for a caller lacking `members.remove`, because "you cannot remove anyone here" is a fact about the caller… |
role_assignable | boolean | ہاں | Whether `PATCH` on this member would be accepted — the caller holds `members.role.assign` here, does not outrank themselves, and this is not the last owner. ⛔ *Which* role may t… |
وہ خرابیان جو یہ اینڈ پوائنٹ واپس کر سکتا ہے
401 · 403 · 404 · 409 · 422 · 429