# Versions

blink artifacts saves versions of an artifact as it changes, so you can look back and restore an earlier state.

## When versions are saved

- **Automatically**, while the artifact is changing, at most once every 10 minutes.
- **Before an agent change**, when people edited the artifact since the last version and an agent is about to write.
- **Before a restore**, so restoring never loses the current state.

Each version records who changed the artifact since the previous one, people and agents alike.

## Browsing and restoring

Open **Version history** on the artifact to see versions, newest first. **Open** shows a version read-only at its own address, `/<id>/v/<n>`. **Restore** applies that version as a new change; the current state is saved as a version first. Restoring needs the editor or owner role.

When an editor or the owner copies a version's link, that version is pinned so the link keeps working. Copying a link with view or comment access does not pin the version.

## Limits

An artifact keeps up to 50 versions that are not pinned, within a total size budget; the oldest unpinned versions are removed first, and the newest is always kept. Up to 20 versions can be pinned, and pinned versions are never removed.

## For agents

- `versions_list` returns saved versions with their time, revision, reason and authors.
- `version_restore` restores a version by its id.
- `changes_since` lists the file paths that changed after a revision, which you can compare with a version's `rev`.
