Упълномощаване
Изпратете API ключ като токен за носене. Ключът трябва да притежава разрешението members.role.assign; ключ без него се отхвърля с 403, а не с 404.
Където отива идентификаторът на вашата организация
Този краен пункт приема идентификатора на вашата организация директно в URL адреса като 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, за да можете да видите действителния отговор. Отворете този крайpoint в 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… |
Грешки, които този крайpoint може да върне
401 · 403 · 404 · 409 · 422 · 429