UpdateGroup - Update a group
|
Applicable editions |
Central edition, Region edition |
Prerequisites
-
Replace
{domain}in the request URL with the service endpoint. -
Get your organization ID: Required only for the Central edition. Go to the organization management console and find the organization ID on the Basic Information page.
|
Product |
Resource |
Required permissions |
|
Codeup |
group |
Read and write |
Request syntax
Central edition
PUT https://{domain}/oapi/v1/codeup/organizations/{organizationId}/groups/{groupId}
Region edition
PUT https://{domain}/oapi/v1/codeup/groups/{groupId}
Request headers
|
Parameter |
Type |
Required |
Description |
Example |
|
x-yunxiao-token |
string |
Yes |
Your personal access token. |
pt-0fh3****0fbG_35af****0484 |
Request parameters
|
Parameter |
Type |
Location |
Required |
Description |
Example |
|
organizationId |
string |
path |
|
The organization ID. |
60d54f3daccf2bbd6659f3ad |
|
groupId |
integer |
path |
Yes |
The group ID. |
1 |
| - |
object |
body |
No |
The request body that contains the fields to update. |
|
|
avatar |
string |
body |
No |
The avatar URL of the group. |
https://example/example/w/100/h/100 |
|
description |
string |
body |
No |
The group description. |
group description |
|
name |
string |
body |
No |
The group name. |
DemoGroup |
|
path |
string |
body |
No |
The group path. |
demo-group |
|
visibility |
string |
body |
No |
The visibility of the group. Valid values: |
private |
Request examples
Central edition
curl -X 'PUT' \
'https://{domain}/oapi/v1/codeup/organizations/60d54f3daccf2bbd6659f3ad/groups/1' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"avatar": "https://example/example/w/100/h/100",
"description": "group description",
"name": "DemoGroup",
"path": "demo-group",
"visibility": "private"
}'
Region edition
curl -X 'PUT' \
'https://{domain}/oapi/v1/codeup/groups/1' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"avatar": "https://example/example/w/100/h/100",
"description": "group description",
"name": "DemoGroup",
"path": "demo-group",
"visibility": "private"
}'
Response parameters
|
Parameter |
Type |
Description |
Example |
| - |
object |
The updated group details. |
|
|
avatarUrl |
string |
The avatar URL of the group. |
https://example/example/w/100/h/100 |
|
description |
string |
The description of the group. |
group description |
|
id |
integer |
The group ID. This ID can also be used as the namespace ID. |
1 |
|
name |
string |
The name of the group. |
DemoRepo |
|
nameWithNamespace |
string |
The full name of the group, including the namespace. |
60de7a6852743a5162b5f957 / DemoRepo |
|
ownerId |
integer |
The ID of the group owner. |
null |
|
parentId |
integer |
The ID of the parent group. |
2 |
|
path |
string |
The path of the group. |
DemoRepo |
|
pathWithNamespace |
string |
The full path of the group, including the namespace. |
60de7a6852743a5162b5f957/DemoRepo |
|
visibility |
string |
The visibility of the group. Possible values: |
private |
|
webUrl |
string |
The web URL of the group. |
http://example/60de7a6852743a5162b5f957/DemoRepo |
Response example
{
"avatarUrl": "https://example/example/w/100/h/100",
"description": "group description",
"id": 1,
"name": "DemoRepo",
"nameWithNamespace": "60de7a6852743a5162b5f957 / DemoRepo",
"ownerId": null,
"parentId": 2,
"path": "DemoRepo",
"pathWithNamespace": "60de7a6852743a5162b5f957/DemoRepo",
"visibility": "private",
"webUrl": "http://example/60de7a6852743a5162b5f957/DemoRepo"
}
Error codes
For API error codes, see the Error Code Center.