Skip to content

Roles

Built-in and custom roles: named sets of permission keys.

GET/api/roles/catalog
GET/api/roles
GET/api/roles/:id
POST/api/roles
PUT/api/roles/:id
POST/api/roles/:id/reset
DELETE/api/roles/:id

Catalog ​

GET/api/roles/catalog

Permission catalogue for the role editor.

Authentication: bearer token.
Permission: roles.view or users.assign_role.

bash
curl -X GET "https://shellius.example.com/api/roles/catalog" \
  -H "Authorization: Bearer $SHELLIUS_TOKEN"

200 OK

json
{ "success": true, "data": { … } }

List roles ​

GET/api/roles

Authentication: bearer token.
Permission: roles.view or users.assign_role.

bash
curl -X GET "https://shellius.example.com/api/roles" \
  -H "Authorization: Bearer $SHELLIUS_TOKEN"

200 OK

json
{ "success": true, "data": { … } }

Retrieve role ​

GET/api/roles/:id

Authentication: bearer token.
Permission: roles.view.

Path parameters

NameTypeNotes
idstring
bash
curl -X GET "https://shellius.example.com/api/roles/{id}" \
  -H "Authorization: Bearer $SHELLIUS_TOKEN"

200 OK

json
{ "success": true, "data": { … } }

Create role ​

POST/api/roles

Authentication: bearer token.
Permission: roles.manage.

Request body

NameTypeRequiredNotes
namestringYes1–60 characters.
descriptionstringNoAt most 300 characters. May be null.
baseRolestringNo
permissionsobjectNo
copyFromRoleIdstringNoAt most 100 characters.
bash
curl -X POST "https://shellius.example.com/api/roles" \
  -H "Authorization: Bearer $SHELLIUS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "…"
  }'

201 Created

json
{ "success": true, "data": { … } }

Update role ​

PUT/api/roles/:id

Authentication: bearer token.
Permission: roles.manage.

Path parameters

NameTypeNotes
idstring

Request body

NameTypeRequiredNotes
namestringNo1–60 characters.
descriptionstringNoAt most 300 characters. May be null.
baseRolestringNo
permissionsobjectNo
bash
curl -X PUT "https://shellius.example.com/api/roles/{id}" \
  -H "Authorization: Bearer $SHELLIUS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "…",
    "description": "…",
    "baseRole": "…"
  }'

200 OK

json
{ "success": true, "data": { … } }

Reset ​

POST/api/roles/:id/reset

Authentication: bearer token.
Permission: roles.manage.

Path parameters

NameTypeNotes
idstring
bash
curl -X POST "https://shellius.example.com/api/roles/{id}/reset" \
  -H "Authorization: Bearer $SHELLIUS_TOKEN"

200 OK

json
{ "success": true, "data": { … } }

Delete role ​

DELETE/api/roles/:id

Authentication: bearer token.
Permission: roles.manage.

Path parameters

NameTypeNotes
idstring
bash
curl -X DELETE "https://shellius.example.com/api/roles/{id}" \
  -H "Authorization: Bearer $SHELLIUS_TOKEN"

200 OK

json
{ "success": true, "data": { … } }
Was this page helpful?No, tell us why