Help Center/ CodeArts Repo/ API Reference/ APIs/ V4/ Repository/ Querying the Details About a Repository
Updated on 2026-04-28 GMT+08:00

Querying the Details About a Repository

Function

This API is used to query the details about 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}

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

Request Parameters

Table 2 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 3 Response body parameters

Parameter

Type

Description

id

Integer

Definition:

Repository ID.

Value range:

1~2147483647

description

String

Definition:

Repository description.

name

String

Definition:

Repository name.

name_with_namespace

String

Definition:

Repository full name.

path

String

Definition:

Repository path.

path_with_namespace

String

Definition:

Complete repository path.

created_at

String

Definition:

Creation time.

updated_at

String

Definition:

Update time.

archived

Boolean

Definition:

Archived or not.

ssh_url_to_repo

String

Definition:

Repository SSH address.

http_url_to_repo

String

Definition:

HTTP address of the repository.

project_id

String

Definition:

Repository project ID.

project_name

String

Definition:

Repository project name.

develop_mode

String

Definition:

Repository development mode.

Value range:

  • normal

  • CR

Enumeration values:

  • normal

  • CR

moderation_result

Boolean

Definition:

Review status.

default_branch

String

Definition:

Default branch of the repository.

Constraints:

N/A.

avatar_url

String

Definition:

Repository icon URL.

Constraints:

N/A.

star_count

Integer

Definition:

Follows.

Constraints:

N/A.

Value range:

1~2147483647

forks_count

Integer

Definition:

Number of forks.

Constraints:

N/A.

Value range:

1~2147483647

open_issues_count

Integer

Definition:

Number of enabling issues.

Constraints:

N/A.

Value range:

1~2147483647

open_merge_requests_count

Integer

Definition:

Number of enabled CRs and MRs.

Constraints:

N/A.

Value range:

1~2147483647

last_activity_at

String

Definition:

Time when the last action was performed.

Constraints:

N/A.

namespace

NamespaceBasicDto object

Definition:

Namespace.

Constraints:

N/A.

empty_repo

Boolean

Definition:

Empty repository.

Constraints:

N/A.

starred

Boolean

Definition:

Favorite or not.

Constraints:

N/A.

visibility

String

Definition:

Repository visibility level.

Constraints:

N/A.

security_tag

String

Definition:

Repository confidentiality level.

Constraints:

N/A.

security

String

Definition:

Repository confidentiality level.

Constraints:

N/A.

network_type

String

Definition:

Network type.

Constraints:

N/A.

owner

RepositoryUserBasicDto object

Definition:

Repository owner.

Constraints:

N/A.

creator

RepositoryUserBasicDto object

Definition:

Repository creator.

Constraints:

N/A.

creator_id

Integer

Definition:

Creator ID.

Constraints:

N/A.

Value range:

1~2147483647

forked_from_repository

RepositorySimpleDto object

Definition:

Source repository of the fork repository.

Constraints:

N/A.

uuid

String

Definition:

Unique repository identifier.

Constraints:

N/A.

ancestor_ids

Array of integers

Definition:

Ancestor repository ID list.

Constraints:

N/A.

Value range:

1~2147483647

ancestor_names

Array of strings

Definition:

Ancestor repository name list.

Constraints:

N/A.

import_status

String

Definition:

Import status.

Constraints:

N/A.

import_url

String

Definition:

Import source address.

Constraints:

N/A.

import_error

String

Definition:

Information that indicates the import is error.

Constraints:

N/A.

repo_type

String

Definition:

Repository type.

Constraints:

N/A.

only_allow_merge_if_pipeline_succeeds

Boolean

Definition:

Whether to merge only after the pipeline is successful.

Constraints:

N/A.

request_access_enabled

Boolean

Definition:

Whether to enable access requests.

Constraints:

N/A.

only_allow_merge_if_all_discussions_are_resolved

Boolean

Definition:

Whether to merge only after all review comments are confirmed.

Constraints:

N/A.

merge_method

String

Definition:

Merging method.

Constraints:

N/A.

fork_network_repositories

Array of RepositoryIdentityDto objects

Definition:

List of associated fork repositories.

Constraints:

