Skip to content

Merge Requests


JSON Object Structure Description for Merge Request

Field Type Description
id String Unique merge request ID
localId Long Local merge request ID
description String Merge request description
title String Merge request title
removeSourceBranch Boolean Remove source branch after merge request is accepted: true or not: false
squashCommit Boolean Merge as a single commit: true or not: false
assignedUsers List(Object) List of assigned users for the merge request
reviewers List(Object) List of reviewers users for the merge request
labels List(Object) List of labels assigned to the merge request
sourceBranch Object Branch from which the merge request will be made
targetBranch Object Branch into which the merge request will be made
status Object Merge request status
createdBy Object Author of the merge request
createdAt ZonedDateTime Merge request creation date
updatedAt ZonedDateTime Last update date of the merge request
sourceProject Object Project from which the merge request is made
targetProject Object Project for which the merge request is made
projectAlias String Project alias
userAlias String Author alias
canMerge Boolean Merge can be performed: true or not: false
hasConflicts Boolean Merge request has conflicts: true or not: false
hasLockConflicts Boolean Merge request has locked file conflicts: true or not: false
conflicts List List of conflicting files
lockConflicts List List of locked conflicting files
mergeCommit Object Commit created after merging

JSON Object Structure Description for Merge Request Approval Rule

Learn more about merge request approval rules here.

Field Type Description
targetBranch String Target branch for which this approval rule applies
name String Approval rule name
minimalApprovals Integer Minimum number of responsible users required to approve the merge request
allowedApprovers Array Array of users who are responsible in this approval rule
uuid String Approval rule UUID

JSON Object Structure Description for Approver in Merge Request Approval Rule

Field Type Description
id String Merge request UUID
username String User alias
name String User first name
surname String User last name
fullName String Full user name - first and last name. Returns alias if name and surname are not specified
avatar String Link to user avatar
cover String Link to user profile cover

JSON Object Structure Description for Merge Request Settings

Learn more about merge request settings here.

Field Type Description
canOverrideApprovals Boolean If true, the setting Can override approvers and approvals required for merge request is active
removeApprovalsOnPush Boolean If true, the setting Remove all approvals in merge request when a new commit is pushed to source branch is active
preventAuthorApproving Boolean If true, the setting Prevent author from approving their own merge request is active
preventCommitterApproving Boolean If true, the setting Prevent developers from approving their own merge request is active
checkCiCdStatus Boolean If true, the setting Check last pipeline status when merging request is active
mergeResultPipelineStatusCheckEnabled Boolean If true, the setting Check merge result pipeline status is active
mergeRequestPipelineStatusCheckEnabled Boolean If true, the setting Check merge request pipeline status is active
branchPipelineStatusCheckEnabled Boolean If true, the setting Check branch pipeline status is active
editMergedMergeRequest Boolean If true, the setting Allow editing merged merge request is active
removeApprovalsOnChangingTargetBranch Boolean If true, the setting Remove all approvals in merge request when changing target branch is active
enableRemoveSourceBranchByDefault Boolean If true, the setting Option "Remove branch after merge" is enabled by default is active

JSON Object Structure Description for Merge Message Templates

Learn more about merge message templates here.

Field Type Description
mergeCommitMessage String Merge commit message template
squashCommitMessage String Squash commit message template
mergeRequestDescriptionTemplate String Merge request description template
canEditMergeCommitMessage Boolean If true, the option Allow editing template messages during merge is active

Method to Get All Merge Requests

GET /project/{ownerAlias}/{projectAlias}/merge-request/list

Returns an array of merge requests, with options to configure pagination

Path Variable Type Description
ownerAlias String Project owner's alias
projectAlias String Project alias

Responses

STATUS 200 - List of merge requests successfully returned.

Example response
    
{ ... }
    
  

STATUS 403 - Access denied.

STATUS 404 - Data not found.


Method to Get Merge Request by Local ID

GET /project/{ownerAlias}/{projectAlias}/merge-request/{localId}

