API Reference

Roles

Roles and their capabilities; changes are signed-in user only.

4 endpoints· Auth: JWT or API Key
get/api/v1/console/roles JWT API Key

Get 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

200Success
cURL
curl -X GET "https://staging-api.panoptesos.com/api/v1/console/roles" \
  -H "X-Api-Key: <YOUR_API_KEY>"
Try itagainst staging · https://staging-api.panoptesos.com

Headers

Set credentials in the “Authorize” menu
post/api/v1/console/roles JWT

Define 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

application/json
{
  "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

200Success
cURL
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"
}'
Try itagainst staging · https://staging-api.panoptesos.com

Request body (JSON)

Headers

This action refuses API keys — it needs a signed-in user. Switch to a JWT under Authorize, or do it in the dashboard.
Set credentials in the “Authorize” menu
put/api/v1/console/roles/{id}/capabilities JWT

Replace 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

application/json
{
  "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

200Success
cURL
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"
  ]
}'
Try itagainst staging · https://staging-api.panoptesos.com

Path parameters

Request body (JSON)

Headers

This action refuses API keys — it needs a signed-in user. Switch to a JWT under Authorize, or do it in the dashboard.
Set credentials in the “Authorize” menu
post/api/v1/console/roles/{id}/retire JWT

Retire 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

application/json
{
  "reason": "string"
}
reason
string
Optional; recorded in the audit payload.

Responses

200Success
cURL
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"
}'
Try itagainst staging · https://staging-api.panoptesos.com

Path parameters

Request body (JSON)

Headers

This action refuses API keys — it needs a signed-in user. Switch to a JWT under Authorize, or do it in the dashboard.
Set credentials in the “Authorize” menu