N/A.

permissions

PermissionsDto object

Permission.

repository_type

String

Definition:

Repository type.

Constraints:

N/A.

statistics

RepositoryStatisticsDto object

Definition:

Project statistics.

Constraints:

N/A.

branch_count

Integer

Definition:

Number of branches.

Constraints:

N/A.

Value range:

1~2147483647

tag_count

Integer

Definition:

Number of tags.

Constraints:

N/A.

Value range:

1~2147483647

label_count

Integer

Definition:

Number of tags.

Constraints:

N/A.

Value range:

1~2147483647

member_count

Integer

Definition:

Number of members.

Constraints:

N/A.

Value range:

1~2147483647

Table 4 NamespaceBasicDto

Parameter

Type

Description

id

Integer

Definition:

Namespace ID.

Constraints:

N/A.

Value range:

1~2147483647

name

String

Definition:

Namespace name.

Constraints:

N/A.

path

String

Definition:

Path.

Constraints:

N/A.

develop_mode

String

Definition:

Development mode.

Constraints:

N/A.

kind

String

Definition:

Type.

Constraints:

N/A.

full_path

String

Definition:

Complete path.

Constraints:

N/A.

full_name

String

Definition:

Full name.

Constraints:

N/A.

parent_id

Integer

Definition:

Parent ID.

Constraints:

N/A.

Value range:

1~2147483647

visibility_level

Integer

Definition:

Visibility level.

Constraints:

N/A.

Value range:

1~2147483647

enable_file_control

Boolean

Definition:

This API is used to enable file permission control.

Constraints:

N/A.

owner_id

Integer

Definition:

Owner ID

Constraints:

N/A.

Value range:

1~2147483647

Table 5 RepositoryUserBasicDto

Parameter

Type

Description

id

Integer

Definition:

User ID.

Constraints:

N/A.

Value range:

1~2147483647

name

String

Definition:

Username.

Constraints:

N/A.

username

String

Definition:

Username.

Constraints:

N/A.

state

String

Definition:

User status

Value range:

  • active: activated

  • blocked: disabled

Enumeration values:

  • active

  • blocked

service_license_status

Integer

Definition:

Service-level permission status. 0: Disabled; 1: Enabled.

Constraints:

N/A.

Value range:

1~2147483647

name_cn

String

Definition:

Username in Chinese.

Constraints:

N/A.

nick_name

String

Definition:

User alias.

Constraints:

N/A.

tenant_name

String

Definition:

Tenant name.

Constraints:

N/A.

Table 6 RepositorySimpleDto

Parameter

Type

Description

id

Integer

Definition:

Repository ID.

Value range:

1~2147483647

description

String

Definition:

Repository description.

name

String

Definition:

Repository name.

name_with_namespace

String

Definition:

Repository full name.

path

String

Definition:

Repository path.

path_with_namespace

String

Definition:

Complete repository path.

created_at

String

Definition:

Creation time.

updated_at

String

Definition:

Update time.

archived

Boolean

Definition:

Archived or not.

ssh_url_to_repo

String

Definition:

Repository SSH address.

http_url_to_repo

String

Definition:

HTTP address of the repository.

project_id

String

Definition:

Repository project ID.

project_name

String

Definition:

Repository project name.

develop_mode

String

Definition:

Repository development mode.

Value range:

  • normal

  • CR

Enumeration values:

  • normal

  • CR

moderation_result

Boolean

Definition:

Review status.

Table 7 RepositoryIdentityDto

Parameter

Type

Description

id

Integer

Definition:

Project ID.

Constraints:

N/A.

Value range:

1~2147483647

path_with_namespace

String

Definition:

Project path.

Constraints:

N/A.

Table 8 PermissionsDto

Parameter

Type

Description

repository_access

MemberAccess object

Definition:

Repository permission.

Constraints:

N/A.

group_access

MemberAccess object

Definition:

Repository group permission.

Constraints:

N/A.

Table 9 MemberAccess

Parameter

Type

Description

access_level

Integer

Definition:

Access level.

Constraints:

N/A.

Value range:

1~2147483647

notification_level

Integer

Definition:

Notification level.

Constraints:

