Re-index Documents
Queues an indexing task to rebuild each selected document’s index from its current file. Returns a bulk task ID to follow the tasks together.
Exactly one of all: true or documentIds must be given.
No file is re-uploaded. Follow each task with Get Indexing Task using compilation_job.id, and the whole request with Get Bulk Task.
For the re-index flow, see Re-index and Track Indexing.
curl --request POST \
--url https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/documents/reindex \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"all": true
}'{
"bulk_job_id": "5a1c2e3d-7b8f-4a9c-8d1e-2f3a4b5c6d7e",
"items": [
{
"asset": {
"created_at": "2026-09-03T10:02:11Z",
"filename": "handbook.pdf",
"id": "6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b",
"knowledge_space_id": "9b2e5b7a-3c1d-4e2f-8a9b-1c2d3e4f5a6b",
"metadata": {},
"mime_type": "application/pdf",
"object_key": "1a7c9e40-2b3d-4f56-8a90-b1c2d3e4f506/spaces/9b2e5b7a-3c1d-4e2f-8a9b-1c2d3e4f5a6b/documents/6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b/handbook.pdf",
"parser_status": "parsed",
"sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"size_bytes": 482113,
"source_id": null,
"updated_at": null,
"version": 1
},
"code": null,
"compilation_job": {
"id": "e4a1f0b2-7c3d-4e5f-9a1b-2c3d4e5f6a7b",
"stage": "queued"
},
"document_id": null,
"error": null,
"status": "queued",
"status_url": "/knowledge-spaces/9b2e5b7a-3c1d-4e2f-8a9b-1c2d3e4f5a6b/documents/3d2f1c0b-9a8e-4d7c-b6a5-4f3e2d1c0b9a/processing-tasks/e4a1f0b2-7c3d-4e5f-9a1b-2c3d4e5f6a7b"
},
{
"asset": null,
"code": null,
"compilation_job": null,
"document_id": "8f14e45f-ceea-467a-9575-62c9a2d3e6b1",
"error": null,
"status": "not_found",
"status_url": null
}
],
"total": 2
}Authorizations
Every request authenticates with an API key: Authorization: Bearer {API_KEY}. App endpoints take an app API key; knowledge endpoints take a knowledge base API key (Get Started).
Keep keys server-side; never embed them in client code. Requests with a missing or invalid key fail with HTTP 401 (unauthorized).
Headers
Send a key on every call. It makes the call safe to retry. Use 8 to 255 printable ASCII characters without leading or trailing whitespace; a malformed key answers 400.
Repeating the same key and body returns the original bulk task instead of starting new indexing tasks. Reusing the key with a different body, from another API key, in another knowledge base, or for another operation answers 409.
8 - 255Path Parameters
Knowledge base ID: the last segment of the Service API endpoint shown in the knowledge base's API Access dialog (…/knowledge-fs/spaces/<knowledge base ID>), and the segment after /datasets/new/ in the address bar.
Body
Optional fields marked nullable treat null as omitted.
The normalized request must fit within 1,048,576 UTF-8 bytes. See Request Size Limits.
- All Documents
- Selected Documents
Send all: true or a nonempty documentIds array, but not both. With documentIds, all may be omitted, false, or null. With all: true, documentIds may be omitted or null; an empty array is rejected.
Set to true to re-index every document file the key can read. When there are more than the cap (100 by default), the call answers 400 and nothing is re-indexed.
true Documents to re-index, by document ID (from List Documents) or by document file ID (from List Document Files). The deployment may set a lower cap. Duplicate IDs are collapsed, so total can be smaller than the number sent. Send each ID once, and items lines up with your request in order.
1 - 100 elementsResponse
The indexing tasks were queued.
Bulk task ID. Poll it with Get Bulk Task.
One entry per distinct ID sent, in request order, followed by one entry per selected file when all is true. IDs that resolve to the same document file share one entry.
Show child attributes
Show child attributes
Number of entries in items.
Was this page helpful?
curl --request POST \
--url https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/documents/reindex \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"all": true
}'{
"bulk_job_id": "5a1c2e3d-7b8f-4a9c-8d1e-2f3a4b5c6d7e",
"items": [
{
"asset": {
"created_at": "2026-09-03T10:02:11Z",
"filename": "handbook.pdf",
"id": "6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b",
"knowledge_space_id": "9b2e5b7a-3c1d-4e2f-8a9b-1c2d3e4f5a6b",
"metadata": {},
"mime_type": "application/pdf",
"object_key": "1a7c9e40-2b3d-4f56-8a90-b1c2d3e4f506/spaces/9b2e5b7a-3c1d-4e2f-8a9b-1c2d3e4f5a6b/documents/6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b/handbook.pdf",
"parser_status": "parsed",
"sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"size_bytes": 482113,
"source_id": null,
"updated_at": null,
"version": 1
},
"code": null,
"compilation_job": {
"id": "e4a1f0b2-7c3d-4e5f-9a1b-2c3d4e5f6a7b",
"stage": "queued"
},
"document_id": null,
"error": null,
"status": "queued",
"status_url": "/knowledge-spaces/9b2e5b7a-3c1d-4e2f-8a9b-1c2d3e4f5a6b/documents/3d2f1c0b-9a8e-4d7c-b6a5-4f3e2d1c0b9a/processing-tasks/e4a1f0b2-7c3d-4e5f-9a1b-2c3d4e5f6a7b"
},
{
"asset": null,
"code": null,
"compilation_job": null,
"document_id": "8f14e45f-ceea-467a-9575-62c9a2d3e6b1",
"error": null,
"status": "not_found",
"status_url": null
}
],
"total": 2
}