access

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

Change a member's role.

Alle access Endpunkte

Authentifizierung

Senden Sie einen API-Schlüssel als Bearer-Token. Der Schlüssel muss über die Berechtigung members.role.assign verfügen; ein Schlüssel ohne diese wird mit 403 statt 404 abgelehnt.

Hier kommt Ihre Organisations-ID hin

Dieser Endpunkt erwartet Ihre Organisations-ID direkt in der URL als orgId. Setzen Sie diese in den Pfad ein – es gibt keinen Header oder Abfrageparameter, der stattdessen verwendet werden kann.

Die ID Ihrer Organisation finden Sie im Dashboard auf dem Bildschirm für API-Schlüssel direkt neben dem Schlüssel selbst. Sie ist bei jedem Ihrer Aufrufe dieselbe.

Ausprobieren

Ersetzen Sie alles in spitzen Klammern durch Ihre eigenen Werte und den Platzhalter für den Schlüssel durch einen Schlüssel aus Ihrem Dashboard.

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

Angemeldet? Die API-Konsole in Ihrem Dashboard trägt automatisch Ihre echte Organisations-ID sowie Ihren eigenen Schlüssel ein und führt die Anfrage gegen die Live-API aus, sodass Sie die tatsächliche Antwort sehen können. Öffnen Sie diesen Endpunkt in der API-Konsole

Details

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.

Parameter

NameTypErforderlichWas es ist
orgId (path)UuidJaOrganization ID (UUIDv7).
userId (path)UuidJaThe user to remove from the organization.

Anfragekörper

NameTypErforderlichWas es ist
rolestringJaA role key from `GET /v1/orgs/{orgId}/roles`.

Antwort

NameTypErforderlichWas es ist
user_idUuidJaUUIDv7 identifier — sortable by creation time (docs/02 §8).
emailstringJa
namestringJaDisplay name; may be empty for an account that never set one.
rolesstring[]JaEvery role this person holds in this org, sorted.
joined_atstringJaWhen their EARLIEST membership of this org was created.
is_selfbooleanJaWhether this row is the calling user.
removablebooleanJa
not_removable_reasonOrgMemberRemovalBlock | nullJaWhy 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_assignablebooleanJaWhether `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…

Fehler, die dieser Endpunkt zurückgeben kann

401 · 403 · 404 · 409 · 422 · 429