Set member role
/member/{userId}
**A member holds exactly one role per organization.** `role_ids` must contain exactly one id and REPLACES whatever they held; zero or two or more answers 400 `role_cardinality`. To combine two roles' permissions, author a custom role (`POST /role`) — a second assignment would create a privilege level no role names. Takes effect on the member's next request. Requires `member:manage`, and you may only assign a role whose permissions you hold yourself, so a member admin cannot promote anyone (including themselves) past their own level. A BROWSER SESSION must additionally carry a fresh step-up reauthentication (`X-Step-Up-Token`, obtained from `/auth/step-up`); without one the call answers `428 step_up_required` and `error.details` names the action and resource to prove. An organization API token is not challenged: step-up re-proves the person behind a session, and a token has no person behind it.
Path Parameters
User id (usr_…) of an org member.
Request Body
Exactly one role (role_…). It replaces the member's current role.
Response Body
Roles held. Replace the whole set with PATCH /member/{userId}.
Role id (role_…).
billablefree_admin
Only active members can act in the organization.
Team id (team_…).
Global profile. Null when the profile row could not be resolved.
User id (usr_…). A membership has no id of its own.
How they joined — invite, verified domain, SCIM, and so on.
curl -X PATCH 'https://api.elaichi.ai/member/<userId>' \
-H 'Authorization: Bearer $ELAICHI_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"role_ids":[]}'const body = {
"role_ids": []
};
const response = await fetch('https://api.elaichi.ai/member/<userId>', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer ' + process.env.ELAICHI_API_TOKEN,
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
});
const data = await response.json();
console.log(data);import os
import requests
url = "https://api.elaichi.ai/member/<userId>"
headers = {
"Authorization": f"Bearer {os.environ['ELAICHI_API_TOKEN']}",
"Content-Type": "application/json",
}
payload = {
"role_ids": []
}
response = requests.patch(url, headers=headers, json=payload)
print(response.json())