Create Role
POST
/rolesCreate a custom role with specific permissions.
Roles let you control what users can do. Define a set of permissions (like
`events.create`, `venues.read`, `orders.refund`) and then assign the role
to users who need those capabilities.
Common roles might include "Event Manager", "Box Office Staff", "Marketing",
or "Finance".
When to use this
- Setting up custom access levels for your team
- Creating a read-only role for auditors
- Defining roles that match your organisational structure
Request Body
Response
Role created successfully
Notes
ℹ️Permissions use the format `resource.action` (e.g., `events.create`) or `resource.action:scope` (e.g., `events.read:own`).
💡Start with minimal permissions and add more as needed-it's easier to grant access than to revoke it.
Code Samples
Create Role using the TypeScript SDK:
import { BackstageClient } from '@ticketlayer/backstage';
const client = new BackstageClient({
organisationSlug: 'your-org',
});
client.setAccessToken('YOUR_ACCESS_TOKEN');
// Create role
const role = await client.role.create({
name: 'New Role',
// Add other required fields
});
console.log(`Created role with ID: ${role.id}`);