Updated on 2025-08-13 GMT+08:00

API for Querying Tasks

Function

View task details in the current knowledge base.

URI

GET /v1/{project_id}/applications/{application_id}/uni-search/{repo_id}/tasks

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition:

Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

Constraints:

N/A

Value range:

The value can contain 1 to 64 characters. Only digits, letters, hyphens (-), and underscores (_) are allowed. The value must start with a letter.

Default value:

N/A

application_id

Yes

String

Definition:

Application ID. For details about how to obtain the application ID, see Obtaining an Application ID.

Constraints:

Character string

Value range:

The value can contain 1 to 64 characters. Only digits, letters, hyphens (-), and underscores (_) are allowed. The value must start with a letter.

Default value:

N/A

repo_id

Yes

String

Definition:

Knowledge base ID.

How to obtain:

Log in to the KooSearch experience platform. In the navigation tree on the left, choose Knowledge Bases to view knowledge base IDs. Each knowledge base has a unique ID stored in the vector database.

Constraints:

N/A

Value range:

Length: 1 to 64 characters. The value can contain only digits, letters, hyphens (-), and underscores (_).

Default value:

N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

page_size

No

Integer

Definition:

Number of records displayed on each page, indicating the number of records returned per request. The default value is 10, indicating that 10 records are displayed on each page.

Constraints:

N/A

Value range:

1-65535

Default value:

10

page_num

No

Integer

Definition:

Page number of the current request, indicating the start page from data retrieval. The default value is 1, indicating to start from the first page.

Constraints:

N/A

Value range:

1-65535

Default value:

1

task_type

No

String

Definition:

Task type.

Constraints:

N/A

Value range:

  • QA: QA generation task

  • DELETE_TABLES: table deletion

  • TABLE_EXTRACTION: table generation task

  • RETRY_FILES: batch file retry

Default value:

N/A

task_status

No

String

Definition:

Task status.

Constraints:

N/A

Value range:

  • SUCCESS

  • ERROR

  • PENDING

  • RUNNING

Default value:

N/A

file_name

No

String

Definition:

Document name.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

create_user

No

String

Definition:

Creator name

Constraints:

N/A

Value range:

The user name contains 1 to 64 characters.

Default value:

N/A

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition:

Token used for API authentication. For details about how to obtain the token, see Obtaining an IAM User Token.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total

Integer

Definition:

Total number of tasks.

Value range:

N/A

page_size

Integer

Definition:

Page number.

Value range:

N/A

page_num

Integer

Definition:

Number of records per page.

Value range:

N/A

fail_count

Integer

Definition:

Number of failed tasks.

Value range:

N/A

success_count

Integer

Definition:

Successful tasks.

Value range:

N/A

running_count

Integer

Definition:

Number of running tasks.

Value range:

N/A

pending_count

Integer

Definition:

Number of queued tasks.

Value range:

N/A

tasks

Array of TaskInfo objects

Definition:

Task list.

Value range:

N/A

Table 5 TaskInfo

Parameter

Type

Description

id

String

Definition:

Job ID.

Value range:

N/A

name

String

Definition:

Document name.

Value range:

N/A

type

String

Definition:

Task type.

Value range:

N/A

status

String

Definition:

Task status.

Value range:

N/A

process

Float

Definition:

Task progress.

Value range:

N/A

create_time

String

Definition:

Task creation time.

Value range:

N/A

task_desc

String

Definition:

Task description.

Value range:

N/A

expires_at

String

Definition:

Expiration time of a compressed file.

Constraints:

This parameter is available when the task type is DOC, FAQ_IMPORT, STRUCTURED, or FAQ_ALL. It is used to record the time when the compressed package of the cleanup task is cleared. After the compressed package is cleared, this field is not displayed.

This field will be released in 25.7.T1 or later.

Value range:

N/A

Default value:

N/A

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Definition:

Error Code.

Value range:

N/A

error_msg

String

Definition:

Error message.

Value range:

N/A

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Definition:

Error Code.

Value range:

N/A

error_msg

String

Definition:

Error message.

Value range:

N/A

Example Requests

View task details in the current knowledge base.

/v1/{project_id}/applications/{application_id}/uni-search/{repo_id}/tasks?task_type=QA&task_status=SUCCESS&page_size=2

Example Responses

Status code: 200

Response body for querying tasks.

{
  "fail_count" : 0,
  "success_count" : 3,
  "running_count" : 0,
  "pending_count" : 0,
  "total" : 3,
  "page_num" : 1,
  "page_size" : 2,
  "tasks" : [ {
    "id" : "30fafbb1-a118-4859-ba0e-45b3bf3fdbb1",
    "name" : "E-Commerce Website Construction SaaS Interface Document v1.0.0.docx",
    "type" : "QA",
    "status" : "SUCCESS",
    "process" : 1,
    "create_time" : "1713183918628"
  }, {
    "id" : "03b1677d-19dd-4883-8598-ad3c18769d60",
    "name" : "Innovation Camp NUWA MiniDemo Developer Guide 2021-10-12-v07.docx",
    "type" : "QA",
    "status" : "SUCCESS",
    "process" : 1,
    "create_time" : "1713183918592",
    "task_desc" : "Assad"
  } ]
}

Status Codes

Status Code

Description

200

Response body for querying tasks.

400

Incorrect request body parameter.

500

Internal error.

Error Codes

See Error Codes.