Help Center/ CodeArts Repo/ API Reference/ APIs/ V4/ MergeRequest/ Obtaining the Status of a Merge Request
Updated on 2026-01-27 GMT+08:00

Obtaining the Status of a Merge Request

Function

This API is used to obtain the status of a merge request.

Debugging

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

Authorization Information

Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

codeartsrepo:repository:getMergeRequest

Read

-

-

-

-

URI

GET https://{hostURL}/v4/repositories/{repository_id}/merge-requests/{merge_request_iid}/mergeable-state-out

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

Default Value

N/A

Value range:

1~2147483647

merge_request_iid

Yes

Integer

Definition

MR internal ID (IID).

Value range:

1~2147483647

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

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

Constraints

N/A

Range

1–100,000 characters.

Default Value

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

merge_request_id

Integer

Definition

MR ID.

Value range:

0~2147483647

state

Boolean

Definition

Mergeable status of an MR.

Constraints

  • true: an MR can be merged.

  • false: an MR cannot be merged.

conflict_passed

Boolean

Definition

Whether the MR conflict gate passes the check.

Constraints

  • true: no conflict exists.

  • false: conflicts exist.

non_ff_passed

Boolean

Definition

Whether to rebase an MR.

Constraints

  • true: not to rebase the MR.

  • false: rebase the MR.

merged_by_user_passed

Boolean

Definition

Whether the current user has the permission to merge the current MR.

Constraints

  • true: user has the permission to merge the MR.

  • false: user does not have the permission to merge the MR.

work_in_progress_passed

Boolean

Definition

Whether the MR WIP gate check is passed.

Constraints

  • true: non-WIP status.

  • false: WIP status.

resolve_discussion_passed

Boolean

Definition

Whether the MR review comment gate check is passed.

Constraints

  • true: review comment gate check is passed.

  • false: review comment gate check is not passed.

ci_state_passed

Boolean

Definition

Whether the MR pipeline gate is passed.

Constraints

  • true: the MR pipeline gate is passed.

  • false: the MR pipeline gate is not passed.

merge_by_self_passed

Boolean

Definition

Whether the current user has the permission to merge the self-created MR.

Constraints

  • true: An MR that is not self-created can be merged.

  • false: A self-created MR cannot be merged.

can_force_merge

Boolean

Definition

Whether the current user can forcibly merge the current MR.

Constraints

  • true: user can forcibly merge the MR.

  • false: user cannot forcibly merge the MR.

vote_passed

Boolean

Definition

Whether the MR scoring gate check is passed.

Constraints

  • true: the scoring gate check is passed.

  • false: the scoring gate check is not passed.

e2e_check_passed

Boolean

Definition

Whether the gate check indicating an MR must be associated with CodeArts Req is passed.

Constraints

  • true: the gate check indicating an MR must be associated with CodeArts Req is passed.

  • false: the gate check indicating an MR must be associated with CodeArts Req is not passed.

all_issues_passed

Boolean

Definition

Whether the gate check for all E2E ticket number verification of an MR is passed.

Constraints

  • true: the gate check for all E2E ticket number verification of an MR is passed.

  • false: the gate check for all E2E ticket number verification of an MR is not passed.

only_one_issue_passed

Boolean

Definition

Whether the gate check indicating an MR can only be associated with one ticket number is passed.

Constraints

  • true, the gate check indicating an MR can only be associated with one ticket number is passed.

  • false, the gate check indicating an MR can only be associated with one ticket number is not passed.

approval_reviewers_required_passed

Boolean

Definition

Whether the gate check for an MR review is passed.

Constraints

  • true: the gate check for an MR review is passed.

  • false: MR review gate check is not passed.

approval_approvers_required_passed

Boolean

Definition

Whether an MR approving gate check is passed.

Constraints

  • true: MR approving gate check is passed.

  • false: MR approving gate check is not passed.

evaluation_passed

Boolean

Definition

Whether the MR score evaluation gate check is passed.

Constraints

  • true: the MR score evaluation gate check is passed.

  • false: the MR score evaluation gate check is not passed.

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: 404

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Definition

Error code.

error_msg

String

Definition

Error message.

Example Requests

GET https://{endpoint}/v4/repositories/1/merge-requests/1/mergeable-state-out

Example Responses

Status code: 200

OK

{
  "merge_request_id" : 1,
  "state" : true,
  "conflict_passed" : true,
  "non_ff_passed" : true,
  "merged_by_user_passed" : true,
  "work_in_progress_passed" : true,
  "resolve_discussion_passed" : true,
  "ci_state_passed" : true,
  "merge_by_self_passed" : true,
  "can_force_merge" : true,
  "vote_passed" : true,
  "e2e_check_passed" : true,
  "all_issues_passed" : true,
  "only_one_issue_passed" : true,
  "approval_reviewers_required_passed" : true,
  "approval_approvers_required_passed" : true,
  "evaluation_passed" : true
}

Status code: 401

Unauthorized

{
  "error_code" : "CH.00000002",
  "error_msg" : "Recognize authentication information failed."
}

Status code: 404

Not Found

{
  "error_code" : "CH.00402000",
  "error_msg" : "The repository does not exist. Check and try again."
}

Status Codes

Status Code

Description

200

OK

401

Unauthorized

404

Not Found

Error Codes

See Error Codes.