Autentifikatsiya
API kalitini bearer token sifatida yuboring. Kalit members.role.assign ruxsatiga ega boʻlishi shart; ruxsatsiz kalit 404 emas, balki 403 xatosi bilan rad etiladi.
Tashkilotingiz identifikatori kiritiladigan joy
Ushbu so'rov manzili tashkilotingiz identifikatorini URL manzilining o'zida orgId sifatida qabul qiladi. Uni yo'lga o'rnating — buning o'rnini bosadigan sarlavha yoki so'rov parametri mavjud emas.
Tashkilotingiz identifikatori boshqaruv panelingizdagi API kalitlari ekranida, kalitning o'z yonida joylashgan. Bu siz amalga oshiradigan har bir so'rovda bir xil identifikator hisoblanadi.
Sinab ko'rish
Qavslardagi har qanday narsani o'z qiymatlaringiz bilan, kalit pleysxolderini эsa boshqaruv panelingizdagi kalit bilan almashtiring.
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> }'Tizimga kirganmisiz? Boshqaruv panelingizdagi API konsoli haqiqiy tashkilot ID raqamingiz va shaxsiy kalitingizni avtomatik to'ldiradi hamda haqiqiy javobni ko'rishingiz uchun so'rovni jonli API orqali bajaradi. Ushbu yakuniy nuqtani API konsolida oching
Tafsilotlar
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.
Parametrlar
| Nomi | Turi | Majburiy | Nima bu |
|---|---|---|---|
orgId (path) | Uuid | Ha | Organization ID (UUIDv7). |
userId (path) | Uuid | Ha | The user to remove from the organization. |
Soʻrov tanasi
| Nomi | Turi | Majburiy | Nima bu |
|---|---|---|---|
role | string | Ha | A role key from `GET /v1/orgs/{orgId}/roles`. |
Javob
| Nomi | Turi | Majburiy | Nima bu |
|---|---|---|---|
user_id | Uuid | Ha | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
email | string | Ha | — |
name | string | Ha | Display name; may be empty for an account that never set one. |
roles | string[] | Ha | Every role this person holds in this org, sorted. |
joined_at | string | Ha | When their EARLIEST membership of this org was created. |
is_self | boolean | Ha | Whether this row is the calling user. |
removable | boolean | Ha | — |
not_removable_reason | OrgMemberRemovalBlock | null | Ha | 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 | Ha | 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… |
Ushbu yakuniy nuqta qaytarishi mumkin bo'lgan xatolar
401 · 403 · 404 · 409 · 422 · 429