Skip to content
PATCH /role/{id}

**`permissions` is REPLACED wholesale, not merged** — the array you send becomes the role's entire permission set, so anything omitted is revoked from every member holding the role. Read the role first and send the full intended list. Omitting `permissions` entirely leaves it untouched. Edits apply live: effective permissions are recomputed per request and every cached permission context for the org is invalidated immediately. Requires `role:manage`, the `custom_roles` feature, and that you hold every permission you are granting.

Path Parameters

idstring
required·

Role id (role_…).

Request Body

descriptionstring,null
namestring
permissionsstring[]

Replaces the role's permission set entirely.

Response Body

can_reassign_holdersboolean

Whether you may move this role's holders and pending invites to another role (DELETE /role/{id}?reassign_to=): you hold member:manage and do not hold this role yourself.

created_atstring · date-time
descriptionstring,null
group_mapping_countinteger

SCIM group mappings that assign this role. Present only on roles you can manage. While above zero, DELETE /role/{id} is refused (409 role_mapped) until the mappings change.

idstring

Role id (role_…).

is_systemboolean

Predefined roles ship with every organization and cannot be edited away.

member_countinteger

How many members hold this role right now. GET /member?role_id={id} lists them; while it is above zero, DELETE /role/{id} needs reassign_to.

namestring
pending_invite_countinteger

Pending invites issued for this role. Present only on roles you can manage. While above zero, DELETE /role/{id} needs reassign_to, which re-points them.

permissionsstring[]

Permission names from GET /permission. PATCH /role/{id} replaces this list wholesale.

seat_classstring

Whether members holding only this role count toward billable seats.

Possible values:
billablefree_admin
updated_atstring · date-time
curl -X PATCH 'https://api.elaichi.ai/role/<id>' \
  -H 'Authorization: Bearer $ELAICHI_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name":"your_name","permissions":[]}'
const body = {
  "name": "your_name",
  "permissions": []
};

const response = await fetch('https://api.elaichi.ai/role/<id>', {
  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/role/<id>"
headers = {
    "Authorization": f"Bearer {os.environ['ELAICHI_API_TOKEN']}",
    "Content-Type": "application/json",
}
payload = {
    "name": "your_name",
    "permissions": []
}

response = requests.patch(url, headers=headers, json=payload)
print(response.json())