Change History
The change history system tracks field-level edits made to episodes, scenes, and scene blocks. Individual changes or entire batches (grouped by a single user action) can be reverted.
Endpoints overview​
| Method | Endpoint | Permission | Description |
|---|---|---|---|
GET | /api/change-history/:entityType/:entityId | authenticated | Get change history for entity |
POST | /api/change-history/:changeId/revert | authenticated | Revert single change |
POST | /api/change-history/batch/:batchId/revert | authenticated | Revert batch of changes |
Endpoints​
Get change history for entity​
GET /api/change-history/:entityType/:entityId — Auth required
Path params:
entityType—episode|scene|scene_blockentityId— UUID of the entity
Response — 200
[
{
"id": "ch-uuid-001",
"batchId": "batch-uuid-abc",
"entityType": "scene_block",
"entityId": "block-uuid-001",
"changedBy": "editor@example.com",
"fieldName": "text",
"oldValue": "Hello.",
"newValue": "Hello, world!",
"changedAt": "2025-03-10T14:32:00.000Z"
},
{
"id": "ch-uuid-002",
"batchId": "batch-uuid-abc",
"entityType": "scene_block",
"entityId": "block-uuid-001",
"changedBy": "editor@example.com",
"fieldName": "emotion",
"oldValue": "calm",
"newValue": "excitement",
"changedAt": "2025-03-10T14:32:00.000Z"
}
]
Revert single change​
POST /api/change-history/:changeId/revert — Auth required
Reverts the specific field change identified by changeId, restoring oldValue.
Permission requirements:
- Reverting an
episodechange requiresepisode:history:revert - Reverting a
scenechange requiresscene:history:revert - Reverting a
scene_blockchange requiresscene_block:history:revert
Response — 200
{ "success": true }
Revert batch of changes​
POST /api/change-history/batch/:batchId/revert — Auth required
Reverts all changes that share the same batchId — typically all changes from a single save action. Same permission requirements as single revert (checked per entity type within the batch).
Response — 200
{ "success": true }