Help Center/ CodeArts Repo/ API Reference/ APIs/ Repository/ Associating a Repository with a Member Group
Updated on 2025-03-28 GMT+08:00

Associating a Repository with a Member Group

Function

Associate a repository with a member group.

URI

POST /v4/{project_id}/repositories/{repository_id}/user-group/{user_group_id}

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

repository_id

Yes

Integer

Repository ID.

user_group_id

Yes

String

Member group ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

status

String

Association result.

Status code: 401

Table 4 Response body parameters

Parameter

Type

Description

error_msg

String

Response error information.

error_code

String

Response error code.

Example Requests

POST https://{endpoint}/v4/{project_id}/repositories/{repository_id}/user-group/{user_group_id}

Example Responses

Status code: 201

OK
{
     "status": "success"
}

Status code: 401

Unauthorized

{
    "error_code": "DEV.00000003"
    "error_msg": "Authentication information expired"
}

Status Code

Status Code

Description

201

OK

401

Unauthorized

Error code.

See Error Codes.