Skip to main content

List Documents

List all documents in your knowledge base.

GET /v1/documents

Query Parameters

ParameterTypeDefaultDescription
limitinteger20Results per page (1-100)
cursorstring-Pagination cursor
statusstring-Filter by status
sourcestring-Filter by source
created_afterdatetime-Filter by creation date
created_beforedatetime-Filter by creation date

Example Request

curl "https://api.inherent.systems/v1/documents?limit=20&status=completed" \
-H "Authorization: Bearer $INHERENT_API_KEY"

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

FieldTypeDescription
idstringDocument ID
statusstringProcessing status
versionintegerCurrent version
metadataobjectDocument metadata
stats.chunksintegerNumber of chunks
stats.tokensintegerTotal tokens
created_atdatetimeCreation timestamp
updated_atdatetimeLast update timestamp