List custom role definitions for the current tenant
const url = 'https://api.emite.cr/v1/tenants/me/roles';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.emite.cr/v1/tenants/me/roles \ --header 'Authorization: Bearer <token>'Returns every active custom role, oldest first, with its scope bundle and the count of members currently assigned to it. The web uses memberCount to gate the delete affordance (deletion is refused while members hold the role).
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”object
Identifier of the role definition.
Stable identifier of the role: the value a member's role takes and the :slug of /v1/tenants/me/roles/:slug. It never changes.
The name people see for the role.
What the role is for; null when no description was given.
The permission scopes the role grants, from the catalog of GET /v1/permissions/roles.
When the role was created.
When the role was last changed.
How many active members hold the role now. While it is above 0 the role cannot be deleted (409 CUSTOM_ROLE_IN_USE).
Example
[ { "slug": "office_manager", "name": "Office Manager", "description": "Manages day-to-day operations.", "scopes": [ "invoices:read", "invoices:export", "reports:read", "reports:export" ], "memberCount": 2 }]Missing or invalid JWT.
Custom role management is JWT-only and requires roles:read / roles:manage.