access

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

Change a member's role.

Lahat ng access endpoint

Pagpapatotoo

Magpadala ng API key bilang isang bearer token. Kailangang taglayin ng key ang pahintulot na members.role.assign; ang key na wala nito ay tatanggihan gamit ang 403, hindi 404.

Kung saan mapupunta ang id ng iyong organisasyon

Kinukuha ng endpoint na ito ang id ng iyong organisasyon sa mismong URL bilang orgId. Palitan ito sa path — walang header o query parameter na gagawa nito sa halip.

Ang id ng iyong organisasyon ay nasa screen ng mga API key sa iyong dashboard, sa tabi mismo ng key. Ito ang parehong id sa bawat tawag na gagawin mo.

Subukan ito

Palitan ang anuman sa loob ng mga panaklong na may anggulo ng iyong sariling mga halaga, at ang placeholder ng key na may key mula sa iyong 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> }'

Nakalagda? Ang API console sa iyong dashboard ay awtomatikong naglalagay ng iyong tunay na ID ng organisasyon at sariling susi, at pinapatakbo ang kahilingan laban sa live na API upang makita mo ang aktwal na tugon. Buksan ang endpoint na ito sa console ng API

Mga Detalye

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.

Mga Parameter

PangalanUriKailanganAno ito
orgId (path)UuidOoOrganization ID (UUIDv7).
userId (path)UuidOoThe user to remove from the organization.

Katawan ng kahilingan

PangalanUriKailanganAno ito
rolestringOoA role key from `GET /v1/orgs/{orgId}/roles`.

Tugon

PangalanUriKailanganAno ito
user_idUuidOoUUIDv7 identifier — sortable by creation time (docs/02 §8).
emailstringOo
namestringOoDisplay name; may be empty for an account that never set one.
rolesstring[]OoEvery role this person holds in this org, sorted.
joined_atstringOoWhen their EARLIEST membership of this org was created.
is_selfbooleanOoWhether this row is the calling user.
removablebooleanOo
not_removable_reasonOrgMemberRemovalBlock | nullOoWhy 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_assignablebooleanOoWhether `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…

Mga error na maibabalik ng endpoint na ito

401 · 403 · 404 · 409 · 422 · 429