CreateGroup - Create a code group

Updated at:

Creates a code group in Codeup.

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: Required only for Central edition. Obtain the organization ID from the Organization Management console on the Basic Information page.

Product

Resource

Required permission

Codeup

code group

Read and write

Request syntax

Central edition

POST https://{domain}/oapi/v1/codeup/organizations/{organizationId}/groups

Region edition

POST https://{domain}/oapi/v1/codeup/groups

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: Central edition

  • No: Region edition

The ID of the organization.

60d54f3daccf2bbd6659f3ad

-

object

body

No

avatar

string

body

No

The URL for the code group's avatar.

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

description

string

body

No

A description of the code group, up to 65,535 characters long.

group description

name

string

body

Yes

The name of the code group.

DemoGroup

parentId

integer

body

No

The ID of the parent code group. If not specified, the code group is created at the root level of the organization.

1

path

string

body

Yes

The path of the code group.

DemoGroup

visibility

string

body

No

The visibility of the code group. Valid values: private and internal (public within the organization).

private

Request examples

Central edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/codeup/organizations/60d54f3daccf2bbd6659f3ad/groups' \
  -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",
        "parentId": 1,
        "path": "DemoGroup",
        "visibility": "private"
    }'

Region edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/codeup/groups' \
  -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",
        "parentId": 1,
        "path": "DemoGroup",
        "visibility": "private"
    }'

Response parameters

Parameter

Type

Description

Example

-

object

avatarUrl

string

The URL of the avatar.

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

description

string

The description of the code group.

group description

id

integer

The ID of the code group. This ID can also be used as the namespace ID.

1

name

string

The name of the code group.

DemoGroup

nameWithNamespace

string

The full name of the code group, including the namespace.

60de7a6852743a5162b5f957/DemoGroup

ownerId

integer

The ID of the user who created the code group.

null

parentId

integer

The ID of the parent code group.

2

path

string

The path of the code group.

DemoGroup

pathWithNamespace

string

The full path of the code group, including the namespace.

60de7a6852743a5162b5f957/DemoGroup

visibility

string

The visibility of the code group. Valid values: private and internal.

private

webUrl

string

The web URL of the code group.

http://example/60de7a6852743a5162b5f957/DemoGroup

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 error codes, see Error Center.