Аутентификация
API кілтін bearer токені ретінде жіберіңіз. Кілтте members.role.assign рұқсаты болуы тиіс; онсыз кілтке 404 емес, 403 қатесі қайтарылады.
Ұйымыңыздың идентификаторы орналасатын жер
Бұл соңғы нүкте 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 арқылы орындайды. Бұл соңғы нүктені 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.
Параметрлер
| Аты | Tүрі | Міндетті | Мазмұны |
|---|---|---|---|
orgId (path) | Uuid | Иә | Organization ID (UUIDv7). |
userId (path) | Uuid | Иә | The user to remove from the organization. |
Сұрау денесі
| Аты | Tүрі | Міндетті | Мазмұны |
|---|---|---|---|
role | string | Иә | A role key from `GET /v1/orgs/{orgId}/roles`. |
Жауап
| Аты | Tүрі | Міндетті | Мазмұны |
|---|---|---|---|
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