Set member role or fields
/member/{userId}
Send exactly one of `role_ids` or `attributes` (both, or neither, is 400). `attributes` sets the member's field values (see `GET /member-attribute`): same permission, step-up and "not yourself" rules as a role change, and you must hold every permission they hold; no role moves. Sets a member's role. **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 also pass a fresh step-up reauthentication in the app (without it the call answers `428 step_up_required`). An organization API token is not challenged.
Path Parameters
User id (usr_…) of an org member.
Request Body
Field key → value; null clears it. Each key must be defined (GET /member-attribute, else 400 attribute_unknown) and not filled by SCIM (409 attribute_scim_managed). Text is trimmed, 1-256 characters and may not contain {{; a list holds 1-50 such items; "3" / "true" are accepted for number and boolean fields. A bad value is 400 attribute_invalid (details.key); one member's values together are at most 16 KB (400 attribute_too_large).
Exactly one role (role_…). It replaces the member's current role.
Response Body
Their member field values. Present only for a member:manage reader, or on your own row; absent (not empty) otherwise.
You may set this member's field values: you hold member:manage, every permission they hold, and this is not you (nobody sets their own).
Their identity provider id (SCIM externalId). Present exactly when attributes is.
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":[],"attributes":{}}'const body = {
"role_ids": [],
"attributes": {}
};
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": [],
"attributes": {}
}
response = requests.patch(url, headers=headers, json=payload)
print(response.json())