Presets
List Presets
List all presets that exist in Directus. 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
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.
Cursor for use in pagination. Often used in combination with limit.
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 /presets
{
"data": [
{
"id": 155,
"user": "63716273-0f29-4648-8a2a-2af2948f6f78",
"role": "50419801-0f30-8644-2b3c-9bc2d980d0a0",
"collection": "articles",
"layout": null,
"layout_query": {
"cards": {
"sort": "-published_on"
}
},
"layout_options": {
"cards": {
"icon": "account_circle",
"title": "{{ first_name }} {{ last_name }}",
"subtitle": "{{ title }}",
"size": 3
}
},
"filters": []
}
],
"meta": {}
}
Create Multiple Presets
Create multiple new Presets.
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 /presets
{
"data": [
{
"id": 155,
"user": "63716273-0f29-4648-8a2a-2af2948f6f78",
"role": "50419801-0f30-8644-2b3c-9bc2d980d0a0",
"collection": "articles",
"layout": null,
"layout_query": {
"cards": {
"sort": "-published_on"
}
},
"layout_options": {
"cards": {
"icon": "account_circle",
"title": "{{ first_name }} {{ last_name }}",
"subtitle": "{{ title }}",
"size": 3
}
},
"filters": []
}
],
"meta": {}
}
Delete Multiple Presets
Delete multiple existing presets.
DELETE /presets
Update Multiple Presets
Update multiple presets at the same time.
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 /presets
{
"data": [
{
"id": 155,
"user": "63716273-0f29-4648-8a2a-2af2948f6f78",
"role": "50419801-0f30-8644-2b3c-9bc2d980d0a0",
"collection": "articles",
"layout": null,
"layout_query": {
"cards": {
"sort": "-published_on"
}
},
"layout_options": {
"cards": {
"icon": "account_circle",
"title": "{{ first_name }} {{ last_name }}",
"subtitle": "{{ title }}",
"size": 3
}
},
"filters": []
}
],
"meta": {}
}
Create a Preset
Create a new preset.
Query Parameters
Control what fields are being returned in the object.
What metadata to return in the response.
Request Body
What collection this collection preset is used for.
Name for the bookmark. If this is set, the collection preset will be considered to be a bookmark.
The unique identifier of a role in the platform. If user is null, this will be used to apply the collection preset or bookmark for all users in the role.
What the user searched for in search/filter in the header bar.
Name of the view type that is used.
Layout query that's saved per layout type. Controls what data is fetched on load. These follow the same format as the JS SDK parameters.
Options of the views. The properties in here are controlled by the layout.
POST /presets
{
"data": {
"id": 155,
"user": "63716273-0f29-4648-8a2a-2af2948f6f78",
"role": "50419801-0f30-8644-2b3c-9bc2d980d0a0",
"collection": "articles",
"layout": null,
"layout_query": {
"cards": {
"sort": "-published_on"
}
},
"layout_options": {
"cards": {
"icon": "account_circle",
"title": "{{ first_name }} {{ last_name }}",
"subtitle": "{{ title }}",
"size": 3
}
},
"filters": []
}
}
Retrieve a Preset
Retrieve a single preset by unique identifier.
Query Parameters
Identifier for the object.
Control what fields are being returned in the object.
What metadata to return in the response.
GET /presets/{id}
{
"data": {
"id": 155,
"user": "63716273-0f29-4648-8a2a-2af2948f6f78",
"role": "50419801-0f30-8644-2b3c-9bc2d980d0a0",
"collection": "articles",
"layout": null,
"layout_query": {
"cards": {
"sort": "-published_on"
}
},
"layout_options": {
"cards": {
"icon": "account_circle",
"title": "{{ first_name }} {{ last_name }}",
"subtitle": "{{ title }}",
"size": 3
}
},
"filters": []
}
}
DELETE /presets/{id}
Update a Preset
Update an existing preset.
Query Parameters
Identifier for the object.
Control what fields are being returned in the object.
What metadata to return in the response.
Request Body
What collection this collection preset is used for.
Name for the bookmark. If this is set, the collection preset will be considered to be a bookmark.
The unique identifier of a role in the platform. If user is null, this will be used to apply the collection preset or bookmark for all users in the role.
What the user searched for in search/filter in the header bar.
Name of the view type that is used. Defaults to tabular.
View query that's saved per view type. Controls what data is fetched on load. These follow the same format as the JS SDK parameters.
Options of the views. The properties in here are controlled by the layout.
Key value pair of language-translation. Can be used to translate the bookmark title in multiple languages.
PATCH /presets/{id}
{
"data": {
"id": 155,
"user": "63716273-0f29-4648-8a2a-2af2948f6f78",
"role": "50419801-0f30-8644-2b3c-9bc2d980d0a0",
"collection": "articles",
"layout": null,
"layout_query": {
"cards": {
"sort": "-published_on"
}
},
"layout_options": {
"cards": {
"icon": "account_circle",
"title": "{{ first_name }} {{ last_name }}",
"subtitle": "{{ title }}",
"size": 3
}
},
"filters": []
}
}