ListNamespaces - List namespaces

Updated at:

Lists the namespaces and code groups visible to the authenticated user.

Applicable editions

Central edition, Region edition

Prerequisites

Product

Resource

Required permission

Codeup

code group

Read

Request syntax

Central edition

GET https://{domain}/oapi/v1/codeup/organizations/{organizationId}/namespaces

Region edition

GET https://{domain}/oapi/v1/codeup/namespaces

Request header

Parameter

Type

Required

Description

Example value

x-yunxiao-token

string

Yes

Personal access token.

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

Request parameters

Parameter

Type

Position

Required

Description

Example value

organizationId

string

path

  • Yes: Central edition

  • No: Region edition

Organization ID.

60d54f3daccf2bbd6659f3ad

parentId

integer

query

No

Parent group ID. Omit to list top-level namespaces.

1

page

integer

query

No

Page number. Default: 1. Recommended maximum: 150.

1

perPage

integer

query

No

Page size. Default: 20. Valid values: 1 to 100.

20

search

string

query

No

Keyword to filter namespaces.

Test

orderBy

string

query

No

Sort field. Valid values: created_at and updated_at. Default: updated_at.

updated_at

sort

string

query

No

Sort order. Valid values: asc and desc. Default: desc.

desc

Request examples

Central edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/codeup/organizations/60d54f3daccf2bbd6659f3ad/namespaces?parentId=1&page=1&perPage=20&search=Test&orderBy=updated_at&sort=desc' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Region edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/codeup/namespaces?parentId=1&page=1&perPage=20&search=Test&orderBy=updated_at&sort=desc' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Response parameters

Parameter

Type

Description

Example value

-

array

An array of namespace objects.

-

object

A namespace object.

avatarUrl

string

Avatar URL.

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

fullPath

string

Full path of the namespace.

60de7a6852743a5162b5f957/DemoGroup

id

integer

Namespace ID.

1

kind

string

Resource type. Always group.

group

name

string

Namespace name.

DemoGroup

nameWithNamespace

string

Full name including parent namespace.

60de7a6852743a5162b5f957 / DemoGroup

parentId

integer

Parent group ID.

2

path

string

Namespace path.

DemoGroup

pathWithNamespace

string

Full namespace path.

60de7a6852743a5162b5f957/DemoGroup

visibility

string

Namespace visibility. Valid values: private (members only) and internal (all organization members).

private

webUrl

string

Web URL of the namespace.

http://example.com/60de7a6852743a5162b5f957/DemoGroup

Response example

[
    {
        "avatarUrl": "https://example/example/w/100/h/100",
        "fullPath": "60de7a6852743a5162b5f957/DemoGroup",
        "id": 1,
        "kind": "group",
        "name": "DemoGroup",
        "nameWithNamespace": "60de7a6852743a5162b5f957 / DemoGroup",
        "parentId": 2,
        "path": "DemoGroup",
        "pathWithNamespace": "60de7a6852743a5162b5f957/DemoGroup",
        "visibility": "private",
        "webUrl": "http://example.com/60de7a6852743a5162b5f957/DemoGroup"
    }
]

Response headers

Parameter

Description

Example value

x-next-page

Next page number.

3

x-page

Current page number.

2

x-per-page

Page size.

20

x-prev-page

Previous page number.

1

x-request-id

Request ID.

37294673-00CA-5B8B-914F-A8B35511E90A

x-total

Total entry count.

50

x-total-pages

Total page count.

3

Error codes

API error codes: Error Center.