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"
const params = new URLSearchParams({
projectId: 'proj_123',
status: 'completed',
limit: '20',
offset: '0'
});
const response = await fetch(
`https://api.example.com/api/knowledge/documents?${params}`,
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
const data = await response.json();
import requests
response = requests.get(
'https://api.example.com/api/knowledge/documents',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
params={
'projectId': 'proj_123',
'status': 'completed',
'limit': 20,
'offset': 0
}
)
data = response.json()
{
"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
}
Documents
List RAG Documents
Retrieves all documents for a project with pagination and filtering
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"
const params = new URLSearchParams({
projectId: 'proj_123',
status: 'completed',
limit: '20',
offset: '0'
});
const response = await fetch(
`https://api.example.com/api/knowledge/documents?${params}`,
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
const data = await response.json();
import requests
response = requests.get(
'https://api.example.com/api/knowledge/documents',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
params={
'projectId': 'proj_123',
'status': 'completed',
'limit': 20,
'offset': 0
}
)
data = response.json()
{
"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
string
required
Project ID to filter documents
string
Filter by document processing status
pending- Waiting to be processedprocessing- Currently being indexedcompleted- Successfully indexedfailed- Failed to index
number
default:20
Maximum number of documents to return per page
number
default:0
Number of documents to skip for pagination
Response
boolean
Whether the request was successful
array
number
Total number of documents matching the query
boolean
Whether there are more documents to fetch
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"
const params = new URLSearchParams({
projectId: 'proj_123',
status: 'completed',
limit: '20',
offset: '0'
});
const response = await fetch(
`https://api.example.com/api/knowledge/documents?${params}`,
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
const data = await response.json();
import requests
response = requests.get(
'https://api.example.com/api/knowledge/documents',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
params={
'projectId': 'proj_123',
'status': 'completed',
'limit': 20,
'offset': 0
}
)
data = response.json()
{
"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
}
⌘I

