API Reference
Roles
Roles and their capabilities; changes are signed-in user only.
/api/v1/console/roles JWT API KeyGet roles
Every role this branch can see — the nine seeded and the custom ones defined here — with its grants and how many people hold it, plus what this caller may grant.
- Capability
manage_users- API key scope
cap:manage_users(the key's owner must also hold the capability)
Responses
curl -X GET "https://staging-api.panoptesos.com/api/v1/console/roles" \
-H "X-Api-Key: <YOUR_API_KEY>"Headers
/api/v1/console/roles JWTDefine a custom role, optionally copying another role's grants
The row is minted by the reference-vocabulary create path, so there is one way to create a role.
- Capability
manage_users- Signed-in user only
- API keys and OAuth tokens are refused (403). Do this in the dashboard.
Request body
{
"nameAr": "string",
"nameEn": "string",
"copyFromRoleId": "00000000-0000-0000-0000-000000000000"
}| nameAr string | The Arabic name — NOT NULL on every reference table (FR-ALL-017). |
| nameEn string | The English name, and the seed of the minted code. |
| copyFromRoleId string (uuid) | Start from another role's grants, seeded or custom. Only the capabilities the caller may grant are copied (no escalation, and never a non-delegable one); the response lists the rest. |
Responses
curl -X POST "https://staging-api.panoptesos.com/api/v1/console/roles" \
-H "Content-Type: application/json" \
-H "X-Api-Key: <YOUR_API_KEY>" \
-d '{
"nameAr": "string",
"nameEn": "string",
"copyFromRoleId": "00000000-0000-0000-0000-000000000000"
}'Request body (JSON)
Headers
/api/v1/console/roles/{id}/capabilities JWTReplace a custom role's grants
A seeded role is `CONFLICT`; a capability outside the catalogue or one that never leaves the owner is `VALIDATION`; one the caller does not hold is `FORBIDDEN`. A save made against grants that changed since the editor read them (`expectedCapabilities`, or a concurrent save of the same role) is `CONFLICT``ROLE_CAPABILITIES_CHANGED`. Every holder's session version is bumped.
- Capability
manage_users- Signed-in user only
- API keys and OAuth tokens are refused (403). Do this in the dashboard.
Path parameters
| idrequired string (uuid) | — |
Request body
{
"capabilities": [
"string"
],
"expectedCapabilities": [
"string"
]
}| capabilities string[] | — |
| expectedCapabilities string[] | The role's grants as the editor last read them — the version this edit was made against. When sent and no longer the stored set, the save is refused (409 `ROLE_CAPABILITIES_CHANGED`) rather than silently re-adding a permission somebody else removed in the meantime. Optional, so an older client still saves. |
Responses
curl -X PUT "https://staging-api.panoptesos.com/api/v1/console/roles/{id}/capabilities" \
-H "Content-Type: application/json" \
-H "X-Api-Key: <YOUR_API_KEY>" \
-d '{
"capabilities": [
"string"
],
"expectedCapabilities": [
"string"
]
}'Path parameters
Request body (JSON)
Headers
/api/v1/console/roles/{id}/retire JWTRetire a custom role nobody holds (`active = false`)
Refused while anybody does.
- Capability
manage_users- Signed-in user only
- API keys and OAuth tokens are refused (403). Do this in the dashboard.
Path parameters
| idrequired string (uuid) | — |
Request body
{
"reason": "string"
}| reason string | Optional; recorded in the audit payload. |
Responses
curl -X POST "https://staging-api.panoptesos.com/api/v1/console/roles/{id}/retire" \
-H "Content-Type: application/json" \
-H "X-Api-Key: <YOUR_API_KEY>" \
-d '{
"reason": "string"
}'Path parameters
Request body (JSON)
Headers