access

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

Change a member's role.

Minden access végpont

Hitelesítés

Küldjön egy API-kulcsot bearer tokenként. A kulcsnak rendelkeznie kell a(z) members.role.assign jogosultsággal; az ezzel nem rendelkező kulcsok esetén a rendszer 403-as hibát ad vissza 404 helyett.

A szervezet azonosítójának helye

Ez a végpont magában az URL-ben várja a szervezeted azonosítóját, mégpedig orgId formában. Helyettesítsd be az útvonalba – nincs olyan fejléc vagy lekérdezési paraméter, amely ezt helyettesítené.

A szervezeted azonosítója a vezérlőpult API-kulcsok képernyőjén található, közvetlenül a kulcs mellett. Ez ugyanaz az azonosító minden indított hívásban.

Próbálja ki

Cserélje ki a hegyes zárójelek közötti részt a saját értékeivel, a kulcshelyőrzőt pedig a vezérlőpultján található kulccsal.

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

Be van jelentkezve? A vezérlőpultban lévő API-konzol kitölti a valós szervezetazonosítóját és a saját kulcsát, és a kérést az éles API-n futtatja, hogy láthassa a tényleges választ. Nyissa meg ezt a végpontot az API konzolban

Részletek

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.

Paraméterek

NévTípusKötelezőMi ez
orgId (path)UuidIgenOrganization ID (UUIDv7).
userId (path)UuidIgenThe user to remove from the organization.

Kérés törzse

NévTípusKötelezőMi ez
rolestringIgenA role key from `GET /v1/orgs/{orgId}/roles`.

Válasz

NévTípusKötelezőMi ez
user_idUuidIgenUUIDv7 identifier — sortable by creation time (docs/02 §8).
emailstringIgen
namestringIgenDisplay name; may be empty for an account that never set one.
rolesstring[]IgenEvery role this person holds in this org, sorted.
joined_atstringIgenWhen their EARLIEST membership of this org was created.
is_selfbooleanIgenWhether this row is the calling user.
removablebooleanIgen
not_removable_reasonOrgMemberRemovalBlock | nullIgenWhy 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_assignablebooleanIgenWhether `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…

Hibák, amelyeket ez a végpont visszaadhattatlan

401 · 403 · 404 · 409 · 422 · 429