Members

Set member role

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.

patch/member/{userId}

Request

  • Base URL: https://api.elaichi.ai
  • URL: https://api.elaichi.ai/member/{userId}
  • Auth: HTTP bearer

Path parameters

userIdstring required

User id (usr_…) of an org member.

Headers

X-Organization-Idstring

Target organization (org_…). Required for cookie/session auth on org-scoped routes; optional for API tokens, which carry their organization, and rejected when it names a different one.

Request body

role_idsstring[] required

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

Response

OK

user_idstring

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

statusstring

Only active members can act in the organization.

viastring nullable

How they joined — invite, verified domain, SCIM, and so on.

joined_atstring date-time

Changes

No recorded changes to this operation across all 1 revision of this API.