Returns a merge request by its local ID

Path Variable Type Description
ownerAlias String Project owner's alias
projectAlias String Project alias
localId Long Local merge request ID

Responses

STATUS 200 - Merge request successfully returned.

Example response
    
{ ... }
    
  

STATUS 403 - Access denied.

STATUS 404 - Data not found.


Method to Get Merge Requests by Commit

GET /project/{ownerAlias}/{projectAlias}/merge-request/commit?commit={commitHash}&status={mergeRequestStatus}

Returns a list of merge requests where the specified commit hash is present in source or target branches. You can also filter by merge request status and configure pagination.

Path Variable Type Description
ownerAlias String Project owner's alias
projectAlias String Project alias
commitHash String Required. Commit hash present in source or target branch
mergeRequestStatus String Optional. Merge request status. Possible values: OPENED, MERGED, CLOSED, CANCELED, FAILED

Responses

STATUS 200 - List of merge requests with specified commit successfully returned.

Example response
    
{ ... }
    
  

STATUS 403 - Access denied.

STATUS 404 - Data not found.


Method to Create a New Merge Request

POST /project/{ownerAlias}/{projectAlias}/merge-request

Creates a merge request

Path Variable Type Description
ownerAlias String Project owner's alias
projectAlias String Project alias

Request

Supported format: JSON

POST request body structure:

Parameter Description
title Merge request title
description Merge request description
sourceBranch Source branch
targetBranch Target branch
sourceProject Source project
targetProject Target project
squashCommit Merge as a single commit: true or not: false. Optional parameter
removeSourceBranch Remove source branch after merge request is accepted: true or not: false. Optional parameter

Example JSON object

{
    "title": "test4",
    "description": "test4",
    "sourceBranch": { "id": "new_branch" },
    "targetBranch": { "id": "master" },
    "sourceProject": { "id": "4eeae220-aaaa-aaaa-aaaa-85ff50ee88c1" },
    "targetProject": { "id": "4eeae220-aaaa-aaaa-aaaa-85ff50ee88c1" },
    "squashCommit": true,
    "removeSourceBranch": true
}

Responses

STATUS 200 - Merge request successfully created.

Example response
    
{ ... }
    
  

STATUS 403 - Access denied.

STATUS 404 - Data not found.


Method to Edit a Merge Request

PUT /project/{ownerAlias}/{projectAlias}/merge-request

Edits a merge request

Path Variable Type Description
ownerAlias String Project owner's alias
projectAlias String Project alias

Request

Supported format: JSON

Parameter Description
id Merge request ID to edit
title Merge request title
description Merge request description
sourceBranch Source branch
targetBranch Target branch
sourceProject Source project
targetProject Target project
squashCommit Merge as a single commit: true or not: false. Optional parameter
removeSourceBranch Remove source branch after merge request is accepted: true or not: false. Optional parameter

Example JSON object

{
    "id": "d8a1e1e7-aaaa-aaaa-aaaa-3dc1a9f327b5",
    "title": "test4",
    "description": "test4",
    "sourceBranch": { "id": "new_branch" },
    "targetBranch": { "id": "master" },
    "sourceProject": { "id": "4eeae220-aaaa-aaaa-aaaa-85ff50ee88c1" },
    "targetProject": { "id": "4eeae220-aaaa-aaaa-aaaa-85ff50ee88c1" },
    "squashCommit": true,
    "removeSourceBranch": true
}

Responses

STATUS 200 - Merge request successfully edited.

Example response
    
{ ... }
    
  

STATUS 403 - Access denied.

STATUS 404 - Data not found.


Method to Approve a Merge Request

POST /project/{ownerAlias}/{projectAlias}/merge-request/{localId}/approve

Approves a merge request on behalf of the authorized user. If already approved, approval is removed.

Path Variable Type Description
ownerAlias String Project owner's alias
projectAlias String Project alias
localId Long Local merge request ID

Responses

This request returns a unique approved parameter

