Creates a new role
import Fragment from '@fragment-dev/ts-node';
const client = new Fragment({
clientId: process.env['FRAGMENT_CLIENT_ID'],
clientSecret: process.env['FRAGMENT_CLIENT_SECRET'],
});
const response = await client.roles.create({ role: 'admin' });{
"data": {
"id": "role_abc123",
"role": "admin"
}
}Lists all roles for the workspace
import Fragment from '@fragment-dev/ts-node';
const client = new Fragment({
clientId: process.env['FRAGMENT_CLIENT_ID'],
clientSecret: process.env['FRAGMENT_CLIENT_SECRET'],
});
const response = await client.roles.list();{
"data": [
{
"id": "role_abc123",
"role": "admin"
}
]
}