UploadDocument
Uploads a document to a knowledge base.
Try it now
Test
RAM authorization
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 |
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 |
50 |
| Separators |
array |
No |
An array of strings used to split text. Note
|
|
|
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 |
| 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 |
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:
|
|
| 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.