access

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

Change a member's role.

Toate punctele finale access

Autentificare

Trimiteți o cheie API ca token de tip bearer. Cheia trebuie să aibă permisiunea members.role.assign; o cheie care nu o are va fi respinsă cu 403, nu 404.

Unde merge ID-ul organizației tale

Acest punct final preia ID-ul organizației tale direct în URL, sub forma orgId. Înlocuiește-l în cale — nu există niciun antet sau parametru de interogare care să țină locul acestuia.

ID-ul organizației tale se află pe ecranul cheilor API din panoul de control, lângă cheia însăși. Este același ID în fiecare apel pe care îl faci.

Încearcă

Înlocuiți tot ce se află între paranteze unghiulare cu propriile valori și substituentul cheie cu o cheie din tabloul 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> }'

Autentificat? Consola API din panoul de control îți completează ID-ul real al organizației și propria cheie și rulează cererea în API-ul live, astfel încât să poți vedea răspunsul efectiv. Deschideți acest punct final în consola API

Detalii

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.

Parametri

NumeTipObligatoriuCe este
orgId (path)UuidDaOrganization ID (UUIDv7).
userId (path)UuidDaThe user to remove from the organization.

Corp cerere

NumeTipObligatoriuCe este
rolestringDaA role key from `GET /v1/orgs/{orgId}/roles`.

Răspuns

NumeTipObligatoriuCe este
user_idUuidDaUUIDv7 identifier — sortable by creation time (docs/02 §8).
emailstringDa
namestringDaDisplay name; may be empty for an account that never set one.
rolesstring[]DaEvery role this person holds in this org, sorted.
joined_atstringDaWhen their EARLIEST membership of this org was created.
is_selfbooleanDaWhether this row is the calling user.
removablebooleanDa
not_removable_reasonOrgMemberRemovalBlock | nullDaWhy 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_assignablebooleanDaWhether `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…

Erori pe care le poate returna acest punct final

401 · 403 · 404 · 409 · 422 · 429