List Roles
GET
/rolesGet all the roles defined in your organisation.
Roles are collections of permissions that you assign to users. Instead of
giving each user individual permissions, you create roles like "Event Manager"
or "Box Office Staff" and assign those.
Returns each role with its name, description, and list of permissions.
When to use this
- Building a role management interface
- Populating a role selector when inviting users
- Auditing what permissions each role has
Response
Roles retrieved successfully
Notes
ℹ️Some roles are system-defined and can't be modified (like "Owner" or "Admin").
Code Samples
List Roles using the TypeScript SDK:
import { BackstageClient } from '@ticketlayer/backstage';
const client = new BackstageClient({
organisationSlug: 'your-org',
});
client.setAccessToken('YOUR_ACCESS_TOKEN');
// List roles
const { roles, pagination } = await client.roles.list({
limit: 20,
page: 1,
});
for (const item of roles) {
console.log(`${item.id}: ${item.name || item.id}`);
}
console.log(`Page ${pagination.page} of ${pagination.totalPages}`);