Skip to content

Features

Content history

Included free on every install.

Content history keeps earlier versions of an entry, so you can compare two and bring an old one back. It is off by default. You turn it on for every content type, for the types you choose, or for one, and you decide how long versions are kept. Beside it, the content activity log records who changed which entry, when, from where and which fields.

Open Settings > Content history. You need the admin or super_admin role.

  • Under History, Keep versions for is Off, All types or Selected types. With Selected types, tick the types in Content types that keep history.
  • Keep each version for is Forever or a number of days, and Keep at most, per entry is Unlimited or a number of versions.
  • Under Activity, Record who changed which entry turns the activity log on or off, with its own Keep activity for.
  • Storage shows how much the stored versions take, beside what the same versions would take as full copies, with Prune now and Delete history for one content type.

When a setting is fixed by the server's environment, a banner says so and its control cannot be changed. On an entry whose type keeps no history, the entry page says History is off for this type and links an administrator to these settings.

Read the activity log under Insight > Content activity.

A version is recorded when an entry of a type that keeps history changes: on a save in the console, a write on the Admin API or the Content API, GraphQL or gRPC, a bulk import, a flow, a release or a scheduled publish. The numbered revisions, comparing and restoring work as described in Content lifecycle.

History stays small:

  • A save that changes nothing stores nothing. It records no version and does not move the entry's revision number.
  • An edit stores only the fields that changed. Every field you did not touch is shared with the version before it, so changing a title on a long article stores the title.
  • A change of status alone stores no field values. Publishing in LyEve Console, in a release or on a schedule records a version that points at values already stored. A publish or unpublish made by another writer, such as the Content API, GraphQL, gRPC, a flow or an approval, records no version. The activity log records who made it.
  • Restoring an old version stores no new values. The restored version points at the values the old one held.
  • Values are compressed when that makes them smaller.

An entry's current_rev moves on every real change, whether history is on or not, so version numbers can skip. They skip where history was off for the type, where only the slug or the schedule changed, and where retention removed older versions.

Turning history off stops recording new versions and keeps the ones already stored. They stay readable and restorable until retention or Delete history removes them. Deleting an entry deletes its versions with it.

ModeWhat keeps history
offNo content type.
allEvery content type, including ones created later.
selectedThe content types named in schemas.

To keep history for one type, choose selected and name only that type. A renamed content type stays selected under its new name, and a deleted one leaves the list.

A new install and a new tenant start with history off. When you upgrade, a tenant that already holds content keeps history on for every content type, so nothing it did before the upgrade changes. Its retention values stay unset, which means the environment defaults below, and forever when those are unset too.

Five environment variables set history for the whole instance. Set them on the engine.

VariableValuesDefaultEffect
CONTENT_HISTORYconsole, off, onconsoleconsole lets each tenant choose in the console. off turns history off for every tenant. on turns it on for every content type of every tenant.
CONTENT_HISTORY_KEEP_DAYSA number of days, 0 for forever0How long a version is kept, for a tenant that has not chosen.
CONTENT_HISTORY_KEEP_VERSIONSA number of versions, 0 for all0How many versions of each entry are kept, for a tenant that has not chosen.
CONTENT_ACTIVITYconsole, off, onconsoleThe same three values, for the activity log.
CONTENT_ACTIVITY_KEEP_DAYSA number of days, 0 for forever0How long an activity row is kept, for a tenant that has not chosen.

off and on lock the matching control in the console. With CONTENT_HISTORY=on, a tenant cannot turn history off or narrow it to some types, but it still sets its own retention. A PUT that asks for a locked value other than the one in effect answers 409. The three KEEP variables are defaults and lock nothing: a tenant's own choice wins over them. A value the engine cannot read, such as yes or -1, is ignored with a warning in the log, and the default applies.

