Help Center/ CodeArts Repo/ API Reference/ APIs/ V4/ Project/ Obtaining Basic Settings of a Specified Project
Updated on 2026-04-28 GMT+08:00

Obtaining Basic Settings of a Specified Project

Function

This API is used to obtain basic settings of a specified project.

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/projects/{project_id}/policies/general

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition:

You can obtain the unique project identifier, 32-character UUID, by calling the API used to query the project list.

Value range:

32 characters

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

disable_fork

Boolean

Definition

Whether to disable fork.

forbidden_developer_create_branch

Boolean

Definition

Whether to forbid developers to create branches.

forbidden_developer_create_tag

Boolean

Definition

Whether to forbid developers to create tags.

forbidden_committer_create_branch

Boolean

Definition

Developers are not allowed to create tags.

branch_name_regex

String

Definition

Regular expression of the branch name.

Range

1–1,000 characters.

tag_name_regex

String

Definition

Regular expression of the tag name.

Range

1–1,000 characters.

generate_pre_merge_ref

Boolean

Definition

Generate a merge request for pre-merging.

forbidden_gitlab_access

Boolean

Definition

Whether to forbid repo access.

rebase_disable_trigger_webhook

Boolean

Definition

Whether to forbid the MR rebase to trigger the webhook event.

open_gpg_verified

Boolean

Definition

Whether to enable GPG public key authentication.

Status code: 401

Table 4 Response body parameters

Parameter

Type

Description

error_code

String

Definition

Error code.

error_msg

String

Definition

Error message.

Status code: 403

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Definition

Error code.

error_msg

String

Definition

Error message.

Status code: 404

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Definition

Error code.

error_msg

String

Definition

Error message.

Example Requests

GET https://{endpoint}/v4/projects/{project_id}/policies/general

Example Responses

Status code: 200

Obtain basic settings of a specified project.

{
  "disable_fork" : false,
  "forbidden_developer_create_branch" : false,
  "forbidden_developer_create_tag" : false,
  "forbidden_committer_create_branch" : null,
  "branch_name_regex" : null,
  "tag_name_regex" : null,
  "generate_pre_merge_ref" : false,
  "forbidden_gitlab_access" : null,
  "rebase_disable_trigger_webhook" : null,
  "open_gpg_verified" : null
}

Status code: 401

Unauthorized

{
  "error_code" : "DEV.00000003",
  "error_msg" : "Authentication information expired."
}

Status code: 403

Bad Request

{
  "error_code" : "CH.004403",
  "error_msg" : "Insufficient permissions. Apply for the required permissions and try again."
}

Status code: 404

Not Found

{
  "error_code" : "CH.004404",
  "error_msg" : "Project Not Found. Project Not Found"
}

Status Codes

Status Code

Description

200

Obtain basic settings of a specified project.

401

Unauthorized

403

Bad Request

404

Not Found

Error Codes

See Error Codes.