Get Document
Retrieve a document by ID.
GET /v1/documents/:id
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Document ID |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
version | integer | latest | Specific version to retrieve |
include_content | boolean | true | Include document content |
Example Request
- cURL
- Python
- JavaScript
curl https://api.inherent.systems/v1/documents/doc_abc123 \
-H "Authorization: Bearer $INHERENT_API_KEY"
import requests
response = requests.get(
"https://api.inherent.systems/v1/documents/doc_abc123",
headers={"Authorization": f"Bearer {api_key}"}
)
const response = await fetch(
'https://api.inherent.systems/v1/documents/doc_abc123',
{
headers: {
'Authorization': `Bearer ${apiKey}`,
},
}
);
Response
{
"id": "doc_abc123",
"version": 3,
"status": "completed",
"content": "# API Authentication\n\nAll API requests require...",
"metadata": {
"title": "API Authentication Guide",
"category": "documentation",
"version": "2.0"
},
"stats": {
"chunks": 24,
"tokens": 8192,
"size_bytes": 32768
},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-18T14:20:00Z"
}
Get Specific Version
curl "https://api.inherent.systems/v1/documents/doc_abc123?version=2" \
-H "Authorization: Bearer $INHERENT_API_KEY"
Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Document ID |
version | integer | Document version |
status | string | Processing status |
content | string | Full document content |
metadata | object | Document metadata |
stats.chunks | integer | Number of chunks |
stats.tokens | integer | Total tokens |
stats.size_bytes | integer | Content size |
created_at | datetime | Creation timestamp |
updated_at | datetime | Last update timestamp |
Errors
| Code | Description |
|---|---|
404 | Document not found |
404 | Version not found |