Get Role
GET
/roles/{id}Fetch the details of a specific role.
Returns the role's name, description, and complete list of permissions. Use
this to show what a role can do or to load it into an editor.
When to use this
- Displaying role details in an admin panel
- Loading a role for editing
- Checking what permissions a role grants
Parameters
idpathrequiredRole ID
Response
Role retrieved successfully
Notes
💡The `permissions` array shows all the access this role grants, like `events.create` or `venues.read`.
Code Samples
Get Role using the TypeScript SDK:
import { BackstageClient } from '@ticketlayer/backstage';
const client = new BackstageClient({
organisationSlug: 'your-org',
});
client.setAccessToken('YOUR_ACCESS_TOKEN');
// Get role details
const role = await client.role.get('{{ROLE_ID}}');
console.log(`Role: ${role.name || role.id}`);