# Model Version History

> Source: https://agilitycms.com/docs/developers/model-version-history

Every change to a content model or a component model is saved as a version. Open a model and select **History** to see who made each change and when. Compare any earlier version with the current model, and roll back if a change causes problems. Rolling back never changes your content.

[Model version history (1 min)](https://vimeo.com/1252433379/9002aa7129)

## What saves a version

A version is saved when a model's fields or its reference name change. That includes adding, removing, renaming, reordering or retyping a field, and changing a field's settings, such as making it required.

These changes don't save a version: the display name, the description, visibility, the thumbnail and agent guidance.

A version is saved however the model was changed: in the Content Manager, through the Management API or the CLI, or by an AI tool connected through the MCP server.

Version history started recording in November 2026. A model that hasn't changed since then has no versions yet. The first time it changes, Agility saves the state it's leaving as the **Original** version, so you can compare with it and roll back to it.

Page models aren't versioned.

## View a model's history

1. Go to **Models** and open a content model or a component model.
2. Select the **History** tab.

<img src="https://cdn.aglty.io/agility-cms-docs/screen-captures/model-version-history/model-version-history-history.png" alt="The History tab on a content model: four versions, newest marked Current, the oldest marked Original" width="640" height="944" style="width:320px">

Versions are listed newest first, and the newest is marked **Current**. Each one shows who made the change, when, and a summary such as *Fields: 1 added, 2 changed* or *Reference name changed*. A rollback shows as *Rolled back to v3*. Select **Show more** to load older versions.

A version can say **No visible changes**. That means the save changed how the model is stored without changing anything you can see in its fields.

## Compare a version with the current model

Select **Compare with current** on a version. The **Compare Model Versions** window shows the fields that were added, removed or changed between that version and the model as it is now, and whether the field order or the reference name changed.

Fields are matched by name, so a renamed field shows as one field removed and one added.

<img src="https://cdn.aglty.io/agility-cms-docs/screen-captures/model-version-history/model-version-history-compare.png" alt="Compare Model Versions: a field added since version 1, and a field whose type changed" width="2304" height="868" style="width:800px">

## Roll back to an earlier version

You need permission to edit models to roll back.

1. Save or discard any unsaved changes to the model.
2. On the **History** tab, select **Roll back** on the version you want.
3. Read **What this rollback affects**. Agility checks the rollback before anything is saved and lists what it would change:
   - **Field removed** and **Field type changes**, with the number of items that have a value in that field
   - **Field becomes required**, with the number of items that have no value in it
   - **Reference name changes**, and **Reference name in use** when another model already has that reference name
4. Select **I understand this can break my live site**, then **Roll back**.

<img src="https://cdn.aglty.io/agility-cms-docs/screen-captures/model-version-history/model-version-history-rollback-check.png" alt="Roll back to version 1? The check lists what the rollback affects and the number of items affected" width="1000" height="1240" style="width:500px">

A rollback restores the version's fields and reference name. The display name, description, visibility, thumbnail and agent guidance stay as they are.

A rollback is saved as a new version, so you can roll it back too.

**Rolling back never changes your content.** The model is saved with the earlier fields, and your content is delivered through the APIs with that model, just as after any model save.

<img src="https://cdn.aglty.io/agility-cms-docs/screen-captures/model-version-history/docs-diagram-model-rollback.svg" alt="Versions v1 to v4 of a model. Rolling back to v1 runs the check first, then saves v5, marked Current and Rolled back to v1, with v1's fields and reference name. Content items are not changed." width="800" height="400">

Some rollbacks can't go ahead. If another model now uses the reference name, the rollback is blocked. If someone else changed the model after you opened the check, Agility asks you to check again.

**Items affected** can say *Couldn't count the items affected*. That happens on very large models, or when a field's values can't be read. It never means zero.

## For developers: the Management API

The history is also in the Management API, under `/api/v1/instance/{guid}`. These routes need permission to edit models.

| Route | Returns |
|---|---|
| `GET model/{id}/versions?skip=0&take=50` | The model's versions, newest first, each with who changed it, when, and a summary of what changed |
| `GET model/{id}/versions/{n}` | One version, with the model as it was, in the same shape as `GET model/{id}` |
| `GET model/{id}/versions/diff?from=&to=` | The fields added, removed and changed between two versions. Leave out `to` to compare with the model now |
| `GET model/{id}/versions/{n}/revert-check` | What a rollback to version `n` would affect, and whether it's blocked |
| `POST model/{id}/versions/{n}/revert` | Rolls back. Body: `{ "expectedCurrentVersionNumber": 7, "acknowledgeWarnings": true }` |

The rollback returns **409** with the check in the body when it's blocked, when the warnings haven't been acknowledged, or when the model has changed since `expectedCurrentVersionNumber`. Run the check again and resend.

## Related

- [Content Models](https://agilitycms.com/docs/developers/content-models)
- [Component Models](https://agilitycms.com/docs/developers/component-models)
- [Version History and Commenting](https://agilitycms.com/docs/editors/versioning): version history for content and pages

---

## Related pages

- [Content-first Approach](https://agilitycms.com/docs/developers/content-first.md)
- [Content Models](https://agilitycms.com/docs/developers/content-models.md)
- [Component Models ](https://agilitycms.com/docs/developers/component-models.md)
- [Fields](https://agilitycms.com/docs/developers/fields.md)
- [Nest, Link or Share? Choosing Linked Content Field Types](https://agilitycms.com/docs/developers/linked-content-field-types.md)
- [Getting Started with Linked Content](https://agilitycms.com/docs/developers/getting-started-with-linked-content.md)
- [Sitemaps](https://agilitycms.com/docs/developers/sitemaps.md)
- [Page Models](https://agilitycms.com/docs/developers/page-models.md)
- [Setting Up Preview](https://agilitycms.com/docs/developers/setting-up-preview.md)
- [Handling Agility URLs](https://agilitycms.com/docs/developers/handling-agility-urls.md)
- [Deployment & Code Repositories](https://agilitycms.com/docs/developers/deployment-code-repositories.md)
- [Tagging Content in Agility](https://agilitycms.com/docs/developers/tagging-content-in-agility.md)
- [Managing SEO for Developers](https://agilitycms.com/docs/developers/manging-seo-for-developers.md)
- [Mastering Nested Linked Content in Agility CMS: Enhance Hierarchical Data Management](https://agilitycms.com/docs/developers/nested-linked-content.md)
- [Advanced Field Validation with Regular Expressions](https://agilitycms.com/docs/developers/advanced-field-validation-with-regular-expressions.md)
- [Dynamic Content Control: Implementing Hide/When Formulas in Your Headless CMS Content Model](https://agilitycms.com/docs/developers/dynamic-content-control-implementing-hide-when-formulas-in-your-headless-cms-content-model.md)
- [Grouping Components into Tabs, Accordions, and Sections](https://agilitycms.com/docs/developers/grouping-components-into-tabs.md)
- [Conditional & Cross-Field Validation](https://agilitycms.com/docs/developers/conditional-and-cross-field-validation.md)
- [Set Up Web Studio with Any Framework](https://agilitycms.com/docs/developers/web-studio-setup-any-framework.md)
- [Troubleshooting Web Studio](https://agilitycms.com/docs/developers/troubleshooting-web-studio.md)
- [Content Modeling Anti-Patterns](https://agilitycms.com/docs/developers/content-modeling-anti-patterns.md)
- [Designing a Taxonomy That Scales](https://agilitycms.com/docs/developers/designing-a-taxonomy.md)
- [Map Your Design System to Component Models](https://agilitycms.com/docs/developers/design-system-to-component-models.md)
- [Structured Content Explained](https://agilitycms.com/docs/developers/structured-content-explained.md)
- [Beyond the Website: Apps, Kiosks, Email and In-App](https://agilitycms.com/docs/developers/beyond-the-website.md)
- [Make Your Content Model Agent-Friendly](https://agilitycms.com/docs/developers/agent-friendly-content-models.md)
- [Component Visibility](https://agilitycms.com/docs/developers/component-visibility.md)

Index of every docs page: https://agilitycms.com/docs/llms.txt