This turns history on for one content type, edits an entry and reads what was kept. For the console steps, you are signed in to the console with the admin or super_admin role. For the API steps, the settings routes need a signed-in session, so put the token from your login answer in TOKEN, as the quickstart shows. An admin token cannot change these settings.

1. Read the settings.

Console v0.28.0

Open Settings > Content history. On a new install, Keep versions for reads Off, Keep each version for reads Forever, Keep at most, per entry reads Unlimited, and Record who changed which entry reads On. A banner names any setting the server's environment fixes.

Engine API v0.62.0

Shell
curl http://localhost:3001/api/admin/content/history/settings \
-H "Authorization: Bearer $TOKEN"
JSON
{
"settings": {
"history_mode": "off",
"schemas": [],
"keep_days": 0,
"keep_versions": 0,
"activity_enabled": true,
"activity_keep_days": 0,
"updated_by": null,
"updated_at": null
},
"locked": [],
"env": { "history": "console", "activity": "console" },
"defaults": { "keep_days": 0, "keep_versions": 0, "activity_keep_days": 0 }
}

locked names the fields the environment fixes, env holds CONTENT_HISTORY and CONTENT_ACTIVITY, and defaults holds the three KEEP variables.

2. Keep history for the story type only, for 90 days and at most 20 versions an entry.

Console v0.28.0

On Settings > Content history, under History:

  1. Set Keep versions for to Selected types, and tick story in Content types that keep history.
  2. Set Keep each version for to A number of days, and enter 90 in Days.
  3. Set Keep at most, per entry to A number of versions, and enter 20 in Versions.
  4. Choose Save.

Engine API v0.62.0

Shell
curl -X PUT http://localhost:3001/api/admin/content/history/settings \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"history_mode": "selected", "schemas": ["story"], "keep_days": 90, "keep_versions": 20}'

The answer has the same shape as the read. A field you leave out keeps its value.

3. Edit a story entry and list its versions. Use an entry such as the one Content lifecycle creates.

Console v0.28.0

Open Content, pick story and open the entry. Change Title to Hello again and choose Save, then choose History. The Revision history panel lists the new version first. Saving the same title again adds no version.

Engine API v0.62.0

Put the entry's id in ENTRY_ID:

Shell
curl -X PUT http://localhost:3001/api/admin/content/$ENTRY_ID \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"title": "Hello again"}'
curl http://localhost:3001/api/admin/content/$ENTRY_ID/revisions \
-H "Authorization: Bearer $TOKEN"

The list carries "history_enabled": true, and each version names its action, such as updated, and its source, here console, which the Admin API records as the console does. Sending the same title again adds no version.

4. See what history takes.

Console v0.28.0

On Settings > Content history, Storage shows what the versions take under Stored, what the same versions would take whole under As full copies, and counts Versions and Earlier revisions, the revisions recorded before your instance stored history this way.

Engine API v0.62.0

Shell
curl http://localhost:3001/api/admin/content/history/usage \
-H "Authorization: Bearer $TOKEN"
JSON
{"commits": 1, "objects": 2, "stored_bytes": 412, "logical_bytes": 1730, "legacy_rows": 0, "legacy_bytes": 0, "oldest_at": "2026-10-22T09:14:03Z"}

commits counts versions, stored_bytes is what they take, and logical_bytes is what the same versions would take as full copies. legacy_rows and legacy_bytes count the revisions recorded before your instance stored history this way. Retention removes those too. oldest_at is the time of the oldest version.

Retention decides how long versions are kept. Each tenant sets it in the console or with PUT /api/admin/content/history/settings. A value of 0 means no limit.

You wantSet
Keep every version foreverkeep_days 0 and keep_versions 0
Keep 90 dayskeep_days 90
Keep the last 20 versions of each entrykeep_versions 20
Bothkeep_days 90 and keep_versions 20. A version is removed once it breaks either limit

activity_keep_days does the same for the activity log. Retention past 30 days is allowed on every install. Reading versions older than 30 days needs content-pro, as below.

