UpdateRepositoryMember - Update repository member permissions

Updated at:

Updates the permission level of a repository member.

Applicable editions

Central edition, Region edition

Service endpoints and authorization

Product

Resource

Required permission

Codeup

member

Read/write

Request syntax

Central edition

PUT https://{domain}/oapi/v1/codeup/organizations/{organizationId}/repositories/{repositoryId}/members/{userId}

Region edition

PUT https://{domain}/oapi/v1/codeup/repositories/{repositoryId}/members/{userId}

Request headers

Parameter

Type

Required

Description

Example

x-yunxiao-token

string

Yes

The personal access token.

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

Request parameters

Parameter

Type

In

Required

Description

Example

organizationId

string

path

  • Yes, for Central edition.

  • No, for Region edition.

The organization ID.

60d54f3daccf2bbd6659f3ad

repositoryId

string

path

Yes

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

2813489

userId

string

path

Yes

The Alibaba Cloud DevOps user ID.

62c795xxxb468af8

accessLevel

integer

query

Yes

The access level. Valid values: 20 (reporter), 30 (developer), and 40 (maintainer).

40

expiresAt

string

query

No

The expiration date in yyyy-MM-dd format.

2024-10-05

Request examples

Central edition

curl -X 'PUT' \
  'https://{domain}/oapi/v1/codeup/organizations/60d54f3daccf2bbd6659f3ad/repositories/2813489/members/62c795xxxb468af8?accessLevel=40&expiresAt=2024-10-05' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Region edition

curl -X 'PUT' \
  'https://{domain}/oapi/v1/codeup/repositories/2813489/members/62c795xxxb468af8?accessLevel=40&expiresAt=2024-10-05' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Response parameters

Parameter

Type

Description

Example

-

object

The response object.

accessLevel

integer

The access level of the member. Valid values: 20 (reporter), 30 (developer), and 40 (maintainer).

30

avatarUrl

string

The URL of the avatar.

https://example/example/w/100/h/100

expiresAt

string

The expiration time.

2024-10-05T15:30:45Z

id

integer

The primary key of the membership record. This value has no business significance.

2813489

inheritedGroup

object

The group from which the member inherits permissions. Returns null if the member was added directly to the repository.

avatarUrl

string

The URL of the avatar.

https://example/example/w/100/h/100

fullPath

string

The full namespace path.

60de7a6852743a5162b5f957/parent-group

id

integer

The ID of the group.

1

kind

string

The type. Typically group.

group

name

string

The name of the group.

ParentGroup

nameWithNamespace

string

The full name, including the namespace.

60de7a6852743a5162b5f957 / ParentGroup

parentId

integer

The ID of the parent group.

2

path

string

The path of the group.

parent-group

pathWithNamespace

string

The full path, including the namespace.

60de7a6852743a5162b5f957/parent-group

visibility

string

The visibility of the group. Can be null in inheritance scenarios. Valid values: private, internal, and public.

private

webUrl

string

The URL to access the group's page.

https://example.com/60de7a6852743a5162b5f957/parent-group

memberType

string

The member type. Valid values: USERS (individual user) and TEAMS (team identified by teamId).

USERS

name

string

The name of the member.

codeup-demo

state

string

The member state. active: the member is active. blocked: the member is blocked and cannot access the repository.

active

teamId

string

The team ID. Returned only when memberType is TEAMS.

70d8ddd4-xxxx-xxxx-xxxx-46100efe985e

userId

string

The Alibaba Cloud DevOps user ID. Use this ID in other Codeup API calls that require a user ID.

62c795xxxb468af8

username

string

The username.

codeup-username

webUrl

string

The URL to access the user's page.

xxx

Response example

{
    "accessLevel": 30,
    "avatarUrl": "https://example/example/w/100/h/100",
    "expiresAt": "2024-10-05T15:30:45Z",
    "id": 2813489,
    "inheritedGroup": {
        "avatarUrl": "https://example/example/w/100/h/100",
        "fullPath": "60de7a6852743a5162b5f957/parent-group",
        "id": 1,
        "kind": "group",
        "name": "ParentGroup",
        "nameWithNamespace": "60de7a6852743a5162b5f957 / ParentGroup",
        "parentId": 2,
        "path": "parent-group",
        "pathWithNamespace": "60de7a6852743a5162b5f957/parent-group",
        "visibility": "private",
        "webUrl": "https://example.com/60de7a6852743a5162b5f957/parent-group"
    },
    "memberType": "USERS",
    "name": "codeup-demo",
    "state": "active",
    "teamId": "70d8ddd4-xxxx-xxxx-xxxx-46100efe985e",
    "userId": "62c795xxxb468af8",
    "username": "codeup-username",
    "webUrl": "xxx"
}

Error codes

For common error codes, see the Error Code Center.