Skip to main content
GET
/
api
/
knowledge
/
documents
curl -X GET "https://api.example.com/api/knowledge/documents?projectId=proj_123&status=completed&limit=20&offset=0" \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "success": true,
  "documents": [
    {
      "id": "doc_abc123",
      "projectId": "proj_123",
      "fileName": "product-guide.pdf",
      "fileType": "pdf",
      "sourceType": "upload",
      "status": "completed",
      "chunkCount": 45,
      "createdAt": "2026-01-15T10:30:00Z",
      "updatedAt": "2026-01-15T10:35:00Z"
    },
    {
      "id": "doc_def456",
      "projectId": "proj_123",
      "fileName": "api-docs.md",
      "fileType": "markdown",
      "sourceType": "url",
      "status": "completed",
      "chunkCount": 28,
      "createdAt": "2026-01-14T14:20:00Z",
      "updatedAt": "2026-01-14T14:22:00Z"
    }
  ],
  "total": 42,
  "hasMore": true,
  "nextOffset": 20
}

Query Parameters

projectId
string
required
Project ID to filter documents
status
string
Filter by document processing status
  • pending - Waiting to be processed
  • processing - Currently being indexed
  • completed - Successfully indexed
  • failed - Failed to index
limit
number
default:20
Maximum number of documents to return per page
offset
number
default:0
Number of documents to skip for pagination

Response

success
boolean
Whether the request was successful
documents
array
Array of document objects
total
number
Total number of documents matching the query
hasMore
boolean
Whether there are more documents to fetch
nextOffset
number
Offset value for the next page
curl -X GET "https://api.example.com/api/knowledge/documents?projectId=proj_123&status=completed&limit=20&offset=0" \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "success": true,
  "documents": [
    {
      "id": "doc_abc123",
      "projectId": "proj_123",
      "fileName": "product-guide.pdf",
      "fileType": "pdf",
      "sourceType": "upload",
      "status": "completed",
      "chunkCount": 45,
      "createdAt": "2026-01-15T10:30:00Z",
      "updatedAt": "2026-01-15T10:35:00Z"
    },
    {
      "id": "doc_def456",
      "projectId": "proj_123",
      "fileName": "api-docs.md",
      "fileType": "markdown",
      "sourceType": "url",
      "status": "completed",
      "chunkCount": 28,
      "createdAt": "2026-01-14T14:20:00Z",
      "updatedAt": "2026-01-14T14:22:00Z"
    }
  ],
  "total": 42,
  "hasMore": true,
  "nextOffset": 20
}