API reference / Organizations and teams
Change a member's role or status
PATCH/v1/orgs/{orgId}/members/{userId}
Assigns a different role, or disables or re-enables a member. Nobody can assign a role ranked above their own.
Before you call it
- Permission
members:manage - Second factorRequired for browser sessions. An API key with the scope replaces it.
Parameters
| Parameter | What it does |
|---|---|
orgIdpath, uuidrequired | The organization the call acts on. For platform calls, your platform's id; for customer calls, the customer's organization id. Get them from getMe or the customer list. |
userIdpath, uuidrequired | A member's user id from the member list. |
Request body
| Field | What it does |
|---|---|
role_keystring | No description in the spec yet. |
statusenum | No description in the spec yet. One of |
Response 200
Updated member
| Field | What it does |
|---|---|
user_idstring (uuid)required | No description in the spec yet. |
emailstringrequired | No description in the spec yet. |
first_namestringrequired | No description in the spec yet. |
last_namestringrequired | No description in the spec yet. |
role_keystringrequired | No description in the spec yet. |
role_namestringrequired | No description in the spec yet. |
statusenumrequired | No description in the spec yet. One of |
joined_atstring (date-time)required | No description in the spec yet. |
Errors to handle
| Code | What it means and what to do |
|---|---|
insufficient_rank403 | You tried to assign, invite or revoke a role ranked above your own. Ask a member with a higher role, usually the owner. |
last_owner409 | an organization must keep at least one owner |
cannot_disable_self422 | you cannot disable your own access |
unknown_role422 | unknown role |
role_not_applicable422 | this role is not available for this account type |
Every error is a Problem document. Branch on code; quote request_id to support.