Authenticatie
Stuur een API-sleutel mee als bearer token. De sleutel moet over de permissie members.role.assign beschikken; een sleutel zonder deze permissie wordt geweigerd met een 403 in plaats van een 404.
Waar je organisatie-id komt te staan
Dit eindpunt gebruikt je organisatie-id rechtstreeks in de URL als orgId. Vervang dit in het pad; er is geen header of queryparameter die dit kan overnemen.
Uw organisatie-id staat op het scherm met API-sleutels in uw dashboard, naast de sleutel zelf. Dit is in elke aanroep die u doet dezelfde id.
Probeer het
Vervang alles tussen punthaakjes door uw eigen waarden en de sleutelplaatsvervanger door een sleutel uit uw 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> }'Ingelogd? De API-console in je dashboard vult je echte organisatie-id en je eigen sleutel in, en voert het verzoek uit tegen de live API zodat je de daadwerkelijke respons kunt zien. Open dit eindpunt in de API-console
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.
Parameters
| Naam | Type | Verplicht | Wat dit is |
|---|---|---|---|
orgId (path) | Uuid | Ja | Organization ID (UUIDv7). |
userId (path) | Uuid | Ja | The user to remove from the organization. |
Aanvraaglichaam
| Naam | Type | Verplicht | Wat dit is |
|---|---|---|---|
role | string | Ja | A role key from `GET /v1/orgs/{orgId}/roles`. |
Reactie
| Naam | Type | Verplicht | Wat dit is |
|---|---|---|---|
user_id | Uuid | Ja | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
email | string | Ja | — |
name | string | Ja | Display name; may be empty for an account that never set one. |
roles | string[] | Ja | Every role this person holds in this org, sorted. |
joined_at | string | Ja | When their EARLIEST membership of this org was created. |
is_self | boolean | Ja | Whether this row is the calling user. |
removable | boolean | Ja | — |
not_removable_reason | OrgMemberRemovalBlock | null | Ja | Why 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_assignable | boolean | Ja | Whether `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… |
Fouten die dit eindpunt kan retourneren
401 · 403 · 404 · 409 · 422 · 429