Account roles
An account role is a set of permissions that members hold, as on Settings, Permissions in Drum. These endpoints, the settings screen and the MCP tools get_account_role and save_account_role run the same code, so the same rules apply everywhere.
These endpoints are in early access, and they follow the rules for every setup endpoint. Every call needs manage_permissions (an account admin has it), as well as the API permission of its verb.
Endpoints
| Method and path | Does |
|---|---|
GET /api/v1/account_roles |
Lists the kept roles as {records: [...]}. include_deleted=true adds archived roles. Each is {id, name, description, granted[], members_total, deleted}, where granted names the permissions the role turns on |
GET /api/v1/account_roles/new |
A role that does not exist yet, with every permission at its default. Read it to learn the permission names before you create a role |
GET /api/v1/account_roles/:id |
One role, in full |
POST /api/v1/account_roles |
Creates a role: name (required), description, permissions, replace_permissions, add_member_ids |
PATCH /api/v1/account_roles/:id |
Changes only what you send: name, description, permissions, replace_permissions, add_member_ids, remove_member_ids, expected_revision |
DELETE /api/v1/account_roles/:id |
Archives the role. Its members lose its permissions until it is restored |
PATCH /api/v1/account_roles/:id/restore |
Restores the role, with its members |
The role
A role reads back as:
| Field | Holds |
|---|---|
id, name, description, deleted |
The role |
revision |
Changes with every change to the name, the description or the permissions. Member changes do not move it |
permissions |
Every permission, grouped as the settings screen groups them: {group: {permission: true or false}} |
sensitive_permissions |
The permissions only an account admin can change |
can_change_sensitive |
Whether you can change them |
permission_pairs |
Permissions that work only together with others on the same role. For example, approve_timesheets opens other people’s timesheets only with view_staff_timesheet_page |
members |
Up to 200 kept holders, as {id, name} |
members_total |
How many members hold the role |
Every save returns the same shape, plus warnings and changed_permissions: {permission: {from, to}} for each permission the save changed (from the defaults, on create), or {} when none changed.
Changing permissions
- A write sends
permissionsflat:{"approve_timesheets": true, "view_staff_timesheet_page": true}. - A permission you leave out does not change. On create it takes its default. Most default to
false;read_project_activity,mark_time_unbillableandview_internal_budgetdefault totrue. replace_permissions: trueturns off every permission thatpermissionsleaves out, so one call sets the whole role. It needspermissions(422missing_input).- An unknown permission is
422invalid_inputwithfieldpermissions. So is a retired one (track_time_against_all_tasks,track_time_against_allocated_tasks), with a message that says so.
Sensitive permissions
Only an account admin can change manage_permissions, super_finance, create_finance, the four api_* permissions, connect_ai_agents and manage_webhooks. Anyone else gets 403 escalation_refused when they:
- change one of these permissions;
- add or remove a member on a role that grants one;
- archive or restore such a role.
Changing members
add_member_idsandremove_member_idstake up to 200 member ids each. A member already in the state you ask for is skipped.- There is no input that replaces the whole list. To move a member to another role, add them to the new role and remove them from the old one.
- A member who is not in the account, or a Drum staff membership, is
404member_not_found. - An archived role takes no new members (
422account_role_archived). Restore it first.
Stale edits
Send the revision you read back as expected_revision. If the role changed since, the call answers 409 stale_state and changes nothing.
Archiving
An archive warns what it affects: role_has_members, role_required_by_project_roles and role_used_by_approvals, each with a count. Every change to a role or its members is recorded in Drum, with who made it and where it came from.
Errors
| Status | code |
When |
|---|---|---|
403 |
not_authorized |
A missing API permission, or no manage_permissions |
403 |
escalation_refused |
Someone who is not an admin changed a sensitive permission, or the members of a role that grants one |
404 |
not_found |
The setup endpoints are not turned on for the account |
404 |
account_role_not_found, member_not_found |
The role or member is not in the account |
409 |
stale_state |
expected_revision does not match |
422 |
account_role_archived |
Members were added to an archived role |
422 |
missing_input, invalid_input |
A required field is missing, or a field or permission is unknown |
422 |
validation_failed |
The role would not save. errors lists why |
Related
- People tools on the MCP server
- Authentication and permissions