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

API for Creating Tasks in Batches

Function

Create tasks in batches.

URI

POST /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

Request Parameters

Table 2 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

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

task_type

Yes

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

file_ids

Yes

Array of strings

Definition:

File ID list.

Constraints:

N/A

Value range:

File ID, a string of 1 to 64 characters. The value can only contain letters, digits, underscores (_), and hyphens (-).

Default value:

N/A

task_context

No

TaskContext object

Definition:

Task context.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Table 4 TaskContext

Parameter

Mandatory

Type

Description

is_inherit_parser

No

Boolean

Definition:

Flag indicating whether to inherit the parser.

Value range:

N/A

file_ids

No

Array of strings

Definition:

File ID list.

Value range:

N/A

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

total_count

Integer

Definition:

Number of tasks to be created.

Value range:

N/A

created_count

Integer

Definition:

Number of successfully created tasks.

Value range:

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

  • Batch Q&A Generation

    /v1/{project_id}/applications/{application_id}/uni-search/{repo_id}/tasks
    
    {
      "file_ids" : [ "313dc4fa-da64-4d97-b31c-2d557985ca14", "89f52509-e5c6-4a1a-8891-cb333b74f81a" ],
      "task_type" : "QA"
    }
  • Batch File Retry

    /v1/{project_id}/applications/{application_id}/uni-search/{repo_id}/tasks
    
    {
      "task_type" : "RETRY_FILES",
      "file_ids" : [ "1fee542f05221fec339810e38e6e3718", "2f6053aa43ecbc36e87494c05f32019d", "61e5504a20be43e1b1c7379702e95087" ]
    }

Example Responses

Status code: 200

Response body for creating tasks in batches.

{
  "total_count" : 1,
  "created_count" : 1
}

Status Codes

Status Code

Description

200

Response body for creating tasks in batches.

400

Incorrect request body parameter.

500

Internal error.

Error Codes

See Error Codes.