cURL
curl --request GET \ --url https://api.example.com/{collection}/{id}/versions/{v}
{ "400": {}, "401": {}, "403": {}, "404": {}, "500": {}, "501": {}, "data": { "_id": "<string>", "_version": 123, "...": "<any>" }, "metadata": { "updated_by": "<string>", "updated_at": "<string>" } }
Retrieve a specific version of a document
GET /{collection}/{id}/versions/{v}
read
curl -X GET "https://api.example.com/employees/emp_12345/versions/2" \ -H "Authorization: Bearer <token>"
{ "data": { "_id": "emp_12345", "_version": 2, "name": "John Doe", "email": "[email protected]", "department": "Marketing", "salary": 75000, "created_at": "2024-01-10T09:15:00Z", "updated_at": "2024-02-20T14:22:00Z", "updated_by": "user_456" }, "metadata": { "updated_by": "user_456", "updated_at": "2024-02-20T14:22:00Z" } }
{ "_id": "...", "collection": "employees", "doc_id": "emp_12345", "version": 1, "mode": "full", "data": { "name": "John Doe", "email": "[email protected]", "salary": 70000 } }
{ "_id": "...", "collection": "employees", "doc_id": "emp_12345", "version": 2, "mode": "diff", "changes": [ { "field": "salary", "op": "set", "from": 70000, "to": 75000 }, { "field": "department", "op": "set", "from": "Engineering", "to": "Marketing" } ] }
set
unset
address.city
{ "error": { "code": "BAD_REQUEST", "message": "Invalid version number", "details": { "version": "abc" } } }
{ "error": { "code": "VERSION_NOT_FOUND", "message": "Version not found", "details": { "collection": "employees", "id": "emp_12345", "version": 99 } } }
{ "error": { "code": "INTERNAL_ERROR", "message": "Failed to reconstruct version data", "details": { "error": "missing base version" } } }
_version