Skip to main content
GET
Get Bulk 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.

bulk_task_id
string<uuid>
required

Bulk task ID: bulk_job_id of the Re-index Documents response. List Background Tasks also returns it, as the id of a document_bulk task.

Response

The bulk task.

canceled_items
integer

Items whose task was canceled, including documents that were disabled when the re-index was requested.

completed_items
integer

Items that completed or were reported as not_found.

created_at
string

When the bulk task was created, ISO 8601.

failed_item_ids
string[]

IDs of the failed items, as submitted to Re-index Documents. They are not indexing task IDs. Map them to tasks with the items entries you kept from that response.

failed_items
integer

Items whose task failed.

failures
object[]

One entry per failed item. Empty when none failed.

id
string

Bulk task ID.

knowledge_space_id
string

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

status
string

Aggregate state:

  • running: at least one item is still in progress.
  • completed: every item completed (reached at least projection_built, which comes before published) or was reported as not_found.
  • failed: every item is terminal and at least one failed.
  • canceled: every item is terminal, none failed, and at least one was canceled.

completed does not guarantee that the new revisions are active yet. When that matters, check each task with Get Indexing Task for stage: published, using the task IDs you kept from Re-index Documents.

total_items
integer

Number of items submitted.

type
string

document_reindex for bulk tasks from this API. document_upload and document_delete arise only from Dify operations. A deletion over this API answers with a deletion job, which is not a bulk task: follow it with Get Deletion Job or Get Deletion Batch.

updated_at
string

Latest change across the bulk task and its indexing tasks, ISO 8601.