younifyd
Menu

Get Revision

Get a document revision

GET/data/history/{dataset}/documents/{documentId}

Use it in a workflow

  1. Add a step and choose the Sanity connector.
  2. Pick the Get Revision action (under History).
  3. Fill in the fields below, then reference the result from later steps as {{getRevision.response.data}}.

Request

Path parameters

datasetstringrequired
documentIdstringrequired

Query parameters

revisionstring

The revision ID (_rev) to fetch. Mutually exclusive with `time` and `lastRevision`.

timestring (date-time)

Time to fetch the document at. Mutually exclusive with `lastRevision` and `revision`.

lastRevisionboolean

If true, only the last revision will be returned, or the last state before deletion for a deleted document. Mutually exclusive with `time` and `revision`.

Response

Returns 200 with an object. Read it in later steps with {{getRevision.response.data.<field>}}.

documentsarray<object>
_idstring

The document ID

_createdAtstring (date-time)

The date and time the document was created.

_updatedAtstring (date-time)

The date and time the document was last updated.

_revstring

The revision ID (_rev) of the document.

_typestring

The type of the document.

additionalPropertiesany
json
{
  "documents": [
    {
      "_id": "123456",
      "_createdAt": "2021-01-01T00:00:00Z",
      "_updatedAt": "2021-01-01T00:00:00Z",
      "_rev": "123456",
      "_type": "article",
      "additionalProperties": null
    }
  ]
}

Need more? See the Sanity guide for connection setup and behaviour shared by every action.