Help Center/ CodeArts Repo/ API Reference/ APIs/ V4/ Repository/ Obtaining Fork List of a Repository
Updated on 2026-04-28 GMT+08:00

Obtaining Fork List of a Repository

Function

This API is used to obtain the fork list of a repository.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

URI

GET https://{hostURL}/v4/repositories/{repository_id}/forks

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

repository_id

Yes

Integer

Definition

You can query the project list to obtain the repository ID by calling the API used to query user's all repositories.

Constraints

N/A.

Value range:

1~2147483647

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

No

Integer

Definition

Offset, which starts from 0.

Value range:

0~2147483647

Default value:

0

limit

No

Integer

Definition

Number of returned records.

Value range:

1~100

Default value:

20

order_by

No

String

Definition:

Sorting field.

Constraints:

The value must be an enumerated value.

Value range:

  • created_at: Creation time.

  • updated_at: Update time.

Default value:

created_at.

Default value:

created_at

Enumeration values:

  • created_at

  • updated_at

sort

No

String

Definition:

Sorting order.

Constraints:

The value must be an enumerated value.

Value range:

  • asc

  • desc

Default value:

desc.

Default value:

desc

Enumeration values:

  • asc

  • desc

view

No

String

Definition:

View.

Constraints:

The value must be an enumerated value.

Value range:

  • basic: Basic information.

  • least: Simplest information.

Default value:

least.

Default value:

least

Enumeration values:

  • basic

  • least

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token. Obtain a token by calling the IAM API for obtaining a user token. The value of X-Subject-Token in the response header is the user token.

Constraints

Mandatory.

Range

1–100,000 characters.

Default Value

N/A.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

[items]

Array of ForkRepositoryDto objects

Repository information.

Table 5 ForkRepositoryDto

Parameter

Type

Description

id

Integer

Definition:

Repository ID.

Constraints:

N/A.

Value range:

1~2147483647

name

String

Definition:

Repository name.

Constraints:

N/A.

archived

Boolean

Definition:

Archived or not.

Constraints:

N/A.

product_id

String

Definition:

Product ID.

Constraints:

N/A.

product_name

String

Definition:

Product name.

Constraints:

N/A.

path_with_namespace

String

Definition:

Repository path that has a namespace.

Constraints:

It is returned when the value of view is least.

namespace

String

Definition:

Namespace.

Constraints:

It is returned when the value of view is basic.

path

String

Definition:

Repository path.

Constraints:

It is returned when the value of view is basic.

develop_mode

String

Definition:

Development mode.

Constraints:

It is returned when the value of view is basic.

visibility

String

Definition:

Visibility.

Constraints:

It is returned when the value of view is basic.

security

String

Definition:

Security level.

Constraints:

It is returned when the value of view is basic.

star_count

Integer

Definition:

Follows.

Constraints:

It is returned when the value of view is basic.

Value range:

1~2147483647

forks_count

Integer

Definition:

Number of forks.

Constraints:

It is returned when the value of view is basic.

Value range:

1~2147483647

open_merge_requests_count

Integer

Definition:

Number of enabled merge requests.

Constraints:

It is returned when the value of view is basic.

Value range:

1~2147483647

starred

Boolean

Definition:

Favorite or not.

Constraints:

It is returned when the value of view is basic.

name_with_namespace

String

Definition:

Name of a repository that has a namespace.

Constraints:

It is returned when the value of view is basic.

last_activity_at

String

Definition:

Time when the last action was performed.

Constraints:

It is returned when the value of view is basic.

created_at

String

Definition:

Creation time.

Constraints:

It is returned when the value of view is basic.

Example Requests

None

Example Responses

Status code: 200

Repository information

[ {
  "id" : 2111851926,
  "path_with_namespace" : "41bcec7bf2c84efea690e987ca98ee40/test",
  "name" : "test",
  "product_id" : "41bcec7bf2c84efea690e987ca98ee40",
  "product_name" : "lhtest",
  "archived" : false
}, {
  "id" : 2111965407,
  "path_with_namespace" : "41bcec7bf2c84efea690e987ca98ee40/222",
  "name" : "222",
  "product_id" : "41bcec7bf2c84efea690e987ca98ee40",
  "product_name" : "lhtest",
  "archived" : false
} ]

Status Codes

Status Code

Description

200

Repository information

Error Codes

See Error Codes.