ListRepositories - Query the list of repositories

Updated at:

Queries the list of repositories through OpenAPI.

Applicable editions

Central edition, Region edition

Endpoints and authorization information

  • Get the endpoint to replace {domain} in the request syntax.
  • Get a personal access token.
  • Get the organization ID. This parameter is required only for the Central edition. Go to the Basic Information page in the Organization Management console to obtain the organization ID.

Product

Resource

Required permission

Codeup

Repository

Read-only

Request syntax

Central edition

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

Region edition

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

Request headers

Parameter

Type

Required

Description

Example value

x-yunxiao-token

string

Yes

Personal access token.

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

Request parameters

Parameter

Type

Location

Required

Description

Example value

organizationId

string

path

  • Yes: Central edition

  • No: Region edition

The organization ID.

60d54f3daccf2bbd6659f3ad

page

integer

query

No

The page number, which starts from 1 by default. Generally, do not exceed 150 pages.

1

perPage

integer

query

No

The number of items per page. Default value: 20. Valid values: 1 to 100.

20

orderBy

string

query

No

The sort field. Valid values: {created_at, name, path, last_activity_at}. Default value: created_at.

created_at

sort

string

query

No

The sort order. Valid values: {asc, desc}. Default value: desc.

desc

search

string

query

No

The search keyword, used to fuzzy-match repository paths.

TestRepo

archived

boolean

query

No

Specifies whether the repository is archived.

false

Request examples

Central edition

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

Region edition

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

Response parameters

Parameter

Type

Description

Example value

-

array

-

object

accessLevel

integer

The permission type of the current user on this repository. Valid values: [20 30 40].

40

archived

boolean

Specifies whether the repository is archived.

false

avatarUrl

string

The avatar URL.

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

createdAt

string

The creation time.

2024-10-05T15:30:45Z

creatorId

integer

The repository creator.

1

creatorUid

string

The repository creator (Yunxiao user ID).

5f8b3b3b3b3b3b3b3b3b3b3b

demoProject

boolean

Specifies whether it is a demo repository.

false

description

string

The repository description.

demo repo

encrypted

boolean

Specifies whether it is encrypted.

false

id

integer

The repository ID.

2813489

lastActivityAt

string

The last activity time.

2024-10-05T15:30:45Z

name

string

The repository name.

demo-repo

nameWithNamespace

string

The full name of the repository (including the full group name).

60de7a6852743a5162b5f957 / DemoRepo

namespaceId

integer

The ID of the parent path.

2813489

path

string

The repository path.

demo-repo

pathWithNamespace

string

The full path of the repository (including the full group path).

60de7a6852743a5162b5f957/DemoRepo

repositorySize

string

The repository size (MB).

1

repositoryTags

array

The list of repository tags.

-

object

The repository tag.

tagColor

string

The tag color.

#C4C6CF

tagName

string

The tag name.

Tag 1

starCount

integer

The number of stars.

1

starred

boolean

Specifies whether it is starred by the current user.

false

updatedAt

string

The last update time.

2024-10-05T15:30:45Z

visibility

string

The visibility: private, internal (public within the organization). Valid values: [private internal].

private

webUrl

string

The URL for page access.

http://example.com/org-demo/example-repo

Response example

[
    {
        "accessLevel": 40,
        "archived": false,
        "avatarUrl": "https://example/example/w/100/h/100",
        "createdAt": "2024-10-05T15:30:45Z",
        "creatorId": 1,
        "creatorUid": "5f8b3b3b3b3b3b3b3b3b3b3b",
        "demoProject": false,
        "description": "demo repo",
        "encrypted": false,
        "id": 2813489,
        "lastActivityAt": "2024-10-05T15:30:45Z",
        "name": "demo-repo",
        "nameWithNamespace": "60de7a6852743a5162b5f957 / DemoRepo",
        "namespaceId": 2813489,
        "path": "demo-repo",
        "pathWithNamespace": "60de7a6852743a5162b5f957/DemoRepo",
        "repositorySize": "1",
        "repositoryTags": [
            {
                "tagColor": "#C4C6CF",
                "tagName": "Tag 1"
            }
        ],
        "starCount": 1,
        "starred": false,
        "updatedAt": "2024-10-05T15:30:45Z",
        "visibility": "private",
        "webUrl": "http://example.com/org-demo/example-repo"
    }
]

Response headers

Parameter

Description

Example value

x-next-page

The next page.

3

x-page

The current page.

2

x-per-page

The number of items per page.

20

x-prev-page

The previous page.

1

x-request-id

The request ID.

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

x-total

The total number.

50

x-total-pages

The total number of pages.

3

Error codes

For more information about API error codes, see the Error Code Center.