Folders
List Folders
List all folders 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.
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.
What metadata to return in the response.
GET /folders
{
"data": [
{
"id": "0cf0e03d-4364-45df-b77b-ca61f61869d2",
"name": "New York",
"parent": "{\n \"data\": {\n \"id\": \"fc02d733-95b8-4e27-bd4b-08a32cbe4e66\",\n \"name\": \"Test\",\n \"parent\": null\n }\n}\n"
}
],
"meta": {}
}
Create Multiple Folders
Create multiple new (virtual) folders.
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 /folders
{
"data": [
{
"id": "0cf0e03d-4364-45df-b77b-ca61f61869d2",
"name": "New York",
"parent": "{\n \"data\": {\n \"id\": \"fc02d733-95b8-4e27-bd4b-08a32cbe4e66\",\n \"name\": \"Test\",\n \"parent\": null\n }\n}\n"
}
],
"meta": {}
}
Delete Multiple Folders
Delete multiple existing folders. Any files in these folders will be moved to the root folder.
DELETE /folders
Update Multiple Folders
Update multiple folders at the same time. Any files in these folders will be moved to the root folder.
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 /folders
{
"data": [
{
"id": "0cf0e03d-4364-45df-b77b-ca61f61869d2",
"name": "New York",
"parent": "{\n \"data\": {\n \"id\": \"fc02d733-95b8-4e27-bd4b-08a32cbe4e66\",\n \"name\": \"Test\",\n \"parent\": null\n }\n}\n"
}
],
"meta": {}
}
Create a Folder
Create a new (virtual) folder.
Query Parameters
Control what fields are being returned in the object.
What metadata to return in the response.
Request Body
Name of the folder.
Unique identifier of the parent folder. This allows for nested folders.
POST /folders
{
"data": {
"id": "0cf0e03d-4364-45df-b77b-ca61f61869d2",
"name": "New York",
"parent": "{\n \"data\": {\n \"id\": \"fc02d733-95b8-4e27-bd4b-08a32cbe4e66\",\n \"name\": \"Test\",\n \"parent\": null\n }\n}\n"
}
}
Retrieve a Folder
List an existing folder by primary key.
Query Parameters
Unique identifier for the object.
Control what fields are being returned in the object.
What metadata to return in the response.
GET /folders/{id}
{
"data": {
"id": "0cf0e03d-4364-45df-b77b-ca61f61869d2",
"name": "New York",
"parent": "{\n \"data\": {\n \"id\": \"fc02d733-95b8-4e27-bd4b-08a32cbe4e66\",\n \"name\": \"Test\",\n \"parent\": null\n }\n}\n"
}
}
Delete a Folder
Delete an existing folder. Any files in this folder will be moved to the root folder.
Query Parameters
Unique identifier for the object.
DELETE /folders/{id}
Update a Folder
Update an existing folder.
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
Name of the folder. Can't be null or empty.
Unique identifier of the parent folder. This allows for nested folders.
PATCH /folders/{id}
{
"data": {
"id": "0cf0e03d-4364-45df-b77b-ca61f61869d2",
"name": "New York",
"parent": "{\n \"data\": {\n \"id\": \"fc02d733-95b8-4e27-bd4b-08a32cbe4e66\",\n \"name\": \"Test\",\n \"parent\": null\n }\n}\n"
}
}