Skip to content
On this page

Directus Cloud

Everything you need to start building. Provisioned in 90 seconds. Starting at $15/month.

Get Started

Folders

Folders can be used to organize files within the platform. Folders are virtual, and aren't mirrored within the storage adapter.

The Folder Object

id uuid
Primary key of the folder.

name string
Name of the folder.

parent many-to-one
Parent folder. Many-to-one to folders (recursive).

json
{
	"data": {
		"id": "fc02d733-95b8-4e27-bd4b-08a32cbe4e66",
		"name": "Test",
		"parent": null
	}
}
{
	"data": {
		"id": "fc02d733-95b8-4e27-bd4b-08a32cbe4e66",
		"name": "Test",
		"parent": null
	}
}

List Folders

List all folders that exist in Directus.

Request

Query Parameters

Supports all global query parameters.

Response

An array of up to limit folder objects. If no items are available, data will be an empty array.

Example

Retrieve a Folder

List an existing folder by primary key.

Request

Query Parameters

Supports all global query parameters.

Response

Returns a folder object if a valid primary key was provided.

Example

Create a Folder

Create a new (virtual) folder.

Request

Query Parameters

Supports all global query parameters.

Request Body

A partial folder object. name is required.

Response

Returns the folder object of the folder that was created.

Example

Create Multiple Folders

Create multiple new (virtual) folders.

Request

Query Parameters

Supports all global query parameters.

Request Body

An array of partial folder objects. name is required.

Response

Returns the folder object of the folder that was created.

Example

Update a Folder

Update an existing folder.

Request

Query Parameters

Supports all global query parameters.

Request Body

A partial folder object.

Response

Returns the folder object of the folder that was updated.

Example

Update Multiple Folders

Update multiple existing folders.

Request

Query Parameters

Supports all global query parameters.

Request Body

keys Required
Array of primary keys of the folders you'd like to update.

data Required
Any of the folder object's properties.

Response

Returns the folder objects of the folders that were updated.

Example

Delete a Folder

Delete an existing folder.

Files

Any files in this folder will be moved to the root folder.

Request

Response

Empty body.

Example

Delete Multiple Folders

Delete multiple existing folders.

Files

Any files in these folders will be moved to the root folder.

Request

Request Body

An array of folder primary keys.

Returns

Empty body.

Example