Public reference
Roles
Every endpoint in this group. Open one for its parameters and a worked example.
Roles
7GET /api/v1/roles List roles
Every role visible to the tenant, with its permission count and the exact code set it grants. System roles sort first.
- Authentication
- Staff token or session
- Requires permission
-
prm_roles_manageManage roles & permissions
Un-paginated. template_key is the provisioning slug a seeded role came from, and is null for a hand-made one — it is populated by this list only, not by the role pickers.
{
"data": [
{
"id": 2,
"tenant_id": 12,
"name": "support",
"description": "Read subscribers, reply to tickets",
"is_system": false,
"template_key": "support",
"immutable": false,
"permission_count": 14,
"permissions": ["prm_tickets_reply", "prm_tickets_view", "prm_users_index"]
}
]
}
POST /api/v1/roles Create a role
Creates a named permission set. A caller may only grant codes they hold themselves, so a role cannot be used to mint authority its author does not have.
- Authentication
- Staff token or session
- Requires permission
-
prm_roles_manageManage roles & permissions - Rate limit
t_mutate
The containment rule is the point of this endpoint. You cannot author a role carrying a permission you lack, and you cannot assign someone else's role that carries one either — the assign path runs the same check, because otherwise the author check would be trivially bypassed.
Parameters
| Parameter | Description |
|---|---|
namerequired
body · string
|
Unique within the tenant. Reserved names are refused. |
permissions
body · array
|
Permission codes from the catalogue. Unknown codes are rejected, not dropped. |
POST /api/v1/roles/bulk-delete Manage roles & permissions
- Authentication
- Staff token or session
- Requires permission
-
prm_roles_manageManage roles & permissions - Rate limit
t_mutate
Read straight from the router that serves this instance. A hand-written description of this endpoint has not been added yet.
DELETE /api/v1/roles/{id} Delete a role
Removes the role. System and immutable roles are refused, and so is a role that is still assigned.
- Authentication
- Staff token or session
- Requires permission
-
prm_roles_manageManage roles & permissions - Rate limit
t_mutate
Parameters
| Parameter | Description |
|---|---|
idrequired
path · integer
|
Role id. |
GET /api/v1/roles/{id} Fetch one role
The role and the exact set of permission codes it grants.
- Authentication
- Staff token or session
- Requires permission
-
prm_roles_manageManage roles & permissions
Parameters
| Parameter | Description |
|---|---|
idrequired
path · integer
|
Role id. |
PATCH /api/v1/roles/{id} Update a role
Edits the name, description and permission set. The immutable administrator role cannot be edited at all.
- Authentication
- Staff token or session
- Requires permission
-
prm_roles_manageManage roles & permissions - Rate limit
t_mutate
Changing a role changes the authority of every manager holding it, and every API token those managers own, on the next request. There is no notification and no record against the affected tokens.
Parameters
| Parameter | Description |
|---|---|
idrequired
path · integer
|
Role id. |
PUT /api/v1/roles/{id}/portal-permissions Set a role's subscriber-portal permissions
The separate set that governs what a SUBSCRIBER may do in the self-service portal, not what a manager may do in the admin API. Different catalogue, different meaning.
- Authentication
- Staff token or session
- Requires permission
-
prm_roles_manageManage roles & permissions - Rate limit
t_mutate
These are not prm_* codes and they do not affect the admin API at all. Confusing the two sets is the usual cause of "I gave the role the permission and nothing changed".
Parameters
| Parameter | Description |
|---|---|
idrequired
path · integer
|
Role id. |
No endpoint matches that search.
Written to be read by machines too
The reference is public and needs no account, so a tool that has never seen X-Radius can reach a correct first call on its own.
- /llms.txt
- An index of every page, with one-line summaries.
- /llms-full.txt
- The whole reference as one Markdown file, with no navigation to crawl.
- /openapi.json
- OpenAPI 3.1, generated from the router that serves this instance.
- /skill.md
- A ready-made skill file for an assistant: authentication, the response envelope and the error codes in one page.
<page-url>.md- Append .md to any reference URL for the same page as Markdown.
Accept: text/markdown- Send this header on the ordinary URL and the answer comes back as Markdown instead.
Read https://x-radius.com/llms.txt, then fetch the endpoint you need as Markdown by appending .md to its URL.