access

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

Change a member's role.

All access endpoints

Authentication

Send an API key as a bearer token. The key must carry the members.role.assign permission; a key without it is refused with 403, not 404.

Where your organisation id goes

This endpoint takes your organisation id in the URL itself, as orgId. Substitute it into the path — there is no header or query parameter that will do instead.

Your organisation id is on the API keys screen in your dashboard, beside the key itself. It is the same id in every call you make.

Try it

Replace anything in angle brackets with your own values, and the key placeholder with a key from your 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> }'

Signed in? The API console in your dashboard fills in your real organisation id and your own key, and runs the request against the live API so you can see the actual response. Open this endpoint in the 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

NameTypeRequiredWhat it is
orgId (path)UuidYesOrganization ID (UUIDv7).
userId (path)UuidYesThe user to remove from the organization.

Request body

NameTypeRequiredWhat it is
rolestringYesA role key from `GET /v1/orgs/{orgId}/roles`.

Response

NameTypeRequiredWhat it is
user_idUuidYesUUIDv7 identifier — sortable by creation time (docs/02 §8).
emailstringYes
namestringYesDisplay name; may be empty for an account that never set one.
rolesstring[]YesEvery role this person holds in this org, sorted.
joined_atstringYesWhen their EARLIEST membership of this org was created.
is_selfbooleanYesWhether this row is the calling user.
removablebooleanYes
not_removable_reasonOrgMemberRemovalBlock | nullYesWhy 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_assignablebooleanYesWhether `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…

Errors this endpoint can return

401 · 403 · 404 · 409 · 422 · 429