Update User's Account Roles
PUT
/user-accountsChange which roles a user has for a specific account.
You can add new roles, remove existing ones, or replace them entirely. This
is how you promote someone from viewer to editor, or grant additional
permissions.
Changes take effect immediately-the user's permissions update on their next
API request.
When to use this
- Promoting a user to a higher role
- Granting additional permissions for a project
- Adjusting access after a team restructure
Request Body
Response
Roles updated successfully
Notes
ℹ️Changes are immediate-no need for the user to log out and back in.
⚠️Be careful when removing roles-the user loses those permissions instantly.
Code Samples
Update User Account Roles using the TypeScript SDK:
import { BackstageClient } from '@ticketlayer/backstage';
const client = new BackstageClient({
organisationSlug: 'your-org',
});
client.setAccessToken('YOUR_ACCESS_TOKEN');
// Update useraccountrole
const updated = await client.useraccountroles.update('{{USERACCOUNTROLES_ID}}', {
name: 'Updated Name',
// Add fields to update
});
console.log(`Updated useraccountrole: ${updated.name}`);