Help Center/ CodeArts Repo/ API Reference/ APIs/ V4/ Repository/ Modifying a Repository Tag
Updated on 2026-04-28 GMT+08:00

Modifying a Repository Tag

Function

This API is used to modify a repository tag.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

URI

PUT https://{hostURL}/v4/repositories/{repository_id}/label

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

repository_id

Yes

Integer

Definition

You can query the project list to obtain the repository ID by calling the API used to query user's all repositories.

Constraints

N/A.

Value range:

1~2147483647

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token. Obtain a token by calling the IAM API for obtaining a user token. The value of X-Subject-Token in the response header is the user token.

Constraints

Mandatory.

Range

1–100,000 characters.

Default Value

N/A.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Definition:

Tag name.

Constraints:

N/A.

Value range:

N/A.

Default value:

N/A.

new_name

No

String

Definition:

New tag name.

Constraints:

N/A.

Value range:

N/A.

Default value:

N/A.

color

No

String

Definition:

Tag color, which is provided in a 6-character hexadecimal format starting with sign (#) (for example, #FFAABB).

Constraints:

N/A.

Value range:

Regular expression: ^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$

Default value:

N/A.

description

No

String

Definition:

Description.

Constraints:

N/A.

Value range:

N/A.

Default value:

N/A.

priority

No

Integer

Definition:

Priority.

Constraints:

N/A.

Value range:

0–30

Default value:

N/A.

Value range:

0~30

expires_at

No

String

Definition:

Expiration time.

Constraints:

N/A.

Value range:

N/A.

Default value:

N/A.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

id

Integer

Definition:

Tag ID.

Value range:

1–2147483647

Value range:

1~2147483647

name

String

Definition:

Tag name.

Value range:

N/A.

color

String

Definition:

Tag color, which is provided in a 6-character hexadecimal format starting with sign (#) (for example, #FFAABB).

Value range:

Regular expression: ^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$

description

String

Definition:

Description.

Value range:

N/A.

text_color

String

Definition:

Font color, which is provided in a 6-digit hexadecimal format starting with sign (#) (for example, #FFAABB).

Value range:

Regular expression: ^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$

expires_at

String

Definition:

Expiration time.

Value range:

N/A.

is_expired

Boolean

Definition:

Whether it is invalid.

Value range:

N/A.

open_merge_requests_count

Integer

Definition:

Number of enabled MRs to be associated.

Constraints:

This field is returned by the MR repository.

Value range:

0–2147483647

Value range:

0~2147483647

open_change_request_count

Integer

Definition:

Number of enabled CRs to be associated.

Constraints:

This field is returned by the CR repository.

Value range:

0–2147483647

Value range:

0~2147483647

priority

Integer

Definition:

Priority.

Value range:

N/A.

Value range:

0~30

Example Requests

Modify a repository tag.

PUT /v4/repositories/123/label

{
  "name" : "bug22231",
  "description" : "4562",
  "color" : "#000"
}

Example Responses

Status code: 200

Get all labels of the project

{
  "id" : 24,
  "name" : "bug22231",
  "color" : "#000",
  "description" : "4562",
  "text_color" : "#FFFFFF",
  "expires_at" : null,
  "is_expired" : false,
  "open_merge_requests_count" : 0,
  "priority" : 0
}

Status Codes

Status Code

Description

200

Get all labels of the project

Error Codes

See Error Codes.