All Products
Search
Document Center

Alibaba Cloud Model Studio:AddFile

Last Updated:Jul 07, 2026

Imports a file from the temporary storage of Alibaba Cloud Model Studio into an Alibaba Cloud Model Studio data connection (formerly known as application data).

Operation description

  • Resource Access Management (RAM) users must first obtain API permissions for Alibaba Cloud Model Studio (requires AliyunBailianDataFullAccess, which includes the sfm:AddFile permission), and join a workspace before invoking this operation. Alibaba Cloud accounts can invoke this operation directly without authorization. Invoke this operation by using the latest Alibaba Cloud Model Studio SDK.

  • This operation is not idempotent.

Throttling: This operation is subject to throttling. Do not exceed 10 calls per second. If you are throttled, retry later.

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

sfm:AddFile

create

*All Resource

*

None None

Request syntax

PUT /{WorkspaceId}/datacenter/file HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

WorkspaceId

string

Yes

The workspace ID. The file is uploaded to this workspace. For information about how to obtain the workspace ID, see How to use a workspace.

llm-3shx2gu255oqxxxx

Request parameters

Parameter

Type

Required

Description

Example

LeaseId

string

Yes

The upload lease ID, which corresponds to the FileUploadLeaseId returned by the ApplyFileUploadLease operation.

68abd1dea7b6404d8f7d7b9f7fbd332d.17166xxxxxxxx

Parser

string

Yes

The parser type. Valid values:

  • DOCMIND: intelligent document parsing

  • DOCMIND_DIGITAL: electronic document parsing

  • DOCMIND_LLM_VERSION: large language model document parsing

  • DASH_QWEN_VL_PARSER: Qwen VL parsing

  • DOCMIND_LLM_VERSION_MEDIA: audio and video parsing

  • AUTO_SELECT: automatic parser selection

Note The uploaded file is parsed by using the currently specified parser. If you set this parameter to AUTO_SELECT, the parser configured for the category is used.

AUTO_SELECT

CategoryId

string

Yes

Set this parameter to the category ID of the uploaded file, which is the CategoryId returned by the AddCategory operation. You can also go to Application Data, click the File tab, and then click the ID icon next to the category name to obtain the category ID. You can set this parameter to default to use the system-created default category.

cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx

Tags

array

No

  • The list of tags associated with the file. You can specify up to 100 tags, and the total character length of all tags cannot exceed 700.

  • Default value: empty, which means no tags are set.

string

No

The tag of the file. Each tag can contain up to 32 characters. The tag supports characters in the Unicode letter category (including English letters, Chinese characters, and digits), underscores (_), and hyphens (-).

产品介绍

CategoryType

string

No

The category type. This parameter is optional. Default value: UNSTRUCTURED. Valid values:

  • UNSTRUCTURED: category used for building knowledge base scenarios.

UNSTRUCTURED

OriginalFileUrl

string

No

Specifies a URL for the file. The system records this URL when building a document search knowledge base. When you use the Alibaba Cloud Model Studio console to interact with an agent application, this URL is returned with the retrieval results of the file through the docUrl field.

Note

The agent application must have Knowledge Base enabled and the Show answer sources feature turned on. Otherwise, this parameter does not take effect.

www.test.com/111.docx

ParserConfig

object

No

The parser configuration. This parameter is required only when the parser type is set to Qwen VL parsing.

ModelName

string

No

The model name.

qwen-vl-max

ModelPrompt

string

No

The prompt used when calling Qwen VL parsing.

#角色 你是一个专业的图片内容标注人员,擅长识别并描述出图片中的内容。 # 任务目标 请结合输入图片,详细描述图片中的内容。

Response elements

Element

Type

Description

Example

object

Schema of Response

Code

string

The error code.

DataCenter.FileTooLarge

Data

object

The data field returned by the operation.

FileId

string

The file ID. Keep this value safe because it is used in all subsequent API operations related to this file.

file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx

Parser

string

The parser type used to parse the file. Valid values:

  • DASHSCOPE_DOCMIND: Alibaba Cloud intelligent document parsing.

DASHSCOPE_DOCMIND

Message

string

The error message.

User not authorized to operate on the specified resource.

RequestId

string

The request ID.

778C0B3B-xxxx-5FC1-A947-36EDD13606AB

Status

string

The status code returned by the operation.

200

Success

string

Indicates whether the call was successful. Valid values:

  • true: The call was successful.

  • false: The call failed.

true

Examples

Success response

JSON format

{
  "Code": "DataCenter.FileTooLarge",
  "Data": {
    "FileId": "file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx",
    "Parser": "DASHSCOPE_DOCMIND"
  },
  "Message": "User not authorized to operate on the specified resource.",
  "RequestId": "778C0B3B-xxxx-5FC1-A947-36EDD13606AB",
  "Status": "200",
  "Success": "true"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.