Skip to main content
get/knowledge-fs/spaces/{knowledge_base_id}/bulk-jobs/{bulk_task_id}
Request example
Response
get/knowledge-fs/spaces/{knowledge_base_id}/bulk-jobs/{bulk_task_id}

Authorization

Authorizationstringheaderrequired#

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_idstringrequired#
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_idstringrequired#
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. The id of a document_delete task from Delete Document is a deletion job ID: follow it with Get Deletion Job.

Responses

application/json
The bulk task.
canceled_itemsinteger#
Items whose task was canceled, including documents that were disabled when the re-index was requested.
completed_itemsinteger#
Items that completed or were reported as not_found.
created_atstring#
When the bulk task was created, ISO 8601.
failed_item_idsstring[]#
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_itemsinteger#
Items whose task failed.
failuresobject[]#
One entry per failed item. Empty when none failed.
idstring#
Bulk task ID.
knowledge_space_idstring#
Internal ID of the knowledge base. Not the knowledge base ID in the path.
statusstring#

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_itemsinteger#
Number of items submitted.
typestring#
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_atstring#
Latest change across the bulk task and its indexing tasks, ISO 8601.