Appearance
Revisions
Revision endpoints are available for entities annotated with Hibernate Envers @Audited. Every create, update, or delete produces a revision that can be queried via the API.
See Auditing for how to enable auditing on your entities.
List Revisions for a Record
Returns the revision history for a specific entity instance.
http
GET /api/{entity}/{id}/revisions
GET /api/{entity}/{id}/revisions?page={page}&size={size}| Parameter | Required | Default | Description |
|---|---|---|---|
page | No | — | Page index (0-based). If omitted, returns up to 100 000 revisions. |
size | No | 10 | Records per page (requires page to be set) |
Example:
http
GET /api/product/AB-001/revisions?page=0&size=10Response (200 OK) — a page of RevisionData:
json
{
"content": [
{
"number": 42,
"date": "2024-03-01T10:30:00.000+00:00",
"userId": "[email protected]",
"revisionType": "MOD",
"directChange": true,
"mainEntity": true,
"changedFields": ["price", "status"],
"notAuditedFields": [],
"entityData": {
"reference": "AB-001",
"name": "Headphones",
"price": 179.99,
"status": "LOW_STOCK"
}
}
],
"totalElements": 5,
"totalPages": 1,
"size": 10,
"number": 0
}RevisionData Fields
| Field | Description |
|---|---|
number | Revision number (global Envers revision ID) |
date | Timestamp when the revision was created |
userId | ID/username of the user who made the change |
revisionType | ADD (create), MOD (update), or DEL (delete) |
directChange | true if the entity itself changed; false if the revision was caused by a related entity change |
mainEntity | Whether this is the main entity or a related one in the audit trail |
changedFields | Set of field names that changed in this revision |
notAuditedFields | Fields present in the entity but not tracked by Envers |
entityData | Full snapshot of the entity at this revision |
Get Entity State at a Specific Revision
Returns the entity as it was at a given revision number.
http
GET /api/{entity}/{id}/revisions/{revisionNumber}Example:
http
GET /api/product/AB-001/revisions/42Response (200 OK) — the entity snapshot:
json
{
"reference": "AB-001",
"name": "Headphones",
"price": 179.99,
"status": "LOW_STOCK"
}Revision Summary (all records)
Returns revisions across all records of the entity type, not just a single one.
http
GET /api/{entity}/revisions/summary
GET /api/{entity}/revisions/summary?page={page}&size={size}| Parameter | Required | Default | Description |
|---|---|---|---|
page | No | — | Page index (0-based). If omitted, returns up to 100 000 revisions. |
size | No | 10 | Records per page (requires page to be set) |
Example:
http
GET /api/product/revisions/summary?page=0&size=20Response shape is the same as the per-record revisions endpoint.
Access Control
Requires the audit authority for the entity. See RBAC.