Skip to content
👀 See Sanity in action: Watch product demo now →
Sanity
Get started
  • Sanity Studio - Flexible editing environment
  • Content Lake - Real-time database
  • Developer experience - Tooling you love
  • Structured content - The philosophy behind Sanity
  • Review changes - View edits & rollback instantly
  • Image pipeline - On-demand transformations
  • E-commerce - Better shopping experiences
  • Marketing sites - Control your story
  • Products & services - Innovate and automate
  • Mobile apps - Content backend for every OS
  • Aether - Unique digital shopping experience
  • Morning Brew - Omnichannel media distribution
  • InVision - Delivering exceptional customer experiences
  • DataStax - Personalization for global audience
  • React
  • Gatsby
  • Next
  • Nuxt
  • Eleventy
  • Netlify
  • Vercel
  • Algolia
  • Documentation
  • Reference
  • Guides
  • Resource library
  • Headless CMS
  • Tools & plugins
  • Project showcase
  • Schemas & snippets
  • Agency partners
  • Technology partners
  • Get support
  • Share your work
  • Enterprise SSO
EnterprisePricing
Contact salesLog inGet started
Published June 25th 2019

Introducing History API & Experience

We're happy to introduce document history for Sanity Studio, as well an a documented History API. Now you can roll back documents to earlier revisions and see who did changes.

Even Eidsten Westvang

Even is a Sanity.io co-founder and product person

We’re thrilled to announce that we have released a new document history experience in Sanity Studio, as well as a new API for querying document revisions. Upgrade your Studio (sanity upgrade) to get the new features, and visit our documentation.

Now you can browse revisions for documents, as well as restore earlier versions. Both via an API and in Sanity Studio. You can now also see who made the edits which is a significant improvement to collaborative workflows.

The History API and Experience

To make a History Experience for people working with content in the Studio, we had to build APIs that it could query. Obviously, since the Studio is open source and can be hosted anywhere, we had to make these APIs are available for you to use however you see fit outside of the Studio as well. To learn more about the different endpoints and how they work, check out the API documentation.

What we call “History Experience” is the user interface for browsing through revisions, and restoring them within the Studio. This includes some new labels for document status, which we hope will make it easier to spot if a document is a draft, and if it has been published.

This UI is only the first public iteration. Features like diffing between revisions will come at a later point. It's a non-trivial design challenge, since Sanity allows you to have deeply nested structured content. We really want to get diffing right, so it's both intuitive and useful for people who work with content.

How long do we remember?

History retention is the amount of time you have access to these revisions before they are automatically deleted. The latest version of your published and drafted document will always be available.

The retention period on your documents are defined by the plan you are on. We count retention time backward from the current day.

The retention time for the different plans are:

  • Standard (free, pay-as-you-go): 3 days
  • Advanced: 90 days, can be upgraded to 365 days
  • Enterprise: 365 days, or contact us for custom retention

Revisions that are older than the cutoff will be truncated into one revision item, older transactions will be permanently deleted. The document history is truncated regularly every day.

GDPR and the ability to forget

In order to make Sanity Studio real-time we made it send debounced keystrokes as patches to the backend. From when we launched publicly in fall 2017, to spring 2018, we kept a complete history of these patches. But in order to be compliant with the European General Data Protection Regulation (GDPR), we had to build the mechanisms to be able to also forget all these patches. Forgetting is actually a feature.

According to the GDPR, you need to be able to guarantee your data is actually scrubbed within a given time limit. This absolutely also goes for personally sensitive data in your content. This means that staying GDPR compliant will be a breeze with Sanity, compared to other content platforms where you would have to build mechanisms to clean your history in Git or in your database.

Obviously, if you choose export your documents or patch events outside of Sanity, it will be on you to take care of in terms of GPDR compliance. Fortunately, that shouldn't be too difficult with structured content.

Page content

  • The History API and Experience
    • How long do we remember?
    • GDPR and the ability to forget

Platform

Structured ContentDeveloper experienceContent LakeSanity StudioSecurity & Compliance
  • Sanity vs Contentful
  • Sanity vs Strapi
  • Sanity vs Adobe Experience Manager
  • Sanity vs Hygraph
  • Sanity vs Sitecore
  • Sanity vs Storyblok
  • Sanity vs Contentstack
  • Sanity vs Prismic
  • Sanity vs Drupal

Resources

Documentation
  • React Blog
  • Gatsby Blog
  • Next.js Landing Pages
  • Progressive Web Application
  • Single Page Application
  • Svelte & Typescript App
  • Vue & Tailwind Blog
  • Developer Portfolio Templates
  • Form validation with Yup
  • Live Preview with Next.js and Sanity.io
Resource library
  • Agency partners
  • Technology partners
  • Blog Template
  • Personal Website Template
  • Developer Portfolio Templates
  • All Templates
Case Studies
  • Headless CMS
  • What is an API CMS
  • Static Sites 101
  • Headless SEO
  • Localization
  • GraphQL vs REST
  • What is a DXP?
  • Typescript 101
  • React CMS
  • Next.JS CMS
  • CMS for Shopify
  • Content platform
  • Multilingual CMS
  • Static Site CMS
  • Gatsby CMS
  • Node CMS
  • E-commerce CMS
  • Vue CMS
  • Angular CMS
  • GraphQL CMS
  • Newspaper CMS
  • Magazine CMS
  • Mobile apps CMS

Company

Contact SalesEnterpriseCareersTerms of ServiceAccessibility Statement

Stay connected

  • GitHub
  • Slack
  • Twitter
  • YouTube
  • Stack Overflow
  • Blog RSS
  • Newsletter
©Sanity 2023