View document revision history by API

Hi community,

Is there any way to consult a document revision history with API.
I want to know for a specific document all version and the date related to.
It's to handle our terms and conditions revisions and make a link between them and what version a user validated.

Hi Guillaume,

Welcome to the Prismic forum, and thanks for posting :blush:

You cannot access document history via the API. With the API, you can access the current version, previews, and releases using refs. You can find more information on refs here and here.

You can browse your document's full revision history and visualize changes in each revision inside the Prismic Writing Room. Here's more information on how to do that.

If you want to track and monitor changes in your repo moving forward, one option might be to use Webhooks to send a POST when a document is changed. If you send the POST to a service like Zapier, you could add each version of your T&Cs to a Google Sheet to cross-reference with your CRM.

Alternatively, an easier option would be to republish your T&Cs each time there is a change, rather than editing the document, and showing the most recent version on your site. That way you would have the previous version with their published dates accessible in the API.

Please let me know if you have any other questions!

Best,
Sam