Policies
List Policies
List all policies 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 /policies
{
"data": [
{
"id": "22640672-eef0-4ee9-ab04-591f3afb288",
"name": "Admin",
"icon": "supervised_user_circle",
"description": null,
"ip_access": null,
"enforce_tfa": false,
"admin_access": true,
"app_access": true,
"users": [
"0bc7b36a-9ba9-4ce0-83f0-0a526f354e07"
],
"roles": [
"8b4474c0-288d-4bb8-b62e-8330646bb6aa"
],
"permissions": [
"5c74c86f-cab0-4b14-a3c4-cd4f2363e826"
]
}
],
"meta": {}
}
Create Multiple Policies
Create multiple new policies.
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 /policies
{
"data": [
{
"id": "22640672-eef0-4ee9-ab04-591f3afb288",
"name": "Admin",
"icon": "supervised_user_circle",
"description": null,
"ip_access": null,
"enforce_tfa": false,
"admin_access": true,
"app_access": true,
"users": [
"0bc7b36a-9ba9-4ce0-83f0-0a526f354e07"
],
"roles": [
"8b4474c0-288d-4bb8-b62e-8330646bb6aa"
],
"permissions": [
"5c74c86f-cab0-4b14-a3c4-cd4f2363e826"
]
}
],
"meta": {}
}
Delete Multiple Policies
Delete multiple existing policies.
DELETE /policies
Update Multiple Policies
Update multiple existing policies.
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 /policies
{
"data": [
{
"id": "22640672-eef0-4ee9-ab04-591f3afb288",
"name": "Admin",
"icon": "supervised_user_circle",
"description": null,
"ip_access": null,
"enforce_tfa": false,
"admin_access": true,
"app_access": true,
"users": [
"0bc7b36a-9ba9-4ce0-83f0-0a526f354e07"
],
"roles": [
"8b4474c0-288d-4bb8-b62e-8330646bb6aa"
],
"permissions": [
"5c74c86f-cab0-4b14-a3c4-cd4f2363e826"
]
}
],
"meta": {}
}
Create a Policy
Create a new policy.
Query Parameters
Control what fields are being returned in the object.
What metadata to return in the response.
Request Body
POST /policies
{
"data": {
"id": "22640672-eef0-4ee9-ab04-591f3afb288",
"name": "Admin",
"icon": "supervised_user_circle",
"description": null,
"ip_access": null,
"enforce_tfa": false,
"admin_access": true,
"app_access": true,
"users": [
"0bc7b36a-9ba9-4ce0-83f0-0a526f354e07"
],
"roles": [
"8b4474c0-288d-4bb8-b62e-8330646bb6aa"
],
"permissions": [
"5c74c86f-cab0-4b14-a3c4-cd4f2363e826"
]
}
}
Retrieve a Policy
List an existing policy by primary key.
Query Parameters
Unique identifier of the Policy.
Control what fields are being returned in the object.
What metadata to return in the response.
GET /policies/{id}
{
"data": {
"id": "22640672-eef0-4ee9-ab04-591f3afb288",
"name": "Admin",
"icon": "supervised_user_circle",
"description": null,
"ip_access": null,
"enforce_tfa": false,
"admin_access": true,
"app_access": true,
"users": [
"0bc7b36a-9ba9-4ce0-83f0-0a526f354e07"
],
"roles": [
"8b4474c0-288d-4bb8-b62e-8330646bb6aa"
],
"permissions": [
"5c74c86f-cab0-4b14-a3c4-cd4f2363e826"
]
}
}
DELETE /policies/{id}
Update a Policy
Update an existing policy.
Query Parameters
Unique identifier of the policy.
Control what fields are being returned in the object.
What metadata to return in the response.
Request Body
PATCH /policies/{id}
{
"data": {
"id": "22640672-eef0-4ee9-ab04-591f3afb288",
"name": "Admin",
"icon": "supervised_user_circle",
"description": null,
"ip_access": null,
"enforce_tfa": false,
"admin_access": true,
"app_access": true,
"users": [
"0bc7b36a-9ba9-4ce0-83f0-0a526f354e07"
],
"roles": [
"8b4474c0-288d-4bb8-b62e-8330646bb6aa"
],
"permissions": [
"5c74c86f-cab0-4b14-a3c4-cd4f2363e826"
]
}
}