--- pageClass: page-reference --- # 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](/concepts/collections/#collection-presets-bookmarks).
[[toc]]
--- ## 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](/reference/api/rest/users/). `role` **many-to-one**\ Role this preset applies to. Many-to-one to [users](/reference/api/rest/roles/). `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 } } } } ```
--- ## List Presets List all presets that exist in Directus.
::: tip 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. ::: ### Query Parameters Supports all [global query parameters](/reference/api/query). ### Returns An array of up to [limit](/reference/api/query/#limit) [preset objects](#the-preset-object). If no items are available, data will be an empty array.
``` GET /presets ``` ```json // Response { "data": [ { "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 } } } }, {...}, {...} ] } ```
--- ## Retrieve a preset List an existing preset by primary key.
### Query Parameters Supports all [global query parameters](/reference/api/query). ### Returns Returns the requested [preset object](#the-preset-object).
``` GET /presets/:id ``` ```json // Response { "data": { "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 } } } } } ```
--- ## Create Preset Create one or more new preset(s).
### Query Parameters Supports all [global query parameters](/reference/api/query). ### Request Body A partial [preset object](#the-preset-object) or an array of partial [preset objects](#the-preset-object). ### Returns Returns the [preset object](#the-preset-object) for the created preset.
``` POST /presets ``` ```json // Request { "user": "410b5772-e63f-4ae6-9ea2-39c3a31bd6ca", "layout": "cards", "search": "Directus" } ``` ```json // Response { "data": { "id": 42, "bookmark": null, "user": "410b5772-e63f-4ae6-9ea2-39c3a31bd6ca", "role": null, "collection": null, "search": "Directus", "filters": null, "layout": "cards", "layout_query": null, "layout_options": null } } ```
--- ## Update Preset Update an existing preset.
### Query Parameters Supports all [global query parameters](/reference/api/query). ### Request Body A partial [preset object](#the-preset-object). ### Returns Returns the [preset object](#the-preset-object) for the created preset.
``` PATCH /presets/:id ``` ```json // Request { "layout": "tabular" } ``` ```json // Response { "data": { "id": 42, "bookmark": null, "user": "410b5772-e63f-4ae6-9ea2-39c3a31bd6ca", "role": null, "collection": null, "search": "Directus", "filters": null, "layout": "tabular", "layout_query": null, "layout_options": null } } ```
--- ## Delete Preset Delete an existing preset.
### Returns Empty body.
``` DELETE /presets/:id ``` ```json // Empty Response ```
--- ## Delete Multiple Presets Delete multiple existing presets.
### Request Body An array of preset primary keys ### Returns Empty body.
``` DELETE /presets ``` ```json // Request [15, 251, 810] ``` ```json // Empty Response ```
---