API reference
Roles
Company role definitions.
Find roles
GET
List system and custom roles for the company.
Query parameters:
| Name | Type | Required | Description |
|---|---|---|---|
search |
string | No | Search by role name. |
code |
string | No | Filter by role code. |
is_active |
boolean | No | Filter by active state. |
is_system |
boolean | No | Filter system vs custom roles. |
custom_type |
string | No | Filter by custom role type. |
200List of roles.application/json
Pagination metadata for list responses.
Show properties
Present only when more pages exist.
Present only when current_page > 1.
Show properties
Present only when set.
Property IDs the role is restricted to.
True for built-in system roles (read-only).
Entity type (custom roles only).
Possible values:
USER API_KEYOwning company (custom roles only).
Users/keys assigned to this role.
Present for custom roles only.
get/admin/company/roles
GET /api/admin/company/roles HTTP/1.1 Host: {instance}.clym.io Authorization: Bearer YOUR_SECRET_TOKEN Accept: */*
200List of roles.
{
"meta": {
"current_page": 1,
"next_page": 2,
"prev_page": 1
},
"result": [{
"id": 0,
"code": "string",
"name": "string",
"description": "string",
"api_permissions": ["string"],
"ui_permissions": ["string"],
"is_active": false,
"property_ids": ["string"],
"is_system": false,
"custom_type": "USER",
"company_id": "string",
"access_count": 0,
"created_at": "string"
}]
}Create role
POST
Create a custom role.
Request bodyapplication/json
Unique role code. Required on create; ignored on update.
Role display name. Required on create.
Entity type. Required on create; ignored on update.
Possible values:
USER API_KEYAPI permission strings (e.g. 'r:api.admin.company.read'). Required on create.
UI permission strings (e.g. 'w:admin.dashboard'). Required when `custom_type` is `USER`.
Restrict role to these property IDs.
200Created role.application/json
A company role.
Show properties
Present only when set.
Property IDs the role is restricted to.
True for built-in system roles (read-only).
Entity type (custom roles only).
Possible values:
USER API_KEYOwning company (custom roles only).
Users/keys assigned to this role.
Present for custom roles only.
post/admin/company/roles
POST /api/admin/company/roles HTTP/1.1 Host: {instance}.clym.io Authorization: Bearer YOUR_SECRET_TOKEN Content-Type: application/json Accept: */* { "code": "string", "name": "string", "description": "string", "custom_type": "USER", "is_active": false, "api_permissions": [ "string" ], "ui_permissions": [ "string" ], "property_ids": [ "string" ] }
200Created role.
{
"result": {
"id": 0,
"code": "string",
"name": "string",
"description": "string",
"api_permissions": ["string"],
"ui_permissions": ["string"],
"is_active": false,
"property_ids": ["string"],
"is_system": false,
"custom_type": "USER",
"company_id": "string",
"access_count": 0,
"created_at": "string"
}
}Get permissions
GET
List assignable system permissions.
200Hierarchical permissions list.application/json
Show properties
Show properties
Show properties
Show properties
r=read, w=write, s=super
get/admin/company/roles/permissions
GET /api/admin/company/roles/permissions HTTP/1.1 Host: {instance}.clym.io Authorization: Bearer YOUR_SECRET_TOKEN Accept: */*
200Hierarchical permissions list.
{
"result": {
"api_permissions": [{
"group": "string",
"items": [{
"name": "string",
"endpoint": {
"method": {},
"url": {}
},
"permission": "string"
}]
}]
}
}Read role
GET
Get a role by ID.
Path parameters:
| Name | Type | Required | Description |
|---|---|---|---|
id |
string | Yes | The role ID. |
200Role details.application/json
A company role.
Show properties
Present only when set.
Property IDs the role is restricted to.
True for built-in system roles (read-only).
Entity type (custom roles only).
Possible values:
USER API_KEYOwning company (custom roles only).
Users/keys assigned to this role.
Present for custom roles only.
get/admin/company/roles/{id}
GET /api/admin/company/roles/{id} HTTP/1.1 Host: {instance}.clym.io Authorization: Bearer YOUR_SECRET_TOKEN Accept: */*
200Role details.
{
"result": {
"id": 0,
"code": "string",
"name": "string",
"description": "string",
"api_permissions": ["string"],
"ui_permissions": ["string"],
"is_active": false,
"property_ids": ["string"],
"is_system": false,
"custom_type": "USER",
"company_id": "string",
"access_count": 0,
"created_at": "string"
}
}Update role
PUT
Update a custom role.
Path parameters:
| Name | Type | Required | Description |
|---|---|---|---|
id |
string | Yes | The role ID. |
Request bodyapplication/json
Unique role code. Required on create; ignored on update.
Role display name. Required on create.
Entity type. Required on create; ignored on update.
Possible values:
USER API_KEYAPI permission strings (e.g. 'r:api.admin.company.read'). Required on create.
UI permission strings (e.g. 'w:admin.dashboard'). Required when `custom_type` is `USER`.
Restrict role to these property IDs.
200Change status.application/json
Show properties
Names of fields that changed; empty/false when nothing changed.
put/admin/company/roles/{id}
PUT /api/admin/company/roles/{id} HTTP/1.1 Host: {instance}.clym.io Authorization: Bearer YOUR_SECRET_TOKEN Content-Type: application/json Accept: */* { "code": "string", "name": "string", "description": "string", "custom_type": "USER", "is_active": false, "api_permissions": [ "string" ], "ui_permissions": [ "string" ], "property_ids": [ "string" ] }
200Change status.
{
"result": {
"changed": ["string"]
}
}Delete role
DELETE
Delete a custom role; fails if assigned to users.
Path parameters:
| Name | Type | Required | Description |
|---|---|---|---|
id |
string | Yes | The role ID. |
200Deletion confirmation.application/json
Show properties
delete/admin/company/roles/{id}
DELETE /api/admin/company/roles/{id} HTTP/1.1 Host: {instance}.clym.io Authorization: Bearer YOUR_SECRET_TOKEN Accept: */*
200Deletion confirmation.
{
"result": {
"deleted": false
}
}