Skip to main content
DELETE
Cancel Indexing Task

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).

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.

task_id
string<uuid>
required

Indexing task ID, the same in every place it appears: compilation_job.id of a queued item in the Re-index Documents response, latest_task.id from Get Document, id from List Document Indexing Tasks, and the id of a document task in List Background Tasks.

Response

The updated task, with stage and run_state set to canceled and completed_at set.

base_head_revision
integer | null

Internal. Not needed to follow the task.

candidate_fingerprint
string | null

Internal. Not needed to follow the task.

candidate_publication_id
string | null

Internal. Not needed to follow the task.

completed_at
number | null

When the task reached a terminal stage, in epoch milliseconds. null while it runs and after a retry.

created_at
number

When the task was created, in epoch milliseconds.

document_asset_id
string

ID of the document file being indexed. Usable with Get Document File. It is the asset.id of the Re-index Documents item that started the task, even when you submitted a document ID.

error
string | null

Short failure message. Can differ from failure.message. Set only when stage or run_state is failed. Otherwise null, including on canceled tasks.

execution_attempts
integer | null

Attempts made so far. Retry Indexing Task resets it to 0, so repeated retries never exhaust the attempt budget on their own.

failure
object | null

Error details when the task failed. null otherwise.

id
string

Indexing task ID.

knowledge_space_id
string

Internal ID of the knowledge base. Not the knowledge base ID in the path.

max_execution_attempts
integer | null

Attempts allowed before the task fails.

run_state
string | null

Scheduler state of the current attempt:

  • dispatch_pending: accepted, waiting to be dispatched to a worker.
  • queued: dispatched, waiting for a worker.
  • running: a worker is executing the task.
  • retry_wait: an automatic retry is scheduled, and stage stays unchanged.
  • succeeded: accompanies stage: published.
  • failed, canceled: terminal.
  • superseded: a newer attempt replaced this one. Terminal, reported with stage: canceled, and accepted by neither cancel nor retry.

null when not set. Retry Indexing Task sets it to dispatch_pending.

stage
string

Indexing stage, in forward order:

  • queued
  • parsed
  • outline_built
  • nodes_generated
  • projection_built
  • smoke_eval_passed
  • published

published means the new revision is active. failed and canceled are the other terminal values. Retry Indexing Task keeps the checkpoint the attempt had reached, so the value is rarely queued after a retry.

updated_at
number

When the task last changed, in epoch milliseconds.

version
integer

Version of the document file being indexed.