Skip to main content

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

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.
ParameterRequiredTypeDescription
index_idYesstringKnowledge Base ID, corresponding to the pipelineId returned when the Knowledge Base was created.
job_idYesstringImport 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_numberNointegerPage number, starting from 1. Default: 1. Use pagination when the job involves many documents.
page_sizeNointegerNumber of documents per page. Default: 10.

Request example

curl -G "$BASE_URL/api/v1/indices/rag/index_job/status" \
  -H "Authorization: Bearer $BAILIAN_API_KEY" \
  -d "index_id=your-kb-id" \
  -d "job_id=your-job-id"
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.
{
  "code": "Success",
  "status_code": 200,
  "data": {
    "id": "your-job-id",
    "ingestion_status": "COMPLETED",
    "ingestion_message": "COMPLETED",
    "total_count": 4,
    "rows": [
      {
        "code": "FINISH",
        "doc_id": "file_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxx",
        "doc_name": "sample_document",
        "doc_type": "pdf",
        "size": 191166,
        "status": "FINISH",
        "message": "索引构建成功",
        "ingestion_id": "your-job-id",
        "dataSync": false,
        "canDelete": true,
        "meta_extract_info": [],
        "gmt_modified": 1782209511000
      }
    ],
    "page_number": 1,
    "page_size": 10,
    "started_at": 1782209506000,
    "ended_at": 1782209512000,
    "created_at": 1782209506000,
    "updated_at": 1782209512000
  },
  "success": true,
  "message": "success",
  "request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "SUCCESS"
}

Response fields

FieldTypeDescription
codestringResponse code. Success when successful.
status_codeintegerHTTP status code.
request_idstringUnique request identifier. Provide this ID when troubleshooting.
successbooleanWhether the request succeeded.
messagestringResponse message. success when successful.
statusstringRequest status: SUCCESS or FAILED.
dataobjectJob status and processing details. See the table below for sub-fields.

data fields

FieldTypeDescription
idstringImport job ID.
ingestion_statusstringOverall job status: PENDING (waiting), RUNNING (in progress), COMPLETED (completed).
ingestion_messagestringJob status description, usually consistent with ingestion_status.
total_countintegerTotal number of documents involved in the job. May be 0 while the job is in progress.
rowsarrayProcessing details of each document. Same structure as the rows of List Documents. See the table below for element fields.
page_numberintegerCurrent page number.
page_sizeintegerNumber of items per page.
started_atintegerJob start time as a Unix timestamp in milliseconds.
ended_atintegerJob end time as a Unix timestamp in milliseconds. null while in progress.
created_atintegerJob creation time as a Unix timestamp in milliseconds.
updated_atintegerLast job update time as a Unix timestamp in milliseconds.

rows element fields

FieldTypeDescription
doc_idstringDocument ID.
doc_namestringDocument name.
doc_typestringDocument type.
codestringFine-grained processing status code, for example FINISH or PARSE_FAILED.
statusstringCoarse-grained processing status.
messagestringProcessing status description, for example 索引构建成功 (index built successfully).
sizeintegerFile size in bytes.
ingestion_idstringID of the import job the document belongs to.
connectorIdstringAssociated connector ID. Empty string when no connector is used.
categoryIdstringID of the category the file belongs to.
categoryNamestringName of the category the file belongs to.
tagsstringFile tags, separated by commas.
dataSyncbooleanWhether the file participates in data sync.
canDeletebooleanWhether the file can be deleted.
source_idstringFile source identifier.
gmt_modifiedintegerLast modified time as a Unix timestamp in milliseconds.
meta_extract_infoarrayMetadata extraction results.

Error codes

HTTP status codeError code (code)Description
400Index.InvalidParameterInvalid request parameters: Required parameter missing or invalid.
401InvalidApiKeyInvalid or missing API key: Invalid API-key provided.
Managed Agent API
Flow Agent API
Sandbox API
RAG API
Long-term Memory
ParseX API
Security API
Framework Integration