Skip to content
On this page

Preset

Presets hold the preferences of individual users of the platform. This allows Directus to show and maintain custom item listings and bookmarks for users of the app. Learn more about Presets.

The Preset Object

id uuid
Primary key of the preset.

bookmark string
The title of the bookmark. If this value is null, it's considered a preset instead of a bookmark.

user many-to-one
User this preset applies to. Many-to-one to users.

role many-to-one
Role this preset applies to. Many-to-one to users.

collection string
Collection this preset applies to.

search string
The search query used in the preset.

filters array
The filters used in the preset.

layout string
The layout used in this preset.

layout_query object
The item query used by the layout. This structure is based on the used layout.

layout_options object
The options used by the layout. This structure is based on the used layout.

json
{
	"id": 39,
	"bookmark": null,
	"user": "410b5772-e63f-4ae6-9ea2-39c3a31bd6ca",
	"role": null,
	"collection": "directus_activity",
	"search": null,
	"filters": [],
	"layout": "tabular",
	"layout_query": {
		"tabular": {
			"sort": "-timestamp",
			"fields": ["action", "collection", "timestamp", "user"],
			"page": 1
		}
	},
	"layout_options": {
		"tabular": {
			"widths": {
				"action": 100,
				"collection": 210,
				"timestamp": 240,
				"user": 240
			}
		}
	}
}
{
	"id": 39,
	"bookmark": null,
	"user": "410b5772-e63f-4ae6-9ea2-39c3a31bd6ca",
	"role": null,
	"collection": "directus_activity",
	"search": null,
	"filters": [],
	"layout": "tabular",
	"layout_query": {
		"tabular": {
			"sort": "-timestamp",
			"fields": ["action", "collection", "timestamp", "user"],
			"page": 1
		}
	},
	"layout_options": {
		"tabular": {
			"widths": {
				"action": 100,
				"collection": 210,
				"timestamp": 240,
				"user": 240
			}
		}
	}
}

List Presets

List all presets that exist in Directus.

Permissions

The data returned in this endpoint will be filtered based on the user's permissions. For example, presets for a role other than the current user's role won't be returned.

Request

Query Parameters

Supports all global query parameters.

Response

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

Example

Retrieve a preset

List an existing preset by primary key.

Request

Query Parameters

Supports all global query parameters.

Response

Returns the requested preset object.

Example

Create a Preset

Create a new preset.

Request

Query Parameters

Supports all global query parameters.

Request Body

A partial preset object.

Response

Returns the preset object for the created preset.

Example

Create Multiple Presets

Create multiple new presets.

Request

Query Parameters

Supports all global query parameters.

Request Body

An array of partial preset objects.

Response

Returns the preset object for the created preset.

Example

Update a Preset

Update an existing preset.

Request

Query Parameters

Supports all global query parameters.

Request Body

A partial preset object.

Response

Returns the preset object for the updated preset.

Example

Update Multiple Presets

Update multiple existing presets.

Request

Query Parameters

Supports all global query parameters.

Request Body

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

data Required
Any of the preset object's properties.

Response

Returns the preset objects for the updated presets.

Example

Delete a Preset

Delete an existing preset.

Request

Response

Empty body.

Example

Delete Multiple Presets

Delete multiple existing presets.

Request

Request Body

An array of preset primary keys

Response

Empty body.

Example