API reference
Roles
4 endpoints. Click one to see its parameters, fields and an example. Code samples use the region you pick.
GET/v1/rolesList roles
List roles
Example
curl "https://ca-api.clocklap.com/v1/roles" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY"Responses
200
POST/v1/rolesCreate a role
Create a role
Body (JSON)
| Name | Type | Description |
|---|---|---|
namerequired | string | |
description | string | |
permissions | array of string | Default [] |
clone_from | string |
Example
curl -X POST "https://ca-api.clocklap.com/v1/roles" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Example","description":"string","permissions":[],"clone_from":"string"}'Responses
200
PATCH/v1/roles/{id}Update one role
Update one role
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string |
Body (JSON)
| Name | Type | Description |
|---|---|---|
name | string | |
description | string | |
permissions | array of string |
Example
curl -X PATCH "https://ca-api.clocklap.com/v1/roles/{id}" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Example","description":"string","permissions":["string"]}'Responses
200
DELETE/v1/roles/{id}Delete one role
Delete one role
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string |
Example
curl -X DELETE "https://ca-api.clocklap.com/v1/roles/{id}" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY"Responses
200