Նույնականացում
Ուղարկեք API բանալին որպես bearer token: Բանալին պետք է ունենա members.role.assign թույլտվությունը. առանց դրա բանալին մերժվում է 403, և ոչ թե 404 կարգավիճակով:
Որտեղ տեղադրվում է ձեր կազմակերպության ID-ն
Այս վերջնակետը որպես orgId ընդունում է ձեր կազմակերպության ID-ն հենց URL-ում: Տեղադրեք այն ուղու մեջ. չկա որևէ վերնագիր կամ հարցման պարամետր, որը կարող է փոխարինել դրան:
Ձեր կազմակերպության ID-ն գտնվում է Ձեր ղեկավարման վահանակի API բանալիների էկրանին՝ բուն բանալու կողքին: Այն նույն ID-ն է Ձեր կատարած յուրաքանչյուր հարցման մեջ:
Փորձել
Փոխարինեք անկյունային փակագծերում գտնվող ցանկացած բան ձեր սեփական արժեքներով, և բանալու տեղապահը՝ ձեր վահանակի բանալիով:
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 վահանակը լրացնում է ձեր իրական կազմակերպության ID-ն և ձեր սեփական բանալին և գործարկում է հարցումը ուղիղ 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