Check the execution status of an import job and the processing details of each document. index_id and job_id must be passed together.
Prerequisites
Get an API key and a workspace ID, and configure authentication first. See API overview and Authentication.
Endpoint
GET /api/v1/indices/rag/index_job/status
Check the execution status of an import job and the processing details of each document. index_id and job_id must be passed together.
When the Knowledge Base has no import job in progress, this endpoint may return
SystemError. Call it after submitting an import job.Request parameters
The following parameters are passed through the query string.
| Parameter | Required | Type | Description |
|---|---|---|---|
index_id | Yes | string | Knowledge Base ID, corresponding to the pipelineId returned when the Knowledge Base was created. |
job_id | Yes | string | Import job ID. It is the ingestionId field returned by Submit Import Job, and can also be found in the ingestion_id field of the document list. index_id and job_id must be passed together; passing only index_id returns SystemError. |
page_number | No | integer | Page number, starting from 1. Default: 1. Use pagination when the job involves many documents. |
page_size | No | integer | Number of documents per page. Default: 10. |
Request example
BASE_URL is https://{workspace_id}.cn-beijing.maas.aliyuncs.com ({workspace_id} is the workspace ID), and BAILIAN_API_KEY is your Alibaba Cloud Model Studio API key.
Response example
Returns 200 on success.
Response fields
| Field | Type | Description |
|---|---|---|
code | string | Response code. Success when successful. |
status_code | integer | HTTP status code. |
request_id | string | Unique request identifier. Provide this ID when troubleshooting. |
success | boolean | Whether the request succeeded. |
message | string | Response message. success when successful. |
status | string | Request status: SUCCESS or FAILED. |
data | object | Job status and processing details. See the table below for sub-fields. |
data fields
| Field | Type | Description |
|---|---|---|
id | string | Import job ID. |
ingestion_status | string | Overall job status: PENDING (waiting), RUNNING (in progress), COMPLETED (completed). |
ingestion_message | string | Job status description, usually consistent with ingestion_status. |
total_count | integer | Total number of documents involved in the job. May be 0 while the job is in progress. |
rows | array | Processing details of each document. Same structure as the rows of List Documents. See the table below for element fields. |
page_number | integer | Current page number. |
page_size | integer | Number of items per page. |
started_at | integer | Job start time as a Unix timestamp in milliseconds. |
ended_at | integer | Job end time as a Unix timestamp in milliseconds. null while in progress. |
created_at | integer | Job creation time as a Unix timestamp in milliseconds. |
updated_at | integer | Last job update time as a Unix timestamp in milliseconds. |
rows element fields
| Field | Type | Description |
|---|---|---|
doc_id | string | Document ID. |
doc_name | string | Document name. |
doc_type | string | Document type. |
code | string | Fine-grained processing status code, for example FINISH or PARSE_FAILED. |
status | string | Coarse-grained processing status. |
message | string | Processing status description, for example 索引构建成功 (index built successfully). |
size | integer | File size in bytes. |
ingestion_id | string | ID of the import job the document belongs to. |
connectorId | string | Associated connector ID. Empty string when no connector is used. |
categoryId | string | ID of the category the file belongs to. |
categoryName | string | Name of the category the file belongs to. |
tags | string | File tags, separated by commas. |
dataSync | boolean | Whether the file participates in data sync. |
canDelete | boolean | Whether the file can be deleted. |
source_id | string | File source identifier. |
gmt_modified | integer | Last modified time as a Unix timestamp in milliseconds. |
meta_extract_info | array | Metadata extraction results. |
Error codes
| HTTP status code | Error code (code) | Description |
|---|---|---|
| 400 | Index.InvalidParameter | Invalid request parameters: Required parameter missing or invalid. |
| 401 | InvalidApiKey | Invalid or missing API key: Invalid API-key provided. |