Field Type Description
approved Boolean Merge request approved by current user: true or not: false

STATUS 200 - Merge request successfully approved.

Example response
    
{ ... }
    
  

STATUS 403 - Access denied.

STATUS 404 - Data not found.


Method to Merge a Merge Request

POST /project/{ownerAlias}/{projectAlias}/merge-request/{localId}/merge

Performs a merge request

Path Variable Type Description
ownerAlias String Project owner's alias
projectAlias String Project alias
localId Long Local merge request ID

Request

Supported format: JSON

Parameter Type Description
commitMessage String Optional. Merge commit message
squashCommitMessage String Optional. Squash commit message

Example JSON object

If not using optional parameters, send an empty request body.

{
    "commitMessage": "Merge commit message",
    "squashCommitMessage": "Squash commit message"
}
Responses

STATUS 200 - Merge request successfully merged.

Example response
    
{ ... }
    
  

STATUS 403 - Access denied.

STATUS 404 - Data not found.


Method to Close a Merge Request

POST /project/{ownerAlias}/{projectAlias}/merge-request/{localId}/close

Closes a merge request

Path Variable Type Description
ownerAlias String Project owner's alias
projectAlias String Project alias
localId Long Local merge request ID

Responses

STATUS 200 - Merge request successfully closed.

Example response
    
{ ... }
    
  

STATUS 403 - Access denied.

STATUS 404 - Data not found.


Method to Cancel a Merge Request

POST /project/{ownerAlias}/{projectAlias}/merge-request/{localId}/cancel

Cancels a merge request

Path Variable Type Description
ownerAlias String Project owner's alias
projectAlias String Project alias
localId Long Local merge request ID

Responses

STATUS 200 - Merge request successfully canceled.

Example response
    
{ ... }
    
  

STATUS 403 - Access denied.

STATUS 404 - Data not found.


Methods for Merge Request Settings

Method to Get All Merge Request Approval Rules

Available in Enterprise version and on gitflic.ru

Companies: GET /company/{companyAlias}/merge-request/approval/rule

Teams: GET /team/{teamAlias}/merge-request/approval/rule

Returns a list of merge request approval rules for the specified entity, with pagination options.

Path Variable Type Description
companyAlias String Company alias
teamAlias String Team alias

Responses

STATUS 200 - List of merge request approval rules successfully returned:

Example response
    
{ ... }
    
  

STATUS 403 - Access denied.

STATUS 404 - Data not found.


Method to Get Merge Request Approval Rule

Available in Enterprise version and on gitflic.ru

Companies: GET /company/{companyAlias}/merge-request/approval/rule/{approvalRuleUuid}

Teams: GET /team/{teamAlias}/merge-request/approval/rule/{approvalRuleUuid}

Returns a merge request approval rule for the specified entity.

Path Variable Type Description
companyAlias String Company alias
teamAlias String Team alias
approvalRuleUuid String Merge request approval rule UUID

Responses

STATUS 200 - Merge request approval rule successfully returned:

Example response
    
{ ... }
    
  

STATUS 403 - Access denied.

STATUS 404 - Data not found.


Method to Create Merge Request Approval Rule

Available in Enterprise version and on gitflic.ru

Companies: POST /company/{companyAlias}/merge-request/approval/rule/create

Teams: POST /team/{teamAlias}/merge-request/approval/rule/create

Creates and returns a merge request approval rule for the specified entity.

Path Variable Type Description
companyAlias String Company alias
teamAlias String Team alias

Request

Supported format: JSON

POST request body structure:

Field Type Description
targetBranch String Target branch for which this approval rule applies
name String Approval rule name
minimalApprovals Integer Minimum number of responsible users required to approve the merge request. Must not exceed number of users in allowedApproversUuid
allowedApproversUuid Array Array of UUIDs of users who must be responsible in this approval rule

Example JSON object

{
    "targetBranch": "master",
    "name": "master branch",
    "minimalApprovals": "2",
    "allowedApproversUuid": ["1757a1b5-aaaa-aaaa-aaaa-764a60303236", "6736240a-aaaa-aaaa-aaaa-cab026562172"]
}

