UpdateFileTag

Updated at:

Updates the tags for a specified file.

Operation description

  • To call this API, a RAM user (sub-account) must first obtain the API permissions for Alibaba Cloud Model Studio (the AliyunBailianDataFullAccess policy, which includes the sfm:UpdateFileTag permission) and join a business space. An Alibaba Cloud account (primary account) can call this API directly without authorization. We recommend using the latest Alibaba Cloud Model Studio SDK to call this API.

Throttling: Frequent calls to this API are subject to throttling. Do not exceed a rate of 5 calls per second. If your request is throttled, try again later.

Try it now

You can run this API directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After the API runs successfully, OpenAPI Explorer can automatically generate SDK code examples.

RAM authorization

The following table lists the authorization information for this API. You can use it in the Action element of a RAM policy statement to grant RAM users or RAM roles the permission to call this API. Details:

  • Action: the specific permission point.

  • Access level: the access level of each operation. Valid values: Write, Read, or List.

  • Resource type: the resource types that support authorization for the operation. Details:

    • Required resource types are marked with a preceding asterisk (*).
    • For operations that do not support resource-level authorization, All Resources is shown.
  • Condition key: the condition keys defined by the cloud service itself.

  • Dependent action: other permissions required for the operation to succeed. The caller must have the permissions of all dependent actions before the operation can succeed.

Action

Access level

Resource type

Condition key

Dependent action

sfm:UpdateFileTag

update

*All Resource

*

NoneNone

Request syntax

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

Path parameters

Parameter

Type

Required

Description

Example

WorkspaceId

string

Yes

The ID of the workspace to which the file belongs. For information about how to obtain the workspace ID, see How to use workspaces.

llm-3z7uw7fwz0vxxxx

FileId

string

Yes

The ID of the file in the data center. You can go to the application data page and click the ID icon next to the file name to obtain the file ID.

file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx

Request parameters

Parameter

Type

Required

Description

Example

Tags

array

Yes

  • The list of tags to associate with the file. You can specify a maximum of 100 tags. The combined length of all tag values cannot exceed 700 characters.

string

No

The value of a tag. Each tag can be up to 32 characters long. Supported characters include Unicode letters (such as English and Chinese characters), digits, underscores (_), and hyphens (-). A tag cannot contain spaces.

TagA

Response elements

Element

Type

Description

Example

object

Schema of Response

Code

string

The error code.

Success

Data

object

The data returned.

FileId

string

The ID of the file.

file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx

Message

string

The error message.

Requests throttling triggered.

RequestId

string

The request ID.

35A267BF-xxxx-54DB-8394-AA3B0742D833

Status

string

The status code returned by the API.

200

Success

boolean

Indicates whether the request was successful. Valid values:

  • true: The request was successful.

  • false: The request failed.

true

Examples

Success response

JSON format

{
  "Code": "Success",
  "Data": {
    "FileId": "file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx"
  },
  "Message": "Requests throttling triggered.",
  "RequestId": "35A267BF-xxxx-54DB-8394-AA3B0742D833",
  "Status": "200",
  "Success": true
}

Error codes

Visit the Error Center to view more error codes.

Release notes

See Release Notes for a complete list.