Get all collection node revisions


I was wondering is it possible to query api/collections/revisions/name_of_collection/_id to get node earlier versions?

There is field being updated and I would like to display all earlier versions.


There is no API route by default. But you could set one up.
Revisions are handled in the helper class “Revisions”

File: modules/Cockpit/Helper/Revisions.php
Access via: $this->app->helper('revisions')

The getList($uniqueEntryId, $limit, $skip) method will return an array of revision entries matching your entry id.

So your setup for a custom endpoint for revisions could be:

# config/api/revisions.php

$entryId = $this->param('entryId', null);

$options = $this->param('options', []);
$limit = $options['limit']; // default is 50 in `getList`
$skip = $options['skip'];

    $this->stop(null, 400); // bad request

return $this->helper('revisions')->getList($entryId, $limit, $skip);

and it will be accessible with any valid account token like


Note: not tested. but should work.