UpdateProjectLabel - Update a project label

Updated at:

Update a project label using OpenAPI.

Applicable editions

Central edition

Endpoints and authorization information

  • Obtain an endpoint. Replace {domain} in the API request syntax.
  • Obtain a personal access token.
  • Obtain an organization ID. This is required only for the Central edition. Go to the Basic Information page in the Organization Management console to obtain the organization ID.

Product

Resource

Required permission

Code Management

Project label

Read/Write

Request syntax

Central edition

PUT https://{domain}/oapi/v1/codeup/organizations/{organizationId}/repositories/{repositoryId}/labels/{labelId}

Request headers

Parameter

Type

Required

Description

Example

x-yunxiao-token

string

Yes

Personal access token.

pt-0fh3****0fbG_35af****0484

Request parameters

Parameter

Type

Location

Required

Description

Example

organizationId

string

path

Yes

The organization ID.

60d54f3daccf2bbd6659f3ad

repositoryId

string

path

Yes

The repository ID or the URL-encoded full path of the repository.

2813489 or 60de7a6852743a5162b5f957%2FDemoRepo

labelId

string

path

Yes

The label ID.

101

-

object

body

No

label_color

string

body

No

The color of the label in hexadecimal format. If this parameter is empty, the color is not updated. Valid values: #006AD4, #2FA6A4, #6190AC, #4B81D0, #4D5DBB, #A16AD7, #3BA630, #95B44F, #AA945F, #B36A53, #FD842F, and #EF433B.

#006AD4

label_description

string

body

No

The description of the label. If this parameter is empty, the description is not updated.

Indicates an error in the code

label_name

string

body

No

The name of the label. If this parameter is empty, the name is not updated.

Bug

Request example

curl -X 'PUT' \
  'https://{domain}/oapi/v1/codeup/organizations/60d54f3daccf2bbd6659f3ad/repositories/2813489or60de7a6852743a5162b5f957%2FDemoRepo/labels/101' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "label_color": "#006AD4",
        "label_description": "Indicates an error in the code",
        "label_name": "Bug"
    }'

Response parameters

Parameter

Type

Description

Example

-

object

color

string

The color of the label in hexadecimal format. Valid values: #006AD4, #2FA6A4, #6190AC, #4B81D0, #4D5DBB, #A16AD7, #3BA630, #95B44F, #AA945F, #B36A53, #FD842F, and #EF433B.

#006AD4

description

string

The description of the label.

Indicates an error in the code

id

string

The label ID.

68c1bd9b8515477fa86fac5exxxxx941

name

string

The name of the label.

Bug

Response example

{
    "color": "#006AD4",
    "description": "Indicates an error in the code",
    "id": "68c1bd9b8515477fa86fac5exxxxx941",
    "name": "Bug"
}

Error codes

For more information, see the Error Code Center for API-related error codes.