Skip to content

List custom role definitions for the current tenant

GET
/v1/tenants/me/roles
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).

Media typeapplication/json
Array<object>
object
id
required

Identifier of the role definition.

string format: uuid
slug
required

Stable identifier of the role: the value a member's role takes and the :slug of /v1/tenants/me/roles/:slug. It never changes.

string
name
required

The name people see for the role.

string
description
required

What the role is for; null when no description was given.

string
nullable
scopes
required

The permission scopes the role grants, from the catalog of GET /v1/permissions/roles.

Array<string>
createdAt
required

When the role was created.

string format: date-time
updatedAt
required

When the role was last changed.

string format: date-time
memberCount
required

How many active members hold the role now. While it is above 0 the role cannot be deleted (409 CUSTOM_ROLE_IN_USE).

number
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.