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
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>"
}
}Retrieves the complete document data for a specific version number. The system reconstructs the document state as it existed at that version.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/KTS-o7/permission-mongo/llms.txt
Use this file to discover all available pages before exploring further.
GET /{collection}/{id}/versions/{v}
read permission on the collection and access to the specific document.
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": "john.doe@example.com",
"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": "john@example.com",
"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: Field was added or modifiedunset: Field was removedaddress.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 field is automatically added to the data object