Delete role
Deletes a custom role. Irreversible. A member holds exactly one role, so a role anybody still holds cannot simply disappear: without reassign_to the call answers 400 role_in_use while member_count or pending_invite_count is above zero (GET /member?role_id={id} lists the holders). With reassign_to, every holder and every pending invite for the role is moved onto that role and the role is deleted in one atomic operation — everything moves and the role is gone, or nothing changes. The move takes effect on each member's next request. A role that a SCIM group mapping assigns (group_mapping_count above zero) is refused with 409 role_mapped, reassign_to or not: change the mapping first. Requires role:manage and the custom_roles feature. Sending reassign_to at all additionally requires member:manage and that you hold every permission the replacement role carries (the PATCH /member/{userId} rules), and the target must exist and differ from id — checked whether or not anything needs moving. It is further refused if you hold the deleted role yourself, if the replacement is Org Owner and you are not one, or if it would leave no billable member. System roles cannot be deleted. This is the query-parameter-only form; POST /role/{id}/delete is the same operation with a JSON body, for a client that also wants to move specific holders onto a role of their own choosing. 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.
Request
- Base URL: https://api.elaichi.ai
- URL: https://api.elaichi.ai/role/{id}
- Auth: HTTP bearer
Path parameters
Role id (role_…).
Query parameters
Role id (role_…) to move every current holder and pending invite onto before deleting. Must exist and differ from id; its authorization (member:manage and the grant ceiling) applies even when nothing holds the role, in which case nothing is moved.
Headers
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.
Response
OK
Changes
No recorded changes to this operation across all 1 revision of this API.