Help Center/ CodeArts Repo/ API Reference/ APIs/ V4/ Permission/ Updating the Repository Permission Matrix Configuration
Updated on 2026-04-28 GMT+08:00

Updating the Repository Permission Matrix Configuration

Function

This API is used to update the repository permission matrix configuration.

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/repository/{repository_id}/permissions/{resource_name}

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

resource_name

Yes

String

Definition:

Resource name

Constraints:

N/A

Value range:

  • repository: repository

  • code: code.

  • member: member

  • branch: branch

  • tag: tag

  • mr: merge request

  • label: merge request label

Default value:

N/A

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

data

No

Array of UpdatePermissionDto objects

Definition:

Update resource permission details.

Value range:

N/A

Table 4 UpdatePermissionDto

Parameter

Mandatory

Type

Description

role_id

No

String

Definition:

Role ID

Value range:

N/A

role_name

No

String

Definition:

Role name

Value range:

N/A

permissions

No

Array of UpdatePermissionDetail objects

Definition:

Update permission point details

Value range:

N/A

Table 5 UpdatePermissionDetail

Parameter

Mandatory

Type

Description

permission_id

No

Integer

Definition:

Permission point ID

Value range:

N/A

Value range:

1~2147483647

enabled

No

Boolean

Definition:

Permission point status

Value range:

  • true: enabled

  • false: disabled

Response Parameters

Status code: 200

Table 6 Response body parameters

Parameter

Type

Description

status

String

Definition:

Status code

  • success: The API request is successful.

  • fail: The API request failed.

Enumeration values:

  • success

  • fail

Example Requests

Update repository permission matrix configuration

PUT /v4/repository/{repository_id}/permissions/{resource_name}

Example Responses

Status code: 200

Update repository permission matrix configuration

{
  "status" : 200
}

Status Codes

Status Code

Description

200

Update repository permission matrix configuration

Error Codes

See Error Codes.