access

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

Change a member's role.

Wszystkie punkty końcowe access

Uwierzytelnianie

Wyślij klucz API jako token bearer. Klucz musi posiadać uprawnienie members.role.assign; klucz bez niego jest odrzucany z kodem 403, a nie 404.

Miejsce na identyfikator organizacji

Ten punkt końcowy pobiera identyfikator Twojej organizacji bezpośrednio z adresu URL jako orgId. Podstaw go w ścieżce — nie ma nagłówka ani parametru zapytania, które mogłyby go zastąpić.

Identyfikator Twojej organizacji znajduje się na ekranie kluczy API w Twoim panelu, obok samego klucza. Jest to ten sam identyfikator w każdym wywołaniu, które wykonujesz.

Wypróbuj

Zastąp wszystko w nawiasach ostrych własnymi wartościami, a zastępczy znacznik klucza kluczem ze swojego pulpitu nawigacyjnego.

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

Zalogowany? Konsola API w Twoim panelu uzupełnia rzeczywiste identyfikator organizacji oraz Twój własny klucz i wykonuje żądanie względem aktywnego API, dzięki czemu możesz zobaczyć rzeczywistą odpowiedź. Otwórz ten punkt końcowy w konsoli API

Szczegóły

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.

Parametry

NazwaTypWymaganeCo to jest
orgId (path)UuidTakOrganization ID (UUIDv7).
userId (path)UuidTakThe user to remove from the organization.

Treść żądania

NazwaTypWymaganeCo to jest
rolestringTakA role key from `GET /v1/orgs/{orgId}/roles`.

Odpowiedź

NazwaTypWymaganeCo to jest
user_idUuidTakUUIDv7 identifier — sortable by creation time (docs/02 §8).
emailstringTak
namestringTakDisplay name; may be empty for an account that never set one.
rolesstring[]TakEvery role this person holds in this org, sorted.
joined_atstringTakWhen their EARLIEST membership of this org was created.
is_selfbooleanTakWhether this row is the calling user.
removablebooleanTak
not_removable_reasonOrgMemberRemovalBlock | nullTakWhy 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_assignablebooleanTakWhether `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…

Błędy, które ten punkt końcowy może zwrócić

401 · 403 · 404 · 409 · 422 · 429