List Documents
List all documents in your knowledge base.
GET /v1/documents
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 20 | Results per page (1-100) |
cursor | string | - | Pagination cursor |
status | string | - | Filter by status |
source | string | - | Filter by source |
created_after | datetime | - | Filter by creation date |
created_before | datetime | - | Filter by creation date |
Example Request
- cURL
- Python
- JavaScript
curl "https://api.inherent.systems/v1/documents?limit=20&status=completed" \
-H "Authorization: Bearer $INHERENT_API_KEY"
import requests
response = requests.get(
"https://api.inherent.systems/v1/documents",
headers={"Authorization": f"Bearer {api_key}"},
params={
"limit": 20,
"status": "completed"
}
)
const params = new URLSearchParams({
limit: '20',
status: 'completed',
});
const response = await fetch(
`https://api.inherent.systems/v1/documents?${params}`,
{
headers: {
'Authorization': `Bearer ${apiKey}`,
},
}
);
Response
{
"documents": [
{
"id": "doc_abc123",
"status": "completed",
"version": 3,
"metadata": {
"title": "API Authentication Guide",
"category": "documentation"
},
"stats": {
"chunks": 24,
"tokens": 8192
},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-18T14:20:00Z"
},
{
"id": "doc_def456",
"status": "completed",
"version": 1,
"metadata": {
"title": "Getting Started",
"category": "tutorial"
},
"stats": {
"chunks": 12,
"tokens": 4096
},
"created_at": "2024-01-14T09:00:00Z",
"updated_at": "2024-01-14T09:00:00Z"
}
],
"pagination": {
"has_more": true,
"next_cursor": "doc_ghi789",
"total": 156
}
}
Pagination
To fetch the next page, use the next_cursor value:
curl "https://api.inherent.systems/v1/documents?cursor=doc_ghi789" \
-H "Authorization: Bearer $INHERENT_API_KEY"
Filtering Examples
By Status
# Only completed documents
GET /v1/documents?status=completed
# Only processing documents
GET /v1/documents?status=processing
By Source
# Only GitHub-synced documents
GET /v1/documents?source=github
# Only Notion-synced documents
GET /v1/documents?source=notion
By Date
# Documents created in the last week
GET /v1/documents?created_after=2024-01-08T00:00:00Z
# Documents created before a specific date
GET /v1/documents?created_before=2024-01-15T00:00:00Z
Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Document ID |
status | string | Processing status |
version | integer | Current version |
metadata | object | Document metadata |
stats.chunks | integer | Number of chunks |
stats.tokens | integer | Total tokens |
created_at | datetime | Creation timestamp |
updated_at | datetime | Last update timestamp |