UpdateRepositoryMember - Update repository member permissions
Updates the permission level of a repository member.
|
Applicable editions |
Central edition, Region edition |
Service endpoints and authorization
- Get service endpoints: Replace {domain} in the API request syntax.
- Get a personal access token.
- Get the organization ID from the Basic Information page in the organization admin center: Required only for Central edition.
|
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 |
|
The organization ID. |
60d54f3daccf2bbd6659f3ad |
|
repositoryId |
string |
path |
Yes |
The ID or URL-encoded full path of the repository. |
|
|
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 |
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 |
|
| 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 |
| 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 |
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 |
| name |
string |
The name of the member. |
codeup-demo |
| state |
string |
The member state. |
active |
| teamId |
string |
The team ID. Returned only when |
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.