Skip to main content
POST

Authorizations

Authorization
string
header
required

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

Idempotency-Key
string

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.

Required string length: 8 - 255

Path Parameters

knowledge_base_id
string<uuid>
required

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

application/json

Optional fields marked nullable treat null as omitted.

The normalized request must fit within 1,048,576 UTF-8 bytes. See Request Size Limits.

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.

all
enum<boolean>
required

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.

Available options:
true
documentIds
string<uuid>[] | null

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.

Required array length: 1 - 100 elements

Response

The indexing tasks were queued.

bulk_job_id
string

Bulk task ID. Poll it with Get Bulk Task.

items
object[]

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.

total
integer

Number of entries in items.