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

Adding a Repository Member

Function

This API is used to add a repository member.

URI

POST /v1/repositories/{repository_uuid}/members

Table 1 Path parameters

Parameter

Mandatory

Type

Description

repository_uuid

Yes

String

Explanation:

Repository UUID returned by the CreateRepository API.

Constraints:

Mandatory

Range:

32 digits and letters.

Default value:

None

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Explanation:

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.

Constraints:

Mandatory

Range:

None

Default value:

None

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

users

No

Array of RepoMemberInfo objects

Information list of added users.

Table 4 RepoMemberInfo

Parameter

Mandatory

Type

Description

domain_id

No

String

Explanation:

Tenant ID.

Constraints:

None

Range:

Minimum length: 8

Maximum length: 32

Default value:

None

domain_name

No

String

Explanation:

Tenant name.

Constraints:

None

Range:

None

Default value:

None

id

Yes

String

Explanation:

ID of the added user.

Constraints:

Mandatory

Range:

Minimum length: 4

Maximum length: 32

Default value:

None

name

Yes

String

Explanation:

Added username.

Constraints:

Mandatory

Range:

None

Default value:

None

role

Yes

Integer

Explanation:

User permissions.

Constraints:

Mandatory

Range:

20: Viewer. 30: Common member. 40: Administrator.

Default value:

None

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

error

Error object

Response error.

result

Array of CreateRepoMemberResult objects

Response result.

status

String

Response status.

Table 6 Error

Parameter

Type

Description

code

String

Error code.

message

String

Error message.

Table 7 CreateRepoMemberResult

Parameter

Type

Description

id

String

User ID.

Minimum length: 32

Maximum length: 32

message

String

Information of the added repository member.

name

String

Username.

status

String

Status of the added repository member.

Example Requests

POST https://{endpoint}/v1/repositories/{repository_uuid}/members

{
  "users" : [ {
    "id" : "87b3dc2019f04ee788cb635eb26154ca",
    "role" : 30,
    "name" : "repo"
  } ]
}

Example Responses

Status code: 200

OK

{
  "result" : {
    "id" : "87b3dc2019f04ee788cb635eb26154ca",
    "name" : null,
    "message" : "add user success",
    "status" : "success"
  },
  "status" : "success"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.