Skip to content

List roles

GET
/api/v1/organizations/{orgId}/roles
curl --request GET \
--url 'http://localhost:3000/api/v1/organizations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/roles?search=admin&includeSystem=true&limit=50&offset=0' \
--header 'X-API-Key: <X-API-Key>'

Retrieves all roles available in the organization (system + custom roles).

orgId
required
string format: uuid

Organization UUID

search
string
Example
admin

Search term for role name

includeSystem
boolean
default: true
Example
true

Whether to include system-defined roles

limit
number
default: 50 >= 1 <= 100
Example
50

Maximum number of results to return

offset
number
0
Example
0

Number of results to skip for pagination

Roles retrieved successfully

Media type application/json
object
items
required

List of roles

Array<object>
object
id
required

Unique role identifier

string format: uuid
name
required

Role display name

string
description

Role description

string
permissions
required

List of permission keys assigned to this role

Array<string>
isSystem
required

Whether this is a system-defined role (cannot be modified)

boolean
organizationId

Organization ID (null for system roles)

string format: uuid
createdAt
required

When the role was created

string format: date-time
updatedAt
required

When the role was last updated

string format: date-time
total
required

Total number of roles matching the query

number
limit
required

Number of results returned

number
offset
required

Number of results skipped

number
Example
{
"items": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Device Operator",
"description": "Can view and manage devices but not deployments",
"permissions": [
"devices:read",
"devices:write",
"deployments:read"
],
"isSystem": false,
"organizationId": "550e8400-e29b-41d4-a716-446655440001",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-06-20T14:45:00Z"
}
],
"total": 10,
"limit": 10,
"offset": 0
}

Unauthorized

Forbidden - Insufficient permissions