Roles
List Roles
List all roles that exist in Directus.
Query Parameters
Control what fields are being returned in the object.
A limit on the number of objects that are returned.
How many items to skip when fetching data.
What metadata to return in the response.
How to sort the returned items. sort
is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (-
) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV. You can also use a ?
to sort randomly.
Select items in collection by given conditions.
Filter by items that contain the given search query in one of their fields.
Cursor for use in pagination. Often used in combination with limit.
GET /roles
{
"data": [
{
"id": "2f24211d-d928-469a-aea3-3c8f53d4e426",
"name": "Administrator",
"icon": "verified_user",
"description": "Admins have access to all managed data within the system by default",
"children": [],
"policies": [],
"users": []
}
],
"meta": {}
}
Create Multiple Roles
Create multiple new roles.
Query Parameters
Control what fields are being returned in the object.
A limit on the number of objects that are returned.
What metadata to return in the response.
How many items to skip when fetching data.
How to sort the returned items. sort
is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (-
) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV. You can also use a ?
to sort randomly.
Select items in collection by given conditions.
Filter by items that contain the given search query in one of their fields.
Request Body
POST /roles
{
"data": [
{
"id": "2f24211d-d928-469a-aea3-3c8f53d4e426",
"name": "Administrator",
"icon": "verified_user",
"description": "Admins have access to all managed data within the system by default",
"children": [],
"policies": [],
"users": []
}
],
"meta": {}
}
Delete Multiple Roles
Delete multiple existing roles.
DELETE /roles
Update Multiple Roles
Update multiple roles at the same time.
Query Parameters
Control what fields are being returned in the object.
A limit on the number of objects that are returned.
What metadata to return in the response.
How many items to skip when fetching data.
How to sort the returned items. sort
is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (-
) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV. You can also use a ?
to sort randomly.
Select items in collection by given conditions.
Filter by items that contain the given search query in one of their fields.
Request Body
PATCH /roles
{
"data": [
{
"id": "2f24211d-d928-469a-aea3-3c8f53d4e426",
"name": "Administrator",
"icon": "verified_user",
"description": "Admins have access to all managed data within the system by default",
"children": [],
"policies": [],
"users": []
}
],
"meta": {}
}
Create a Role
Create a new role.
Query Parameters
Control what fields are being returned in the object.
What metadata to return in the response.
Request Body
Description of the role.
Whether or not this role enforces the use of 2FA.
ID used with external services in SCIM.
Array of IP addresses that are allowed to connect to the API as a user of this role.
Custom override for the admin app module bar navigation.
Name of the role.
POST /roles
{
"data": {
"id": "2f24211d-d928-469a-aea3-3c8f53d4e426",
"name": "Administrator",
"icon": "verified_user",
"description": "Admins have access to all managed data within the system by default",
"children": [],
"policies": [],
"users": []
}
}
Retrieve a Role
Retrieve a single role by unique identifier.
Query Parameters
Unique identifier for the object.
Control what fields are being returned in the object.
What metadata to return in the response.
GET /roles/{id}
{
"data": {
"id": "2f24211d-d928-469a-aea3-3c8f53d4e426",
"name": "Administrator",
"icon": "verified_user",
"description": "Admins have access to all managed data within the system by default",
"children": [],
"policies": [],
"users": []
}
}
DELETE /roles/{id}
Update a Role
Update an existing role.
Query Parameters
Unique identifier for the object.
Control what fields are being returned in the object.
What metadata to return in the response.
Request Body
Description of the role.
Whether or not this role enforces the use of 2FA.
ID used with external services in SCIM.
Array of IP addresses that are allowed to connect to the API as a user of this role.
Custom override for the admin app module bar navigation.
Name of the role.
PATCH /roles/{id}
{
"data": {
"id": "2f24211d-d928-469a-aea3-3c8f53d4e426",
"name": "Administrator",
"icon": "verified_user",
"description": "Admins have access to all managed data within the system by default",
"children": [],
"policies": [],
"users": []
}
}