CloseMergeRequest

Updated at:

Closes a specified merge request.

Operation description

This operation requires that the current organization is using the new version of merge requests. You can verify this by checking whether the merge request page of the current organization displays the new version.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST /api/v4/projects/{repositoryId}/merge_requests/{localId}/close HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

repositoryId

integer

Yes

The repository ID.

2369234

localId

integer

Yes

The local ID of the merge request, which indicates the sequence number of the merge request in the repository.

1

Request parameters

Parameter

Type

Required

Description

Example

organizationId

string

Yes

The organization identifier, also known as the organization ID. It is a string that can be obtained from the Yunxiao URL, such as https://devops.aliyun.com/organization/[OrganizationId].

5ebbc0228123212b59xxxxx

accessToken

string

No

The personal access token. This parameter is not required if you use an Alibaba Cloud AccessKey pair or Security Token Service (STS) for temporary authorization.

0cf2c8458ac44d9481aab2dd6ec10596v3

Response elements

Element

Type

Description

Example

object

Schema of Response

requestId

string

The request ID.

HC93CE1A-8D7A-13A9-8306-7465DE2E5C0F

errorMessage

string

The error message.

InvalidParam.NoPermission

errorCode

string

The error code.

SYSTEM_UNKNOWN_ERROR

success

boolean

Indicates whether the call was successful.

true

result

object

The returned result.

result

boolean

Indicates whether the merge request was closed successfully.

true

Examples

Success response

JSON format

{
  "requestId": "HC93CE1A-8D7A-13A9-8306-7465DE2E5C0F",
  "errorMessage": "InvalidParam.NoPermission",
  "errorCode": "SYSTEM_UNKNOWN_ERROR",
  "success": true,
  "result": {
    "result": true
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.