access
PATCH /v1/orgs/{orgId}/members/{userId}
Change a member's role.
Authentification
Envoyez une clé API en tant que jeton du porteur. La clé doit posséder l'autorisation members.role.assign ; une clé qui ne l'a pas est refusée avec le code 403, et non 404.
Où insérer l'ID de votre organisation
Cet point de terminaison intègre l'identifiant de votre organisation directement dans l'URL, sous la forme orgId. Insérez-le dans le chemin d'accès, car aucun en-tête ni paramètre de requête ne peut s'y substituer.
L'identifiant de votre organisation se trouve sur l'écran des clés API de votre tableau de bord, à côté de la clé elle-même. Il s'agit du même identifiant pour chaque appel que vous effectuez.
Essayer
Remplacez tout ce qui se trouve entre crochets par vos propres valeurs, et le espace réservé à la clé par une clé de votre tableau de bord.
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> }'Connecté ? La console d'API de votre tableau de bord saisit votre véritable ID d'organisation ainsi que votre propre clé, et exécute la requête sur l'API de production afin que vous puissiez voir la réponse réelle. Ouvrir ce point de terminaison dans la console API
Détails
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ètres
| Nom | Type | Obligatoire | Qu'est-ce que c'est |
|---|---|---|---|
orgId (path) | Uuid | Oui | Organization ID (UUIDv7). |
userId (path) | Uuid | Oui | The user to remove from the organization. |
Corps de la requête
| Nom | Type | Obligatoire | Qu'est-ce que c'est |
|---|---|---|---|
role | string | Oui | A role key from `GET /v1/orgs/{orgId}/roles`. |
Réponse
| Nom | Type | Obligatoire | Qu'est-ce que c'est |
|---|---|---|---|
user_id | Uuid | Oui | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
email | string | Oui | — |
name | string | Oui | Display name; may be empty for an account that never set one. |
roles | string[] | Oui | Every role this person holds in this org, sorted. |
joined_at | string | Oui | When their EARLIEST membership of this org was created. |
is_self | boolean | Oui | Whether this row is the calling user. |
removable | boolean | Oui | — |
not_removable_reason | OrgMemberRemovalBlock | null | Oui | 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 | Oui | 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… |
Erreurs que cet point de terminaison peut renvoyer
401 · 403 · 404 · 409 · 422 · 429