Help Center/ CodeArts Repo/ API Reference/ APIs/ RepoMember/ Add repository members
Updated on 2023-05-06 GMT+08:00

Add repository members

Function

Add a warehouse member.

URI

POST /v1/repositories/{repository_uuid}/members

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

repository_uuid

Yes

String

Repository UUID, which is returned by the CreateRepository API.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies a user token.

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

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

users

No

Array of RepoMemberInfo objects

List of user information to be added.

Table 4 RepoMemberInfo

Parameter

Mandatory

Type

Description

domain_id

No

String

Tenant ID of a user.

Minimum: 8

Maximum: 32

domain_name

No

String

Tenant name of the user

id

Yes

String

ID of the user to be added.

Minimum: 4

Maximum: 32

name

Yes

String

Name of the user to be added

role

Yes

Integer

Permission of the user to be added. The options are as follows: 30->common member, 40->administrator

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

error

Error object

Response error.

result

Array of CreateRepoMemberResult objects

Result

status

String

Response Status

Table 6 Error

Parameter

Type

Description

code

String

Error Codes

message

String

Error message

Table 7 CreateRepoMemberResult

Parameter

Type

Description

id

String

Specifies the user ID.

Minimum: 32

Maximum: 32

message

String

Creating Warehouse Member Information

name

String

User Name

status

String

Creating a Warehouse Member Status

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.