access

PATCH /v1/orgs/{orgId}/members/{userId}

Change a member's role.

Ҳамаи нуқтаҳои ниҳоии access

Санҷиши ҳаққоният

Kaliti API-ро ҳамчун рамзи доранда (bearer token) фиристед. Калит бояд дорои иҷозати members.role.assign бошад; калиди бидуни он бо хатои 403 рад карда мешавад, на 404.

Ҷое, ки рақами мушаххаси ташкилоти шумо ҷойгир аст

Ин нуқтаи ниҳоӣ ID-и ташкилоти шуморо дар худи URL ҳамчун orgId қабул мекунад. Онро ба роҳ ворид кунед — ягон сарлавҳа ё параметри дархосте нест, ки ҷои онро гирад.

Rakami муайянкунандаи ташкилоти шумо дар экрани калидҳои API дар панели идоракунии шумо, дар паҳлӯи худи калид ҷойгир аст. Ин як раками муайянкунанда дар ҳар یک дархосте, ки шумо иҷро мекунед, якхела аст.

Санҷидан

Ҳар чизро дар қаavски кунҷӣ бо қиматҳои худ ва ҷойи нигоҳдорандаи калидро бо калима аз панели идоракунии худ иваз кунед.

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> }'

Воarid шудаед? Консоли 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.

Ҷисми дархост

НомНамудТалаб карда мешавадИн чӣ аст
rolestringБалеA role key from `GET /v1/orgs/{orgId}/roles`.

Ҷавоб

НомНамудТалаб карда мешавадИн чӣ аст
user_idUuidБалеUUIDv7 identifier — sortable by creation time (docs/02 §8).
emailstringБале
namestringБалеDisplay name; may be empty for an account that never set one.
rolesstring[]БалеEvery role this person holds in this org, sorted.
joined_atstringБалеWhen their EARLIEST membership of this org was created.
is_selfbooleanБалеWhether this row is the calling user.
removablebooleanБале
not_removable_reasonOrgMemberRemovalBlock | 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_assignablebooleanБале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