access

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

Change a member's role.

Bütün access nöqtələri

Bütün tərtibatçı sənədləri

Doğrulama

API açarını bearer token kimi göndərin. Açar members.role.assign icazəsinə malik olmalıdır; bu icazəsi olmayan açar 404 deyil, 403 xətası ilə rədd edilir.

Təşkilatınızın identifikatorunun yerləşdiyi yer

Bu son nöqtə təşkilatınızın identifikatorunu birbaşa URL-də orgId kimi qəbul edir. Onu yola daxil edin — bunun əvəzinə işləyəcək heç bir başlıq və ya sorğu parametri yoxdur.

Təşkilatınızın identifikatoru idarə panelinizdəki API açarları ekranında, açarın özünün yanında yerləşir. Bu, etdiyiniz hər bir sorğuda eyni identifikatordur.

Sınaqdan keçir

Bucaqlı mötərizələrdə olan hór şeyi öz qiymətlərinizlə, açar yertutucusunu isə idarə panelinizdən bir açarla əvəz edin.

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

Sistemə daxil olmusunuz? İdarə panelinizdəki API konsolu real təşkilatınızın identifikatorunu və öz açarınızı avtomatik doldurur, sorğunu canlı API-yə qarşı icra edir ki, siz faktiki cavabı görə biləsiniz. Bu son nöqtəni API konsolunda açın

Təfərrüatlar

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.

Parametrlər

AdTipTələb olunurNədir
orgId (path)UuidBəliOrganization ID (UUIDv7).
userId (path)UuidBəliThe user to remove from the organization.

Sorğu gövdəsi

AdTipTələb olunurNədir
rolestringBəliA role key from GET /v1/orgs/{orgId}/roles.

Cavab

AdTipTələb olunurNədir
user_idUuidBəliUUIDv7 identifier — sortable by creation time (docs/02 §8).
emailstringBəli
namestringBəliDisplay name; may be empty for an account that never set one.
rolesstring[]BəliEvery role this person holds in this org, sorted.
joined_atstringBəliWhen their EARLIEST membership of this org was created.
is_selfbooleanBəliWhether this row is the calling user.
removablebooleanBəli
not_removable_reasonOrgMemberRemovalBlock | nullBəliWhy 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_assignablebooleanBəliWhether 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…

Bu son nöqtənin qaytara biləcəyi xətalar

401 · 403 · 404 · 409 · 422 · 429