Updated on 2025-02-25 GMT+08:00

Importing User Tags

Function

This API is used to modify user or user group tags in batches.

  • The import file must be an Excel file.
  • The number of entries per batch import is limited, with a default limit of 1,000 entries.
  • The number of new tags is validated according to the logic of the new tag API. If the number of tags exceeds the limit, the import will fail.
  • The validation rules for tag names and tag values are consistent with those for adding new tags or tag values.
  • The account_id field must be present during import. The value is carried from the export file and serves as the unique ID for the user or user group. It cannot be edited or modified.

URI

POST /v1/{project_id}/tags/import

Table 1 URI parameter

Parameter

Mandatory

Type

Description

project_id

Yes

String

Explanation

Project ID. For how to obtain the project ID, see Obtaining a Project ID.

Constraints

N/A

Value range

N/A

Default value

N/A

Request Parameters

Table 2 Request header parameter

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Explanation

User token. Obtain a user token by calling IAM's "Obtaining a User Token" API. X-Subject-Token in the response header is the desired user token.

Constraints

N/A

Value range

N/A

Default value

N/A

Table 3 FormData parameters

Parameter

Mandatory

Type

Description

file

Yes

File

Explanation

File that contains the user or user group tags to be imported, which must be in Excel format.

Constraints

  • Must be an Excel file.
  • The file size must not exceed 10 MB.
  • The number of rows for users or user groups to be processed during import must not exceed 1,000.

Value range

N/A

Default value

N/A

type

Yes

String

Explanation

User type.

Constraints

N/A

Value range

  • user: user.
  • userGroup: user group.

Default value

N/A

Response Parameters

Status code: 200

Table 4 Response body parameter

Parameter

Type

Description

data

Boolean

Explanation

Execution result.

Constraints

N/A

Value range

  • true: success.
  • false: failure.

Default value

N/A

Example Request

None

Example Response

Status code: 200

The tags are successfully imported.

{
  "data" : true
}

Status Codes

Status Code

Description

200

The tags are successfully imported.

Error Codes

See Error Codes.