Roles

Delete a role, with a JSON body

Deletes a role, taking a JSON body. The same operation as DELETE /role/{id} — same authorization, same guards, same atomic transaction — with a JSON body instead of a query parameter, so a caller can also move SPECIFIC holders onto a role of their own choosing before the rest fall back to reassign_to. reassignments is capped at 200 entries; past it the call answers 400 naming the ceiling. Each entry's role_id is checked against the same grant ceiling as reassign_to (never the role being deleted), and each user_id must currently hold the role — one that no longer does answers 409 (role_holder_changed), so the caller can refresh and retry. reassign_to becomes optional once every holder is covered by reassignments AND no pending invite is for the role (invites are never individually overridden, and always fall back to reassign_to); short of that it is still required, exactly as on the plain DELETE form. The response adds reassigned_by_role: one row per DISTINCT target role actually used, bounded by how many roles the caller named.

post/role/{id}/delete

Request

  • Base URL: https://api.elaichi.ai
  • URL: https://api.elaichi.ai/role/{id}/delete
  • Auth: HTTP bearer

Path parameters

idstring required

Role id (role_…) being deleted.

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

reassign_tostring

Same as DELETE /role/{id}'s reassign_to query parameter — the default target.

Response

OK

successboolean required
reassigned_member_countinteger required
reassigned_invite_countinteger required

Changes

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