Skip to main content

List Versions

List all versions of a document.

GET /v1/documents/:id/versions

Path Parameters

ParameterTypeDescription
idstringDocument ID

Example Request

curl https://api.inherent.systems/v1/documents/doc_abc123/versions \
-H "Authorization: Bearer $INHERENT_API_KEY"

Response

{
"versions": [
{
"version": 3,
"created_at": "2024-01-18T14:20:00Z",
"created_by": "api_key_xyz",
"change_summary": "Updated authentication section",
"stats": {
"size_bytes": 32768,
"chunks": 24,
"tokens": 8192
}
},
{
"version": 2,
"created_at": "2024-01-15T10:30:00Z",
"created_by": "api_key_xyz",
"change_summary": "Added rate limiting documentation",
"stats": {
"size_bytes": 28672,
"chunks": 20,
"tokens": 7168
}
},
{
"version": 1,
"created_at": "2024-01-10T09:00:00Z",
"created_by": "api_key_xyz",
"change_summary": "Initial version",
"stats": {
"size_bytes": 16384,
"chunks": 12,
"tokens": 4096
}
}
],
"document_id": "doc_abc123",
"current_version": 3
}

Response Fields

FieldTypeDescription
versionsarrayList of versions
versions[].versionintegerVersion number
versions[].created_atdatetimeCreation timestamp
versions[].created_bystringAPI key or user ID
versions[].change_summarystringOptional change description
versions[].statsobjectVersion statistics
document_idstringDocument ID
current_versionintegerLatest version number