Skip to main content
The /roles resource lets you define and manage the permission sets that govern what staff members can do in Avalex. A role is a named bundle of permission strings — such as customers:read or licenses:write — that you assign to one or more staff accounts. By centralising permissions in roles, you can update access levels across your entire team by editing a single record.

Required Permissions


List All Roles

string
required
Bearer <token> or Basic credentials.
Returns an array of all role records in your Avalex account.
Response — 200 OK

Create a Role

string
required
Bearer <token> or Basic credentials.
string
required
Human-readable name for the role (e.g. Support Agent).
string[]
required
Array of permission strings granted to this role. See the full list of valid permissions below.
Creates a new role and returns the created record.
Response — 201 Created

Get a Role by ID

string
required
The unique role ID (e.g. role_support).
Returns a single role record. Responds with 404 Not Found if no role with that ID exists.
Response — 200 OK

Update a Role

string
required
The unique role ID.
Performs a full replacement of the role record. The permissions array is replaced entirely with the value you provide. Returns 404 Not Found if the role does not exist.
Changes to a role take effect immediately for all staff members assigned to it. Removing a permission from a role revokes that access across every staff account that holds the role.
Response — 200 OK

Delete a Role

string
required
The unique role ID.
Permanently removes the role record. Returns 204 No Content on success and 404 Not Found if the ID does not exist.
Deleting a role removes it from every staff member it is assigned to. Ensure no active staff members depend on this role before deleting it.
Response — 204 No Content

StaffRole Schema

Full Schema Example


Valid Permission Strings

The following permission strings are recognised by Avalex. Each string follows the resource:action pattern.