Skip to main content

List Documents

List all documents in your workspace with pagination support.

GET /api/v1/documents

Authentication

Requires an API key with the read permission.

HeaderValue
X-API-Keyink_live_abc123...

Query Parameters

ParameterTypeRequiredDefaultConstraintsDescription
pageintegerNo1Minimum 1Page number to retrieve
page_sizeintegerNo20Minimum 1, maximum 100Number of documents per page

Code Examples

curl "https://api.inherent.systems/api/v1/documents?page=1&page_size=20" \
-H "X-API-Key: $INHERENT_API_KEY"

Response

Status: 200 OK

{
"documents": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "API Authentication Guide.md",
"workspace_id": "ws_abc123",
"source_type": "upload",
"mime_type": "text/markdown",
"size_bytes": 32768,
"chunk_count": 24,
"status": "completed",
"created_at": "2026-03-15T10:30:00Z",
"updated_at": "2026-03-15T10:31:45Z",
"metadata": {
"category": "documentation"
}
},
{
"id": "b2c3d4e5-f678-9012-bcde-f12345678901",
"name": "Q4 Engineering Report.pdf",
"workspace_id": "ws_abc123",
"source_type": "upload",
"mime_type": "application/pdf",
"size_bytes": 1048576,
"chunk_count": 87,
"status": "completed",
"created_at": "2026-03-14T09:00:00Z",
"updated_at": "2026-03-14T09:05:12Z",
"metadata": {
"department": "engineering",
"quarter": "Q4"
}
}
],
"total": 142,
"page": 1,
"page_size": 20
}

Response Fields

FieldTypeDescription
documentsarrayArray of document objects
documents[].idstringUnique document identifier (UUID)
documents[].namestringOriginal filename
documents[].workspace_idstringID of the workspace
documents[].source_typestringHow the document was ingested (e.g., "upload")
documents[].mime_typestringMIME type of the document
documents[].size_bytesintegerFile size in bytes
documents[].chunk_countintegerNumber of chunks the document was split into
documents[].statusstringProcessing status: "pending", "processing", "completed", or "failed"
documents[].created_atstringISO 8601 timestamp of when the document was uploaded
documents[].updated_atstringISO 8601 timestamp of the last status change
documents[].metadataobject | nullUser-provided metadata from upload
totalintegerTotal number of documents in the workspace
pageintegerCurrent page number
page_sizeintegerNumber of items per page

Errors

StatusError TypeDescription
401unauthorizedMissing or invalid API key
403forbiddenAPI key does not have read permission
422validation-errorInvalid query parameters (e.g., page_size out of range)
429rate-limit-exceededRate limit exceeded

Example Error Response

{
"type": "https://api.inherent.systems/errors/validation-error",
"title": "Validation Error",
"status": 422,
"detail": "page_size must be between 1 and 100, got 500.",
"instance": "/api/v1/documents",
"trace_id": "d4e5f678-9012-abcd-ef12-345678901234",
"timestamp": "2026-04-03T12:34:56.789Z"
}