All Products
Search
Document Center

AnalyticDB:UploadDocumentAsync

Last Updated:Aug 28, 2026

Uploads a document asynchronously to a specified document collection for vectorization and storage.

Operation description

The server loads and chunks a document based on the file extension, performs vectorization by using the embedding model that is specified when you call the CreateDocumentCollection operation, and then writes the document to the specified document collection. This operation supports multi-modal embedding for various formats of text and images.

Related operations:

  • You can call the GetUploadDocumentJob operation to query the progress and result of a document upload job.

  • You can call the CancelUploadDocumentJob operation to cancel a document upload job.

Note
  • After a document upload request is submitted, the request is queued for processing. Up to 20 documents in the Pending and Running states can be processed within a Resource Access Management (RAM) user or Alibaba Cloud account.

  • A text document can be split into up to 100,000 chunks.

  • If a document collection uses the OnePeace model, each RAM user or Alibaba Cloud account can upload and query up to 10,000 images.

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

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

gpdb:UploadDocumentAsync

create

*Document

acs:gpdb:{#regionId}:{#accountId}:document/{#DBInstanceId}

None None

Request parameters

Parameter

Type

Required

Description

Example

DBInstanceId

string

Yes

The ID of the instance that has vector engine optimization enabled. You can call the DescribeDBInstances operation to query instance IDs in the target region.

gp-bp12ga6v69h86****

Collection

string

Yes

The name of the document library.

Note

Created by the CreateDocumentCollection API. You can call the ListDocumentCollections API to view the document libraries that have already been created.

document

Namespace

string

No

The namespace. Default value: public. You can call CreateNamespace to create a namespace and ListNamespaces to view existing namespaces.

mynamespace

NamespacePassword

string

Yes

The password for the namespace. This value is specified when you call the CreateNamespace operation.

testpassword

RegionId

string

Yes

The region ID of the instance.

cn-hangzhou

FileName

string

Yes

The name of the file being uploaded.

Note
  • Text files: .json, .md, and .pdf.

  • Images: .bmp, .jpg, .jpeg, .png, and .tiff.

  • Archives (file name must include the extension): .tar, .gz, and .zip.

mydoc.txt

FileUrl

string

Yes

The URL of the publicly accessible document.

Note
Note
  • We recommend that you use the SDK, which provides the UploadDocumentAsyncAdvance method for uploading local files directly. If the URL points to an image archive, the archive must not contain more than 100 images.

https://xx/mydoc.txt

Metadata

object

No

The metadata. The value of this parameter must be the same as the Metadata parameter that is specified when you call the CreateDocumentCollection operation.

any

No

The metadata. The value of this parameter must be the same as the Metadata parameter that is specified when you call the CreateDocumentCollection operation.

{"title":"mytitle","page":1}

ChunkSize

integer

No

The size of each chunk when splitting a document. Maximum value: 2048.

250

ChunkOverlap

integer

No

The number of overlapping tokens between consecutive chunks. The value cannot exceed the ChunkSize value.

Note

This parameter is used to prevent context missing that may occur due to data truncation. For example, when you upload a long text, you can retain specific overlapped text content between consecutive chunks to better understand the context.

50

Separators

array

No

The separators that are used to split large amounts of data.

Note
  • This is an important parameter that determines the chunking effect. This parameter is related to the splitter that is specified by the TextSplitterName parameter.

  • In most cases, you do not need to specify this parameter. The server assigns separators based on the value of the TextSplitterName parameter.

string

No

The separator.

.

DryRun

boolean

No

Specifies whether to perform only document understanding and chunking, but not vectorization and storage. Default value: false.

Note

You can set this parameter to true, check the chunking effect, and then perform optimization if needed.

false

ZhTitleEnhance

boolean

No

Specifies whether to enable title enhancement.

Note

You can determine the title text, mark the text in the metadata, and then combine the text with the upper-level title to implement text enhancement.

false

TextSplitterName

string

No

The name of the separator. Valid values:

  • ChineseRecursiveTextSplitter: Inherits from RecursiveCharacterTextSplitter and, by default, uses the delimiters["\n\n","\n", ". |! |?", "\.\s|\! \s|\?\s", ";|;\s", ",|,\s"] , employing regular expressions to match text.

  • RecursiveCharacterTextSplitter: Uses the delimiters ["\n\n", "\n", " ", ""] by default. The splitter supports splitting code in languages such as C++, Go, Java, JS, PHP, Proto, Python, RST, Ruby, Rust, Scala, Swift, Markdown, LaTeX, HTML, Sol, and C Sharp.

  • SpacyTextSplitter: Uses the delimiters \n\n by default and leverages the spaCy en_core_web_sm model. The splitter can achieve better text splitting performance.

  • MarkdownHeaderTextSplitter: Splits text in the [("#", "head1"), ("##", "head2"), ("###", "head3"), ("####", "head4") format. This splitter works well with Markdown text.

  • LLMSplitter: Use LLM to split text. The default model is qwen3-8b. Currently, this splitter works only when ADBPGLoader is selected.

ChineseRecursiveTextSplitter

DocumentLoaderName

string

No

The document loader for processing the file. If not specified, the system selects a loader based on the file extension. Valid values:

  • UnstructuredHTMLLoader: .html

  • UnstructuredMarkdownLoader: .md

  • PyMuPDFLoader: .pdf

  • PyPDFLoader: .pdf

  • RapidOCRPDFLoader: .pdf

  • PDFWithImageRefLoader: .pdf (with the text-image association feature)

  • JSONLoader: .json

  • CSVLoader: .csv

  • RapidOCRLoader: .png, .jpg, .jpeg, and .bmp

  • UnstructuredFileLoader: .eml, .msg, .rst, .txt, .docx, .epub, .odt, .pptx, and .tsv

  • ADBPGLoader (free of charge for the first 3,000 pages): .pdf, .doc, .docx, .ppt, .pptx, .xls, .xlsx, .xlsm, .csv, .txt, .jpg, .jpeg, .png, .bmp, .gif, .md, .html, .epub, .mobi, and .rtf

PyMuPDFLoader

VlEnhance

boolean

No

Specifies whether to enable VL-enhanced content recognition for complex documents. Default value: false.

Note
  • For complex documents with confusing typesetting and formatting, we recommend that you enable VL-enhanced content recognition.

  • Document processing time is longer after VL-enhanced content recognition is enabled.

  • After VL-enhanced content recognition is enabled, images in documents cannot be stored or recalled.

false

SplitterModel

string

No

When DocumentLoaderName is set to ADBPGLoader and TextSplitterName is set to LLMSplitter, you can specify the splitting model. Default Value: qwen3-8b.

Note

Supported splitting models: qwq-plus, qwq-plus-latest, qwen-max, qwen-max-latest, qwen-plus, qwen-plus-latest, qwen-turbo, qwen-turbo-latest, qwen3-235b-a22b, qwen3-32b,qwen3-30b-a3b, qwen3-14b, qwen3-8b, qwen3-4b, qwen3-1.7b, qwen3-0.6b, qwq-32b qwen2.5-14b-instruct-1m, qwen2.5-7b-instruct-1m, qwen2.5-72b-Instruct, qwen2.5-32b-Instruct, qwen2.5-14b-Instruct, qwen2.5-7b-Instruct, qwen2.5-3b-instruct, qwen2.5-1.5b-instruct, qwen2.5-0.5b-instruct.

qwen3-8b

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

ABB39CC3-4488-4857-905D-2E4A051D0521

Message

string

The returned message.

success

Status

string

API execution status, with the following values:

  • success: Execution succeeded.

  • fail: Execution failed.

success

JobId

string

The job ID.

231460f8-75dc-405e-a669-0c5204887e91

Examples

Success response

JSON format

{
  "RequestId": "ABB39CC3-4488-4857-905D-2E4A051D0521",
  "Message": "success",
  "Status": "success",
  "JobId": "231460f8-75dc-405e-a669-0c5204887e91"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.