Help Center/ Cloud Search Service_KooSearch/ API Reference/ API/ APIs/ File Management/ Creating Chunks from a Parsed Document
Updated on 2025-12-02 GMT+08:00

Creating Chunks from a Parsed Document

Function

Create chunks from a specified file.

URI

POST /v1/{project_id}/applications/{application_id}/uni-search/files/{file_id}/docs

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

file_id

Yes

String

Definition:

File ID.

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

repo_id

No

String

Definition:

Knowledge base ID. When carried in the request, it specifies the target knowledge base for the query.

Constraints:

N/A

Value range:

N/A

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

Table 4 Request body parameters

Parameter

Mandatory

Type

Description

title

No

String

Definition:

Title.

Constraints:

N/A

Value range:

The value contains 1 to 1000 characters.

Default value:

N/A

content

Yes

String

Definition:

Content.

Constraints:

N/A

Value range:

The value contains 1 to 10,000 characters.

Default value:

N/A

page_num

No

Long

Definition:

Page number of the document.

Constraints:

N/A

Value range:

0-65536

Default value:

0

component_num

No

Long

Definition:

Chunk sequence number.

Constraints:

N/A

Value range:

1-65536

Default value:

N/A

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

doc_id

String

Definition:

New chunk ID

Value range:

N/A

Example Requests

Create chunks from a specified file.

/v1/b25446daeb1a41a7953c5deba2b2677a/applications/5071b12e-8c5c-4181-a15b-41e6ae3915ea/uni-search/files/cea3f07d5a30a7256ddb2454d7d7814d/docs

{
  "title" : "title-demo",
  "content" : "content-demo",
  "page_num" : 1,
  "component_num" : 1
}

Example Responses

Status code: 200

Document created successfully.

{
  "doc_id" : "bbbe6353-6d8b-4016-b2e2-e58c0ba764a7"
}

Status Codes

Status Code

Description

200

Document created successfully.

Error Codes

See Error Codes.