Retention never removes:

  • The newest version of an entry, whatever its age.
  • Any version of an entry that an unfinished release or a pending scheduled change names.
  • A version written by a person an active legal hold names, whichever tenant the hold was set in.
  • Any version of an entry an active legal hold names.

A legal hold that names no actor and no single resource id covers the tenant's content as a whole when its resource type is empty or content_entry. Such a hold can still be limited to an action or a time window. While one is active, retention deletes nothing in the tenant, neither versions nor activity rows, and the daily run skips the tenant.

Retention runs on its own a minute after the engine starts and then every 24 hours, on one engine at a time when you run several. It also covers a tenant whose history is now off, with that tenant's last retention values, and the revisions recorded before your instance stored history this way.

Prune now runs retention for your tenant at once, instead of waiting for the daily run.

Console v0.28.0

On Settings > Content history, under Storage, choose Prune now. The page says how many versions, earlier revisions and activity rows it removed, or how many so far while pruning continues in the background.

Engine API v0.62.0

Send POST /api/admin/content/history/prune with {}. It answers what it removed:

JSON
{"commits": 140, "legacy_rows": 12, "activity_rows": 0, "done": true}

commits counts the versions removed, legacy_rows the revisions recorded before your instance stored history this way, and activity_rows the activity rows removed.

200 with "done": true means the run finished. A run that takes longer than about ten seconds answers 202 with "done": false and the counts so far, and keeps going in the background. Read the usage again later to see the result. A second prune while one runs answers 409. So does a prune while a legal hold covers the tenant's content as a whole, and it deletes nothing.

Deleting one content type's history removes every stored version of that type. The entries stay as they are. The deleted versions cannot be recovered.

Console v0.28.0

On Settings > Content history, under Storage, pick the type in Content type and choose Delete history. The dialog asks Delete every version of the type, and Delete confirms it. When a legal hold kept some versions, the page says how many.

Engine API v0.62.0

Shell
curl -X DELETE "http://localhost:3001/api/admin/content/history?schema=story" \
-H "Authorization: Bearer $TOKEN"
JSON
{"commits": 312, "held": 4}

held counts the versions a legal hold kept.

Versions a legal hold kept stay until the hold is lifted. The delete is recorded in the activity log. While a legal hold covers the tenant's content as a whole, the delete removes nothing and answers 409.

Open an entry and choose History to list its versions, then Restore to bring one back. On the Admin API, GET /api/admin/content/{id}/revisions lists them, GET /api/admin/content/{id}/diff?from=1&to=3 compares two, and POST /api/admin/content/{id}/rollback restores one. A restore takes the old version's title, body, meta and status, and is recorded as a new version when history is on. Content lifecycle covers each route.

The Content API keeps its own versions of an entry, each taken before an update when history is on for the type. GET /api/v1/content/{schema}/{id}/revisions lists them and PUT /api/v1/content/{schema}/{id}/revisions/{rev_id}/restore writes one back. The list is empty when the type has no stored versions.

Without content-pro, you list, read, compare and restore the versions of the last 30 days, plus the newest version of each entry whatever its age. Older versions are kept for as long as your retention says, and reading them answers 402 naming feature:content-pro. With content-pro every kept version reads at once. A license that lapses deletes nothing.

The activity log records each change to an entry: who made it, when, the content type and entry, the action, the source and the names of the fields that changed. A row names the version history recorded for that change, when there is one. Activity runs on its own, apart from history, so it can stay on while history is off. It is on by default.

FieldValues
actioncreated, updated, published, unpublished, deleted, rollback, scheduled_publish, scheduled_unpublish, and history_settings and history_deleted for the settings
sourceconsole for the console and the Admin API, api for the Content API and for a status change another feature makes through it, such as an approval, graphql, grpc, bulk-import for a bulk import's direct writes, import for an entry another feature saves through the content screens' writer, flow, release, schedule, and backfill for an entry the content screens picked up after another writer created it
actor_id, actor_emailWho made the change, or null when no one is known
actor_kindHow the writer signed in: user for a session, admin_token or api_key. null when the writer is unknown
fieldsThe names of the fields that changed
revision_numThe version history recorded, or null

