Revisions

Revisions are individual changes to items made. Directus keeps track of changes made, so you're able to revert to a previous state at will.

List Revisions

List the revisions. The data returned in this endpoint will be filtered based on the user's permissions. For example, revisions that apply to a collection that the current user doesn't have access to are stripped out.

Query Parameters

fields
array

Control what fields are being returned in the object.

limit
integer

A limit on the number of objects that are returned.

offset
integer

How many items to skip when fetching data.

meta
string

What metadata to return in the response.

sort
array

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.

filter

Select items in collection by given conditions.

search
string

Filter by items that contain the given search query in one of their fields.

page
integer

Cursor for use in pagination. Often used in combination with limit.

Response

Successful request

data
array
meta
object
GET /revisions
Response Example
{
  "data": [
    {
      "id": 1,
      "activity": 2,
      "collection": "articles",
      "item": "168",
      "data": {
        "author": 1,
        "body": "This is my first post",
        "featured_image": 15,
        "id": "168",
        "title": "Hello, World!"
      },
      "delta": {
        "title": "Hello, World!"
      },
      "parent": null,
      "version": "draft"
    }
  ],
  "meta": {}
}

Retrieve a Revision

List an existing revision by primary key.

Query Parameters

id
integer

Identifier for the object.

fields
array

Control what fields are being returned in the object.

meta
string

What metadata to return in the response.

Response

Successful request

data
object
GET /revisions/{id}
Response Example
{
  "data": {
    "id": 1,
    "activity": 2,
    "collection": "articles",
    "item": "168",
    "data": {
      "author": 1,
      "body": "This is my first post",
      "featured_image": 15,
      "id": "168",
      "title": "Hello, World!"
    },
    "delta": {
      "title": "Hello, World!"
    },
    "parent": null,
    "version": "draft"
  }
}