N/A.

Value range:

1~2147483647

Table 10 RepositoryStatisticsDto

Parameter

Type

Description

commit_count

Integer

Definition:

Commits.

Constraints:

N/A.

Value range:

1~2147483647

storage_size

Double

Definition:

Storage size.

Constraints:

N/A.

Value range:

1.0~1024000.0

repository_size

Double

Definition:

Repository size.

Constraints:

N/A.

Value range:

1.0~1024000.0

lfs_objects_size

Double

Definition:

Size of the LFS object.

Constraints:

N/A.

Value range:

1.0~1024000.0

tenant_repo_size_limit

Long

Definition:

Limit of the tenant repository size.

Constraints:

N/A.

Value range:

1~2147483647

Example Requests

None

Example Responses

Status code: 200

Obtain the details about a repository.

{
  "id" : 2111993598,
  "description" : null,
  "name" : "test_import",
  "name_with_namespace" : "22d9c8e7fe464697bc2a358df175dd29 / g111 / g22 / g3 / g4 / g5 / test_import",
  "path" : "test_import",
  "path_with_namespace" : "22d9c8e7fe464697bc2a358df175dd29/g111/g22/g3/g4/g5/test_import",
  "created_at" : "2025-01-14T20:13:56.000+08:00",
  "updated_at" : "2025-01-14T20:13:56.000+08:00",
  "archived" : false,
  "ssh_url_to_repo" : "git@repo.com:22d9c8e7fe464697bc2a358df175dd29/g111/g22/g3/g4/g5/test_import.git",
  "http_url_to_repo" : "https://repo.com/22d9c8e7fe464697bc2a358df175dd29/g111/g22/g3/g4/g5/test_import.git",
  "project_id" : "22d9c8e7fe464697bc2a358df175dd29",
  "project_name" : "SubscriptionTest",
  "develop_mode" : "normal",
  "moderation_result" : true,
  "default_branch" : "master",
  "star_count" : 0,
  "forks_count" : 0,
  "open_merge_requests_count" : 0,
  "last_activity_at" : "2025-01-14T20:13:56.000+08:00",
  "namespace" : {
    "id" : 2111853526,
    "name" : "g5",
    "path" : "g5",
    "develop_mode" : "normal",
    "kind" : "group",
    "full_path" : "22d9c8e7fe464697bc2a358df175dd29/g111/g22/g3/g4/g5",
    "full_name" : null,
    "parent_id" : 2111853525,
    "visibility_level" : 0,
    "enable_file_control" : null,
    "owner_id" : null
  },
  "empty_repo" : false,
  "starred" : false,
  "visibility" : "private",
  "security" : "internal",
  "owner" : { },
  "creator" : {
    "id" : 9124,
    "name" : "test_user",
    "username" : "c369c68f1ff84679b5a8ed904d8bff1c",
    "state" : "active",
    "service_license_status" : null,
    "name_cn" : "test_user",
    "nick_name" : "beta_dv",
    "tenant_name" : "test_tenant"
  },
  "creator_id" : 9124,
  "statistics" : { },
  "branch_count" : 2,
  "tag_count" : 0,
  "member_count" : 8,
  "import_status" : "none",
  "import_url" : "https://gitee.com/api-review-test-group/return-test.git",
  "import_error" : null,
  "repo_type" : "normal",
  "only_allow_merge_if_pipeline_succeeds" : false,
  "only_allow_merge_if_all_discussions_are_resolved" : false,
  "merge_method" : "merge",
  "fork_network_repositories" : [ ],
  "permissions" : {
    "repository_access" : {
      "access_level" : 50,
      "notification_level" : 3
    },
    "group_access" : {
      "access_level" : 50,
      "notification_level" : 3
    }
  },
  "repository_type" : null,
  "uuid" : "b166cca9cf9442a0b82159769d6aec4c",
  "ancestor_ids" : [ 2111851014, 2111853523, 2111853524, 2111853525, 2111853526 ],
  "ancestor_names" : [ "g111", "g22", "g3", "g4", "g5" ]
}

Status Codes

Status Code

Description

200

Obtain the details about a repository.

Error Codes

See Error Codes.