Responses

STATUS 200 - Merge request approval rule successfully created:

Example response
    
{ ... }
    
  

STATUS 403 - Access denied.

STATUS 404 - Data not found.

STATUS 422 - Required field missing in request body.


Method to Edit Merge Request Approval Rule

Available in Enterprise version and on gitflic.ru

Companies: PATCH /company/{companyAlias}/merge-request/approval/rule/edit

Teams: PATCH /team/{teamAlias}/merge-request/approval/rule/edit

Edits and returns a merge request approval rule for the specified entity.

Path Variable Type Description
companyAlias String Company alias
teamAlias String Team alias

Request

Supported format: JSON

PATCH request body structure:

Field Type Description
uuid String Required. UUID of the merge request approval rule to edit
targetBranch String Target branch for which this approval rule applies
name String Approval rule name
minimalApprovals Integer Minimum number of responsible users required to approve the merge request. Must not exceed number of users in allowedApproversUuid
allowedApproversUuid Array Array of UUIDs of users who must be responsible in this approval rule

Example JSON object

{
    "targetBranch": "master",
    "name": "master branch",
    "minimalApprovals": "2",
    "allowedApproversUuid": ["1757a1b5-aaaa-aaaa-aaaa-764a60303236", "6736240a-aaaa-aaaa-aaaa-cab026562172"]
}

Responses

STATUS 200 - Merge request approval rule successfully edited:

Example response
    
{ ... }
    
  

STATUS 403 - Access denied.

STATUS 404 - Data not found.

STATUS 422 - Required field missing in request body.


Method to Delete Merge Request Approval Rule

Available in Enterprise version and on gitflic.ru

Companies: DELETE /company/{companyAlias}/merge-request/approval/rule/{approvalRuleUuid}

Teams: DELETE /team/{teamAlias}/merge-request/approval/rule/{approvalRuleUuid}

Deletes a merge request approval rule for the specified entity.

Path Variable Type Description
companyAlias String Company alias
teamAlias String Team alias

Responses

STATUS 204 - Merge request approval rule successfully deleted.

STATUS 403 - Access denied.

STATUS 404 - Data not found.


Method to Get All Merge Request Settings

Available in Enterprise version and on gitflic.ru

Companies: GET /company/{companyAlias}/merge-request/approval/configuration

Teams: GET /team/{teamAlias}/merge-request/approval/configuration

Returns a list of merge request settings for the specified entity.

Path Variable Type Description
companyAlias String Company alias
teamAlias String Team alias

Responses

STATUS 200 - Merge request settings successfully returned:

Example response
    
{ ... }
    
  

STATUS 403 - Access denied.

STATUS 404 - Data not found.


Method to Edit Merge Request Settings

Available in Enterprise version and on gitflic.ru

Companies: PATCH /company/{companyAlias}/merge-request/approval/configuration/edit

Teams: PATCH /team/{teamAlias}/merge-request/approval/configuration/edit

Edits merge request settings for the specified entity and returns them.

Path Variable Type Description
companyAlias String Company alias
teamAlias String Team alias

Request

Supported format: JSON

PATCH request body structure:

Field Type Description
canOverrideApprovals Boolean If true, the setting Can override approvers and approvals required for merge request is active
removeApprovalsOnPush Boolean If true, the setting Remove all approvals in merge request when a new commit is pushed to source branch is active
preventAuthorApproving Boolean If true, the setting Prevent author from approving their own merge request is active
preventCommitterApproving Boolean If true, the setting Prevent developers from approving their own merge request is active
checkCiCdStatus Boolean If true, the setting Check last pipeline status when merging request is active
mergeResultPipelineStatusCheckEnabled Boolean If true, the setting Check merge result pipeline status is active
mergeRequestPipelineStatusCheckEnabled Boolean If true, the setting Check merge request pipeline status is active
branchPipelineStatusCheckEnabled Boolean If true, the setting Check branch pipeline status is active
editMergedMergeRequest Boolean If true, the setting Allow editing merged merge request is active
removeApprovalsOnChangingTargetBranch Boolean If true, the setting Remove all approvals in merge request when changing target branch is active
enableRemoveSourceBranchByDefault Boolean If true, the setting Option "Remove branch after merge" is enabled by default is active

