Fetching all previous versions of a document

Hi all,

Sorry if this has been answered before and I'm missing something obvious.

We have a case where we have a lot of content on Prismic where it is vital to keep a trail of all of its version history. At the moment, we are in the process of migrating all the latest versions of those documents into a new CMS. We'd also like to be able to store all previous versions of the documents in a JSON object or something.

From what I can see, there's no way to directly fetch a specific version of a document. I've read about refs, but these seem to expire after a while so probably not a reliable source.

Another idea I had was to programmatically restore a previous version, then fetch that document and save the object, however after learning there is no write API that doesn't look possible either.

Has anyone else been in a similar situation to this and found a resolution? It's quite a common thing to have version history especially when it comes to legal documents - so surely there's an answer out there somewhere?

Thank you for your help today :slight_smile:

Hi Sian,

Unfortunately, there are no good solutions to this. The only option is republishing the older version manually to a release and then querying that release by its ref.

I appreciate this is time-consuming and not a great workaround, but it's the only option for the time being.

I've passed this as a feature request to the team.