Skip to content
PATCH /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

userIdstring
required·

User id (usr_…) of an org member.

Request Body

attributesRecord<string, any>

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).

role_idsstring[]

Exactly one role (role_…). It replaces the member's current role.

Response Body

attributesRecord<string, any>

Their member field values. Present only for a member:manage reader, or on your own row; absent (not empty) otherwise.

can_set_attributesboolean

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).

external_idstring,null

Their identity provider id (SCIM externalId). Present exactly when attributes is.

joined_atstring · date-time
rolesobject[]

Roles held. Replace the whole set with PATCH /member/{userId}.

idstring

Role id (role_…).

is_systemboolean
namestring
seat_classstring
Possible values:
billablefree_admin
statusstring

Only active members can act in the organization.

teamsobject[]
idstring

Team id (team_…).

namestring
userobject,null

Global profile. Null when the profile row could not be resolved.

avatar_urlstring,null
emailstring · email
idstring
namestring,null
user_idstring

User id (usr_…). A membership has no id of its own.

viastring,null

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())