access

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

Change a member's role.

Të gjitha pikat e skajshme access

Autentifikimi

Drgoni një çelës API si një token mbajtës. Çelësi duhet të ketë lejen members.role.assign; një çelës pa të refuzohet me 403, jo 404.

Ku shkon id i organizatës suaj

Ky endpoint merr ID-në e organizatës suaj direkt në URL, si orgId. Zëvendësoni atë në shteg — nuk ka asnjë kokë (header) apo parametër query që bën punë në vend të kësaj.

ID-ja e organizatës suaj ndodhet në ekranin e çelësave API në panelin tuaj të kontrollit, pranë vetë çelësit. Është i njëjti ID në çdo thirrje që bëni.

Provoje

Zëvendësoni çdo gjë brenda kllapave këndore me vlerat tuaja dhe vendbanuesin e çelësit me një çelës nga paneli juaj.

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

Jeni kyçur? Konsola e API-së në panelin tuaj plotëson ID-në tuaj reale të organizatës dhe çelësin tuaj, dhe ekzekuton kërkesën kundrejt API-së live, kështu që ju mund të shihni përgjigjen aktuale. Hapni këtë pikë fundore në konsolën e API-së

Detajet

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.

Parametrat

EmriLlojiKërkohetÇfarë është kjo
orgId (path)UuidPoOrganization ID (UUIDv7).
userId (path)UuidPoThe user to remove from the organization.

Trupi i kërkesës

EmriLlojiKërkohetÇfarë është kjo
rolestringPoA role key from `GET /v1/orgs/{orgId}/roles`.

Përgjigja

EmriLlojiKërkohetÇfarë është kjo
user_idUuidPoUUIDv7 identifier — sortable by creation time (docs/02 §8).
emailstringPo
namestringPoDisplay name; may be empty for an account that never set one.
rolesstring[]PoEvery role this person holds in this org, sorted.
joined_atstringPoWhen their EARLIEST membership of this org was created.
is_selfbooleanPoWhether this row is the calling user.
removablebooleanPo
not_removable_reasonOrgMemberRemovalBlock | nullPoWhy 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_assignablebooleanPoWhether `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…

Gabimet që ky pikëndalim mund të kthejë

401 · 403 · 404 · 409 · 422 · 429