Example JSON object

{
    "canOverrideApprovals": true,
    "preventAuthorApproving": true,
    "preventCommitterApproving": true,
    "requirePasswordToApprove": false,
    "removeApprovalsOnPush": true,
    "checkCiCdStatus": true,
    "editMergedMergeRequest": true,
    "enableRemoveSourceBranchByDefault": true,
    "removeApprovalsOnChangingTargetBranch": true,
    "branchPipelineStatusCheckEnabled": true,
    "mergeRequestPipelineStatusCheckEnabled": true,
    "mergeResultPipelineStatusCheckEnabled": true
}

Responses

STATUS 200 - Merge request settings successfully edited:

Example response
    
{ ... }
    
  

STATUS 403 - Access denied.

STATUS 404 - Data not found.


Method to Get Squash Commit Rule

Available in Enterprise version and on gitflic.ru

Companies: GET /company/{companyAlias}/merge-request/merge-request-squash

Teams: GET /team/{teamAlias}/merge-request/merge-request-squash

Returns the value of squash commit rule for the specified entity.

Path Variable Type Description
companyAlias String Company alias
teamAlias String Team alias

Responses

STATUS 200 - Squash commit rule returned.

Response Squash Commit Squash commit rule description
DO_NOT_ALLOW Not allowed Squash commit will be unavailable, checkbox hidden.
ALLOW Allowed Squash commit available, checkbox visible and not selected by default.
ENCOURAGE Encouraged Squash commit available, checkbox visible and selected by default.
REQUIRE Required Squash commit available, checkbox visible and always selected, cannot be disabled.
Example response
    
"REQUIRE"
    
  

STATUS 403 - Access denied.

STATUS 404 - Data not found.


Method to Edit Squash Commit Rule

Available in Enterprise version and on gitflic.ru

Companies: GET /company/{companyAlias}/merge-request/merge-request-squash/edit

Teams: GET /team/{teamAlias}/merge-request/merge-request-squash/edit

Edits the value of squash commit rule for the specified entity and returns it.

Path Variable Type Description
companyAlias String Company alias
teamAlias String Team alias

Request

Supported format: JSON

POST request body structure:

Field Type Description
mergeRequestSquashSetting String Squash commit rule value. Possible values listed in the table below
Response Squash Commit Squash commit rule description
DO_NOT_ALLOW Not allowed Squash commit will be unavailable, checkbox hidden.
ALLOW Allowed Squash commit available, checkbox visible and not selected by default.
ENCOURAGE Encouraged Squash commit available, checkbox visible and selected by default.
REQUIRE Required Squash commit available, checkbox visible and always selected, cannot be disabled.

Example JSON object

{
    "mergeRequestSquashSetting": "REQUIRE"
}

Responses

STATUS 200 - Squash commit rule edited.

Example response
    
"REQUIRE"
    
  

STATUS 403 - Access denied.

STATUS 404 - Data not found.

STATUS 422 - Field mergeRequestSquashSetting missing or invalid value.


Method to Get Merge Method

Available in Enterprise version and on gitflic.ru

Companies: GET /company/{companyAlias}/merge-request/merge-request-method-type

Teams: GET /team/{teamAlias}/merge-request/merge-request-method-type

Returns the merge method for the specified entity.

Path Variable Type Description
companyAlias String Company alias
teamAlias String Team alias

Responses

STATUS 200 - Merge method returned.

