UploadDocument

Updated at:

Uploads a document to a knowledge base.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

KbUuid

string

Yes

The ID of the knowledge base.

kb-***

FileName

string

Yes

The name of the document.

test.md

Location

string

Yes

The OSS location of the input file. Construct this path by appending the file name to the UploadDir value returned by the DescribeKnowledgeBaseUploadSignature operation.

knowledge_base/1666698629****/kb-***

Description

string

No

The description of the document.

test

ChunkSize

integer

No

The size of each document chunk. The default is 250, and the maximum is 2,048.

250

ChunkOverlap

integer

No

The number of overlapping characters between adjacent chunks. This value cannot exceed ChunkSize. The default is 50.

50

Separators

array

No

An array of strings used to split text.

Note
  • This critical parameter affects data chunking results and is related to the splitter specified by TextSplitterName.

  • In most cases, you can omit this parameter. The service automatically assigns default separators based on TextSplitterName.

string

No

A separator.

\n

ZhTitleEnhance

boolean

No

Specifies whether to enable title enhancement.

false

TextSplitterName

string

No

The name of the text splitter.

ChineseRecursiveTextSplitter

DocumentLoaderName

string

No

The name of the document loader. The default is ADBPGLoader.

ADBPGLoader

VlEnhance

boolean

No

Specifies whether to enable visual-linguistic (VL) enhanced content recognition for complex documents. The default is false.

false

SplitterModel

string

No

The splitter model to use. The default is qwen3-8b.

qwen3-8b

Response elements

Element

Type

Description

Example

object

The response body.

RequestId

string

The unique ID of the request. Use this ID to troubleshoot issues.

67E910F2-4B62-5B0C-ACA3-7547695C****

Success

boolean

Indicates whether the request succeeded. Valid values:

  • true: The request succeeded.

  • false: The request failed.

ErrorCode

string

The error code returned if the request fails.

KnowledgeBaseNotFound

ErrorMessage

string

The error message returned if the request fails.

Resource not found kb-***

Data OneMetaKnowledgeBaseDocument

The returned data object.

Examples

Success response

JSON format

{
  "RequestId": "67E910F2-4B62-5B0C-ACA3-7547695C****",
  "Success": false,
  "ErrorCode": "KnowledgeBaseNotFound",
  "ErrorMessage": "Resource not found kb-***",
  "Data": {
    "KbUuid": "",
    "Name": "",
    "Description": "",
    "FileExt": "",
    "DocumentLoaderName": "",
    "TextSplitterName": "",
    "GmtCreate": "",
    "GmtModified": "",
    "FileSize": 0,
    "DocsCount": 0,
    "State": 0,
    "Summary": "",
    "Keywords": ""
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.