All Products
Document Center

ApsaraDB RDS:TagResources

Last Updated:May 22, 2024

Creates and adds tags to one or more instances.

Operation description

Supported database engines

  • MySQL
  • PostgreSQL
  • SQL Server
  • MariaDB


Note : Before you call this operation, carefully read the following documentation. Make sure that you fully understand the prerequisites and impacts for calling this operation.


OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
  • DBInstance

Request parameters


The region ID. You can call the DescribeRegions operation to query the most recent region list.


The type of the resource. Set the value to INSTANCE.


The instance ID.


The instance ID. You can add tags to N instances at a time. Valid values of N: 1 to 50.

Tagobject []No

The list of tags.


The key of the tag. You can create N tag keys at a time. Valid values of N: 1 to 20. The value of this parameter cannot be an empty string.


The value of the tag. You can create N tag values at a time. Valid values of N: 1 to 20. The value of this parameter can be an empty string.


Response parameters


The response parameters.


The request ID.



Sample success responses


  "RequestId": "224DB9F7-3100-4899-AB9C-C938BCCB43E7"

Error codes

HTTP status codeError codeError messageDescription
400NumberExceed.TagsThe maximum number of Tags is exceeded. The maximum value is 20.The maximum number of Tag is exceeded. The maximum value is 20.
400MissingParameterThe parameter - ResourceIds.N should not be null-
400MissingParameterThe parameter - Tags should not be nullYou must specify Tag.N.Key.
400InvalidTagKey.MalformedThe Tag.N.Key parameter is blankThe operation failed. The Tag.N.Key parameter is empty.
400InvalidTagValue.MalformedThe Tag.N.Value parameter is blankThe Tag.N.Value is empty.
400Duplicate.TagKeyThe Tag.N.Key contain duplicate key.The operation failed. A duplicate key is specified by the Tag.N.Key parameter.
400OperationDenied.QuotaExceedThe maximum number of Tags is exceeded.The maximum number of Tags is exceeded.
400NumberExceed.ResourceIdsThe maximum number of ResourceIds is exceeded. The maximum value is 50.The maximum number of ResourceIds is exceeded. The maximum value is 50.
400InvalidTagKey.MalformedThe operator is not permission for the system tagThe operation failed. You do not have permissions on system tags.
400Request.NotFoundThe requested resource is not available.The requested resources are unavailable.
400InvalidTagValue.MalformedThe Tag.N.Value parameter is invalid.The Tag.N.Value parameter is invalid.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2022-06-23API Description Update. The Error code has changedsee changesets
Change itemChange content
API DescriptionAPI Description Update.
Error CodesThe Error code has changed.
    delete Error Codes: 400