Response Merge Method Merge method description
MERGE_COMMIT Merge Commit Each merge creates a merge commit.
MERGE_COMMIT_WITH_SEMI_LINEAR_HISTORY Semi-Linear history Each merge creates a merge commit. If merge is not possible due to outdated source branch, rebasing onto target branch is suggested.
FAST_FORWARD_MERGE Fast-Forward No merge commit is created. If merge is not possible due to outdated source branch, rebasing onto target branch is suggested.
Example response
    
"MERGE_COMMIT"
    
  

STATUS 403 - Access denied.

STATUS 404 - Data not found.


Method to Edit Merge Method

Available in Enterprise version and on gitflic.ru

Companies: GET /company/{companyAlias}/merge-request/merge-request-method-type/edit

Teams: GET /team/{teamAlias}/merge-request/merge-request-method-type/edit

Edits the merge method for the specified entity and returns it.

Path Variable Type Description
companyAlias String Company alias
teamAlias String Team alias

Request

Supported format: JSON

POST request body structure:

Field Type Description
mergedRequestMethodType String Selected merge method. Possible values listed in the table below
Response Merge Method Merge method description
MERGE_COMMIT Merge Commit Each merge creates a merge commit.
MERGE_COMMIT_WITH_SEMI_LINEAR_HISTORY Semi-Linear history Each merge creates a merge commit. If merge is not possible due to outdated source branch, rebasing onto target branch is suggested.
FAST_FORWARD_MERGE Fast-Forward No merge commit is created. If merge is not possible due to outdated source branch, rebasing onto target branch is suggested.

Example JSON object

{
    "mergedRequestMethodType": "MERGE_COMMIT"
}

Responses

STATUS 200 - Merge method returned.

Example response
    
"MERGE_COMMIT"
    
  

STATUS 403 - Access denied.

STATUS 404 - Data not found.

STATUS 422 - Field mergedRequestMethodType missing or invalid value.


Method to Get Merge Message Templates

Available in Enterprise version and on gitflic.ru

Companies: GET /company/{companyAlias}/merge-request/merge-request-template

Teams: GET /team/{teamAlias}/merge-request/merge-request-template

Returns merge message templates for the specified entity.

Path Variable Type Description
companyAlias String Company alias
teamAlias String Team alias

Responses

STATUS 200 - Merge message templates returned.

Example response
    
{ ... }
    
  

STATUS 403 - Access denied.

STATUS 404 - Data not found.


Method to Edit Merge Message Templates

Available in Enterprise version and on gitflic.ru

Companies: GET /company/{companyAlias}/merge-request/merge-request-template/edit

Teams: GET /team/{teamAlias}/merge-request/merge-request-template/edit

Edits merge message templates for the specified entity and returns them.

Path Variable Type Description
companyAlias String Company alias
teamAlias String Team alias

Request

Supported format: JSON

POST request body structure:

Field Type Description
mergeCommitMessage String Merge commit message template
squashCommitMessage String Squash commit message template
mergeRequestDescriptionTemplate String Merge request description template
canEditMergeCommitMessage Boolean If true, the option Allow editing template messages during merge is active

Example JSON object

{
    "mergeCommitMessage": "Message for merge commit",
    "squashCommitMessage": "Message for squash commit",
    "mergeRequestDescriptionTemplate": "Default text for merge request description",
    "canEditMergeCommitMessage": true
}

Responses

STATUS 200 - Merge message templates edited and returned.

Example response
    
{ ... }
    
  

STATUS 403 - Access denied.

STATUS 404 - Data not found.


Method to Apply Merge Request Settings to Projects

Available in Enterprise version and on gitflic.ru

Companies: POST /company/{companyAlias}/merge-request/apply-settings-to-projects

Teams: POST /team/{teamAlias}/merge-request/apply-settings-to-projects

Applies merge request settings to all projects of the specified entity.

Path Variable Type Description
companyAlias String Company alias
teamAlias String Team alias

Responses

STATUS 204 - Environment protection rules applied to all child projects.

STATUS 403 - Access denied.

STATUS 404 - Data not found.


Automated translation!

This page was translated using automatic translation tools. The text may contain inaccuracies.