Who a row names:

  • A change from the console or with a session names that person.
  • A change with an admin token names the token's owner.
  • A change with an API key names the key's id, and actor_email is null because no account matches it.
  • A change a flow makes names no person yet. Its source is flow.

deleted is a delete of the entry. Archiving an entry records updated, with status in fields. A delete recorded before the upgrade is stored as archived, and the activity routes answer it as deleted, so action=deleted finds both. Rows recorded before the upgrade have a null actor_kind and keep their actor_id.

A change to the history settings and a history delete are always recorded, even with activity off. Turning activity off stops every other row.

Read the log with GET /api/admin/content/activity. It takes schema, entry_id, actor, action, source, from (inclusive) and to (exclusive), as RFC 3339 times, with limit and offset, and answers {"data": [...], "total_count": n, "limit": n, "offset": n}, newest first. An admin or super_admin reads it, and so does an admin token with the content:read grant.

Shell
curl "http://localhost:3001/api/admin/content/activity?schema=story&action=updated&limit=20" \
-H "Authorization: Bearer $TOKEN"

A super admin reads every tenant's activity with GET /api/admin/content/activity/all, which takes the same filters plus tenant_id. Leave tenant_id empty for every tenant. In the console, Content activity shows a super admin a tenant picker with All tenants.

With PII masking on, an admin reads actor_email masked. A super admin reads it in full on both routes, and the masking access log records each of those reads.

The audit log, when your license carries audit, keeps receiving its own record of each create, update and delete, and of each change to these settings.

Upgrading adds history's storage beside what your database holds and rewrites nothing, so it runs quickly on a large database. The revisions your instance kept before stay readable and restorable, list in order with the new versions, and are pruned by the same retention.

There is no downgrade to an engine from before content history. An earlier engine refuses to start on a database this release has upgraded, rather than run on data it cannot delete. The way back is the backup you took before the upgrade. Back up your database before you upgrade, as for every release.

MethodPathDoesWho
GET/api/admin/content/history/settingsThe tenant's settings, what the environment locks, and the environment defaultsadmin, signed-in session
PUT/api/admin/content/history/settingsChange them. A field you leave out keeps its valueadmin, signed-in session
GET/api/admin/content/history/usageWhat the tenant's history storesadmin, or content:read
POST/api/admin/content/history/pruneRun retention for the tenant nowadmin, signed-in session
DELETE/api/admin/content/history?schema=<name>Delete every version of one content typeadmin, signed-in session
GET/api/admin/content/activityThe tenant's activityadmin, or content:read
GET/api/admin/content/activity/allEvery tenant's activity, or one tenant's with tenant_idsuper_admin

admin here also means super_admin.

StatusMessage
400invalid JSON body
400entry_id must be a UUID, actor must be a UUID, from must be an RFC 3339 time, to must be an RFC 3339 time
402payment_required, naming feature:content-pro, for a version older than 30 days without content-pro
403the admin role is required on the settings, prune and delete routes
403super_admin required on /api/admin/content/activity/all
409history_mode is locked by the server configuration or activity_enabled is locked by the server configuration
409a history prune is already running, while another prune runs for the tenant
409a legal hold covers this tenant's content, so history was not pruned, or so history was not deleted on the delete
422history_mode must be off, all or selected
422schemas holds too many names, each schema name is between 1 and 255 characters
422keep_days must be between 0 and 36500, keep_versions must be between 0 and 1000000, activity_keep_days must be between 0 and 36500
422schema is required and at most 255 characters on the delete
503failed to prune history when the database fails during a prune
503legal hold status is unavailable, so history was not pruned, or so history was not deleted on the delete