Versions
List Content Versions
List all content versions 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.
What metadata to return in the response.
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.
GET /versions
{
"data": [
{
"id": "63716273-0f29-4648-8a2a-2af2948f6f78",
"key": "draft",
"name": "My Draft",
"collection": "articles",
"item": "168",
"date_created": "2022-05-11T13:14:52Z",
"date_updated": "2022-05-11T13:14:53Z",
"user_created": "63716273-0f29-4648-8a2a-2af2948f6f78",
"user_updated": "63716273-0f29-4648-8a2a-2af2948f6f78",
"delta": {}
}
],
"meta": {}
}
Create Multiple Content Versions
Create multiple new content versions.
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 /versions
{
"data": [
{
"id": "63716273-0f29-4648-8a2a-2af2948f6f78",
"key": "draft",
"name": "My Draft",
"collection": "articles",
"item": "168",
"date_created": "2022-05-11T13:14:52Z",
"date_updated": "2022-05-11T13:14:53Z",
"user_created": "63716273-0f29-4648-8a2a-2af2948f6f78",
"user_updated": "63716273-0f29-4648-8a2a-2af2948f6f78",
"delta": {}
}
],
"meta": {}
}
Delete Multiple Content Versions
Delete multiple existing content versions.
DELETE /versions
Update Multiple Content Versions
Update multiple content versions 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 /versions
{
"data": [
{
"id": "63716273-0f29-4648-8a2a-2af2948f6f78",
"key": "draft",
"name": "My Draft",
"collection": "articles",
"item": "168",
"date_created": "2022-05-11T13:14:52Z",
"date_updated": "2022-05-11T13:14:53Z",
"user_created": "63716273-0f29-4648-8a2a-2af2948f6f78",
"user_updated": "63716273-0f29-4648-8a2a-2af2948f6f78",
"delta": {}
}
],
"meta": {}
}
Create a Content Versions
Create a new content version for an item.
Query Parameters
Control what fields are being returned in the object.
What metadata to return in the response.
Request Body
POST /versions
{
"data": {
"id": "63716273-0f29-4648-8a2a-2af2948f6f78",
"key": "draft",
"name": "My Draft",
"collection": "articles",
"item": "168",
"date_created": "2022-05-11T13:14:52Z",
"date_updated": "2022-05-11T13:14:53Z",
"user_created": "63716273-0f29-4648-8a2a-2af2948f6f78",
"user_updated": "63716273-0f29-4648-8a2a-2af2948f6f78",
"delta": {}
}
}
Retrieve a Content Version
Retrieve a single content version by unique identifier.
Query Parameters
Unique identifier for the object.
Control what fields are being returned in the object.
What metadata to return in the response.
GET /versions/{id}
{
"data": {
"id": "63716273-0f29-4648-8a2a-2af2948f6f78",
"key": "draft",
"name": "My Draft",
"collection": "articles",
"item": "168",
"date_created": "2022-05-11T13:14:52Z",
"date_updated": "2022-05-11T13:14:53Z",
"user_created": "63716273-0f29-4648-8a2a-2af2948f6f78",
"user_updated": "63716273-0f29-4648-8a2a-2af2948f6f78",
"delta": {}
}
}
Delete a Content Version
Delete an existing content version.
Query Parameters
Unique identifier for the object.
DELETE /versions/{id}
Update a Content Version
Update an existing content version.
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
PATCH /versions/{id}
{
"data": {
"id": "63716273-0f29-4648-8a2a-2af2948f6f78",
"key": "draft",
"name": "My Draft",
"collection": "articles",
"item": "168",
"date_created": "2022-05-11T13:14:52Z",
"date_updated": "2022-05-11T13:14:53Z",
"user_created": "63716273-0f29-4648-8a2a-2af2948f6f78",
"user_updated": "63716273-0f29-4648-8a2a-2af2948f6f78",
"delta": {}
}
}
Compare a Content Version
Compare an existing content version with the main version of the item.
Query Parameters
Unique identifier for the object.
GET /versions/{id}/compare
{
"data": {}
}
Promote a Content Version
Promote an existing content version to become the new main version of the item.
Query Parameters
Unique identifier for the object.
Request Body
Hash of the main version of the item to be promoted.
Optional array of field names of which the values are to be promoted.
POST /versions/{id}/promote
Save to a Content Version
Save item changes to an existing content version.
Query Parameters
Unique identifier for the object.
POST /versions/{id}/save
{
"data": {}
}