Skip to content

Merge Requests


Description of the JSON object structure describing a merge request

Field Type Description
id String Unique ID of the merge request
localId Long Local ID of the merge request
description String Description of the merge request
title String Title of the merge request
removeSourceBranch Boolean Remove the source branch after the merge request is accepted: true or not: false
squashCommit Boolean Merge with 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 assigned to 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 Status of the merge request
createdBy Object Author of the merge request
createdAt ZonedDateTime Date of creation of the merge request
updatedAt ZonedDateTime Date of last update 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 conflicting locked files
mergeCommit Object Commit resulting from the merge

Description of the JSON object structure describing a merge request approval rule

You can learn about merge request approval rules here.

Field Type Description
targetBranch String Target branch; merge requests to this branch will follow this approval rule
name String Name of the approval rule
minimalApprovals Integer Minimum number of responsible users who must approve the merge request
allowedApprovers Array Array of users who are responsible in this approval rule
uuid String UUID of the approval rule

Description of the JSON object structure describing an approver in a merge request approval rule

Field Type Description
id String UUID of the merge request
username String User alias
name String User's first name
surname String User's last name
fullName String Full name (first and last). Returns alias if first and last name are not specified
avatar String Link to user's avatar
cover String Link to user's profile cover

Description of the JSON object structure describing merge request settings

You can learn about merge request settings here.

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

Description of the JSON object structure describing merge message templates

You can learn about merge message templates here.

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

Method to get a list of all merge requests

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

The request returns an array of merge requests, with the ability 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
    
{
    "_embedded": {
        "mergeRequestModelList": [
            {
                "id": "767e5a4a-aaaa-aaaa-aaaa-f4d1fb6b5490",
                "localId": 3,
                "description": "test3",
                "title": "test3-description",
                "removeSourceBranch": false,
                "squashCommit": false,
                "assignedUsers": [
                    {
                        "id": "bc56d75f-aaaa-aaaa-aaaa-61ec6aae2019",
                        "username": "user",
                        "name": null,
                        "surname": null,
                        "fullName": "user",
                        "avatar": "https://gitflic.ru/upload/img/43258295-aaaa-aaaa-aaaa-8fc26bae3717.jpg"
                    }
                ],
                "reviewers": [
                    {
                        "id": "bc56d75f-aaaa-aaaa-aaaa-61ec6aae2019",
                        "username": "user",
                        "name": null,
                        "surname": null,
                        "fullName": "user",
                        "avatar": "https://gitflic.ru/upload/img/43258295-aaaa-aaaa-aaaa-8fc26bae3717.jpg"
                    }
                ],
                "labels": [
                    {
                        "id": "c9135ea3-aaaa-aaaa-aaaa-1ec3c61a5b6d",
                        "hexColor": "FCF300",
                        "title": "релиз",
                        "description": "Доработки готовые для релиза",
                        "isTextLight": false
                    }
                ],
                "sourceBranch": {
                    "id": "new_branch",
                    "title": "new_branch",
                    "hash": "8c9aa77d99b3c7aaaaaaaaaaaa370f4a36e0bc0a",
                    "alias": "8c9aa77d99b3c7aaaaaaaaaaaa421b14d31b6337",
                    "ownerAlias": null,
                    "color": null,
                    "hexColor": null,
                    "icon": null
                },
                "targetBranch": {
                    "id": "master",
                    "title": "master",
                    "hash": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
                    "alias": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
                    "ownerAlias": null,
                    "color": null,
                    "hexColor": null,
                    "icon": null
                },
                "status": {
                    "id": "OPENED",
                    "title": "В работе",
                    "hash": null,
                    "alias": null,
                    "ownerAlias": null,
                    "color": null,
                    "hexColor": null,
                    "icon": null
                },
                "createdBy": {
                    "id": "6736240a-aaaa-aaaa-aaaa-cab026562172",
                    "username": "user2",
                    "name": "name",
                    "surname": "surname",
                    "fullName": "name surname",
                    "avatar": "https://gitflic.ru/static/image/avatar.jpg"
                },
                "createdAt": "2022-05-03T16:25:53.830856Z",
                "updatedAt": "2022-05-03T16:25:53.830856Z",
                "sourceProject": {
                    "id": "4eeae220-aaaa-aaaa-aaaa-85ff50ee88c1",
                    "title": "test-project",
                    "hash": null,
                    "alias": "test-project",
                    "ownerAlias": "user2",
                    "color": null,
                    "hexColor": null,
                    "icon": null
                },
                "targetProject": {
                    "id": "4eeae220-aaaa-aaaa-aaaa-85ff50ee88c1",
                    "title": "test-project",
                    "hash": null,
                    "alias": "test-project",
                    "ownerAlias": "user2",
                    "color": null,
                    "hexColor": null,
                    "icon": null
                },
                "projectAlias": "test-project",
                "userAlias": "user2",
                "canMerge": false,
                "hasConflicts": false,
                "hasLockConflicts": null,
                "conflicts": null,
                "lockConflicts": null,
                "mergeCommit": null
            },
            {
                "id": "b9c534c9-aaaa-aaaa-aaaa-754e11af2eb0",
                "localId": 2,
                "description": "test2-desc",
                "title": "test2",
                "removeSourceBranch": false,
                "squashCommit": false,
                "assignedUsers": [],
                "reviewers": [],
                "labels": [],
                "sourceBranch": {
                    "id": "master",
                    "title": "master",
                    "hash": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
                    "alias": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
                    "ownerAlias": null,
                    "color": null,
                    "hexColor": null,
                    "icon": null
                },
                "targetBranch": {
                    "id": "master",
                    "title": "master",
                    "hash": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
                    "alias": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
                    "ownerAlias": null,
                    "color": null,
                    "hexColor": null,
                    "icon": null
                },
                "status": {
                    "id": "OPENED",
                    "title": "В работе",
                    "hash": null,
                    "alias": null,
                    "ownerAlias": null,
                    "color": null,
                    "hexColor": null,
                    "icon": null
                },
                "createdBy": {
                    "id": "6736240a-aaaa-aaaa-aaaa-cab026562172",
                    "username": "user2",
                    "name": "name",
                    "surname": "surname",
                    "fullName": "name surname",
                    "avatar": "https://gitflic.ru/static/image/avatar.jpg"
                },
                "createdAt": "2022-04-20T14:08:10.381743Z",
                "updatedAt": "2022-04-20T14:08:10.384743Z",
                "sourceProject": {
                    "id": "4eeae220-aaaa-aaaa-aaaa-85ff50ee88c1",
                    "title": "test-project",
                    "hash": null,
                    "alias": "test-project",
                    "ownerAlias": "user2",
                    "color": null,
                    "hexColor": null,
                    "icon": null
                },
                "targetProject": {
                    "id": "4eeae220-aaaa-aaaa-aaaa-85ff50ee88c1",
                    "title": "test-project",
                    "hash": null,
                    "alias": "test-project",
                    "ownerAlias": "user2",
                    "color": null,
                    "hexColor": null,
                    "icon": null
                },
                "projectAlias": "test-project",
                "userAlias": "user2",
                "canMerge": false,
                "hasConflicts": false,
                "hasLockConflicts": null,
                "conflicts": null,
                "lockConflicts": null,
                "mergeCommit": null
            }
        ]
    },
    "page": {
        "size": 10,
        "totalElements": 2,
        "totalPages": 1,
        "number": 0
    }
}
    
  

STATUS 403 - No access rights.

STATUS 404 - Data not found.


Method to get a merge request by local id

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

The request 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 ID of the merge request

Responses

STATUS 200 - Merge request successfully returned.

Example response
    
{
                "id": "a306ecf4-aaaa-aaaa-aaaa-25b206b7e8b7",
                "localId": 1,
                "description": "test2-new",
                "title": "test2-new",
                "removeSourceBranch": false,
                "squashCommit": false,
                "assignedUsers": [],
                "reviewers": [],
                "labels": [],
                "sourceBranch": {
                    "id": "master",
                    "title": "master",
                    "hash": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
                    "alias": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
                    "ownerAlias": null,
                    "color": null,
                    "hexColor": null,
                    "icon": null
                },
                "targetBranch": {
                    "id": "master",
                    "title": "master",
                    "hash": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
                    "alias": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
                    "ownerAlias": null,
                    "color": null,
                    "hexColor": null,
                    "icon": null
                },
                "status": {
                    "id": "CANCELED",
                    "title": "Отменен",
                    "hash": null,
                    "alias": null,
                    "ownerAlias": null,
                    "color": null,
                    "hexColor": null,
                    "icon": null
                },
                "createdBy": {
                    "id": "6736240a-aaaa-aaaa-aaaa-cab026562172",
                    "username": "user2",
                    "name": "name",
                    "surname": "surname",
                    "fullName": "name surname",
                    "avatar": "https://gitflic.ru/static/image/avatar.jpg"
                },
                "createdAt": "2022-04-20T13:56:00.250341Z",
                "updatedAt": "2022-04-20T14:13:37.491826Z",
                "sourceProject": {
                    "id": "4eeae220-aaaa-aaaa-aaaa-85ff50ee88c1",
                    "title": "test-project",
                    "hash": null,
                    "alias": "test-project",
                    "ownerAlias": "user2",
                    "color": null,
                    "hexColor": null,
                    "icon": null
                },
                "targetProject": {
                    "id": "4eeae220-aaaa-aaaa-aaaa-85ff50ee88c1",
                    "title": "test-project",
                    "hash": null,
                    "alias": "test-project",
                    "ownerAlias": "user2",
                    "color": null,
                    "hexColor": null,
                    "icon": null
                },
                "projectAlias": "test-project",
                "userAlias": "user2",
                "canMerge": false,
                "hasConflicts": false,
    "hasLockConflicts": null,
    "conflicts": null,
    "lockConflicts": null,
    "mergeCommit": null
}
    
  

STATUS 403 - No access rights.

STATUS 404 - Data not found.


Method to get a list of merge requests with a specific commit

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

The request returns a list of merge requests whose source or target branches contain the specified commit hash. You can also search by merge request status and configure pagination.

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

Responses

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

Example response
    
{
    "_embedded": {
        "mergeRequestModelList": [
            {
                "id": "e1e1aeab-aaaa-aaaa-aaaa-1e9e7fcebb26",
                "localId": 161,
                "description": "Правки ссылок",
                "title": "Правки ссылок",
                "removeSourceBranch": true,
                "squashCommit": true,
                "assignedUsers": [
                    {
                        "id": "637fcdb6-aaaa-aaaa-aaaa-1af82abc7dd6",
                        "username": "gitflic_user",
                        "name": "gitflic",
                        "surname": "user",
                        "fullName": "gitflic user",
                        "avatar": "https://gitflic.ru/upload/img/06e7ab2e-aaaa-aaaa-aaaa-da8f5d956c22.jpg"
                    }
                ],
                "reviewers": [
                    {
                        "id": "710014c8-aaaa-aaaa-aaaa-11879e51e437",
                        "username": "gitflic_user",
                        "name": "gitflic",
                        "surname": "user",
                        "fullName": "gitflic user",
                        "avatar": "https://gitflic.ru/upload/img/d48d9701-aaaa-aaaa-aaaa-15e38be4fc38.jpg"
                    }
                ],
                "labels": [
                    {
                        "id": "bc0e9d88-aaaa-aaaa-aaaa-07351f0c86f4",
                        "hexColor": "40bae2",
                        "title": "правки",
                        "description": "Исправление ошибок, опечаток",
                        "isTextLight": false
                    }
                ],
                "sourceBranch": {
                    "id": "link-fix",
                    "title": "link-fix",
                    "hash": "2dde6bd80d2d9caaaaaaaaaaaa25a4f252d0f90e",
                    "alias": "2dde6bd80d2d9caaaaaaaaaaaa25a4f252d0f90e",
                    "ownerAlias": null,
                    "color": null,
                    "hexColor": null,
                    "icon": null,
                    "isDeleted": false
                },
                "targetBranch": {
                    "id": "master",
                    "title": "master",
                    "hash": "148c03a74adc0daaaaaaaaaaaaea7e27ed4aeb8b",
                    "alias": "148c03a74adc0daaaaaaaaaaaaea7e27ed4aeb8b",
                    "ownerAlias": null,
                    "color": null,
                    "hexColor": null,
                    "icon": null,
                    "isDeleted": false
                },
                "status": {
                    "id": "OPENED",
                    "title": "Открыт",
                    "hash": null,
                    "alias": null,
                    "ownerAlias": null,
                    "color": "info",
                    "hexColor": "17A2B8",
                    "icon": null,
                    "isDeleted": false
                },
                "createdBy": {
                    "id": "8473a25a-aaaa-aaaa-aaaa-3e5c9e0a4b51",
                    "username": "gitflic_user",
                    "name": "gitflic",
                    "surname": "user",
                    "fullName": "gitflic user",
                    "avatar": "https://gitflic.ru/upload/img/6da34d10-aaaa-aaaa-aaaa-19b7e2151276.jpg"
                },
                "createdAt": "2025-04-04T22:16:35.226366Z",
                "updatedAt": "2025-04-04T22:16:35.226368Z",
                "sourceProject": {
                    "id": "fb4b1d65-aaaa-aaaa-aaaa-7e76f5ebdf99",
                    "title": "documentation",
                    "hash": null,
                    "alias": "documentation",
                    "ownerAlias": "gitflic",
                    "color": null,
                    "hexColor": null,
                    "icon": null,
                    "isDeleted": false
                },
                "targetProject": {
                    "id": "fb4b1d65-aaaa-aaaa-aaaa-7e76f5ebdf99",
                    "title": "documentation",
                    "hash": null,
                    "alias": "documentation",
                    "ownerAlias": "gitflic",
                    "color": null,
                    "hexColor": null,
                    "icon": null,
                    "isDeleted": false
                },
                "projectAlias": "documentation",
                "userAlias": "gitflic",
                "canMerge": false,
                "hasConflicts": false,
                "hasLockConflicts": false,
                "conflicts": [],
                "lockConflicts": [],
                "mergeCommit": null
            }
        ]
    },
    "page": {
        "size": 10,
        "totalElements": 1,
        "totalPages": 1,
        "number": 0
    }
}
    
  

STATUS 403 - No access rights.

STATUS 404 - Data not found.


Method to create a new merge request

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

The 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 Title of the merge request
description Description of the merge request
sourceBranch Source branch
targetBranch Target branch
sourceProject Source project
targetProject Target project
squashCommit Merge with a single commit: true or not: false. Optional parameter
removeSourceBranch Remove the source branch after the 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
    
{
    "id": "a306ecf4-aaaa-aaaa-aaaa-25b206b7e8b7",
    "localId": 1,
    "description": "test2-new",
    "title": "test2-new",
    "removeSourceBranch": true,
    "squashCommit": true,
    "assignedUsers": [],
    "reviewers": [],
    "labels": [],
    "sourceBranch": {
        "id": "master",
        "title": "master",
        "hash": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
        "alias": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
        "ownerAlias": null,
        "color": null,
        "hexColor": null,
        "icon": null
    },
    "targetBranch": {
        "id": "master",
        "title": "master",
        "hash": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
        "alias": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
        "ownerAlias": null,
        "color": null,
        "hexColor": null,
        "icon": null
    },
    "status": {
        "id": "CANCELED",
        "title": "Отменен",
        "hash": null,
        "alias": null,
        "ownerAlias": null,
        "color": null,
        "hexColor": null,
        "icon": null
    },
    "createdBy": {
        "id": "6736240a-aaaa-aaaa-aaaa-cab026562172",
        "username": "user2",
        "name": "name",
        "surname": "surname",
        "fullName": "name surname",
        "avatar": "https://gitflic.ru/static/image/avatar.jpg"
    },
    "createdAt": "2022-04-20T13:56:00.250341Z",
    "updatedAt": "2022-04-20T14:13:37.491826Z",
    "sourceProject": {
        "id": "4eeae220-aaaa-aaaa-aaaa-85ff50ee88c1",
        "title": "test-project",
        "hash": null,
        "alias": "test-project",
        "ownerAlias": "user2",
        "color": null,
        "hexColor": null,
        "icon": null
    },
    "targetProject": {
        "id": "4eeae220-aaaa-aaaa-aaaa-85ff50ee88c1",
        "title": "test-project",
        "hash": null,
        "alias": "test-project",
        "ownerAlias": "user2",
        "color": null,
        "hexColor": null,
        "icon": null
    },
    "projectAlias": "test-project",
    "userAlias": "user2",
    "canMerge": false,
    "hasConflicts": false,
    "hasLockConflicts": null,
    "conflicts": null,
    "lockConflicts": null,
    "mergeCommit": null
}
    
  

STATUS 403 - No access rights.

STATUS 404 - Data not found.


Method to edit a merge request

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

The 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 Required field. Merge request ID to edit
title Required field. Merge request title
description Merge request description
targetBranch Required field. Target branch
sourceProject Required field. Source project
targetProject Required field. 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",
    "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
    
{
    "id": "a306ecf4-aaaa-aaaa-aaaa-25b206b7e8b7",
    "localId": 1,
    "description": "test4-changed",
    "title": "test4-changed",
    "removeSourceBranch": true,
    "squashCommit": true,
    "assignedUsers": [],
    "reviewers": [],
    "labels": [],
    "sourceBranch": {
        "id": "master",
        "title": "master",
        "hash": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
        "alias": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
        "ownerAlias": null,
        "color": null,
        "hexColor": null,
        "icon": null
    },
    "targetBranch": {
        "id": "new_branch",
        "title": "new_branch",
        "hash": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
        "alias": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
        "ownerAlias": null,
        "color": null,
        "hexColor": null,
        "icon": null
    },
    "status": {
        "id": "CANCELED",
        "title": "Отменен",
        "hash": null,
        "alias": null,
        "ownerAlias": null,
        "color": null,
        "hexColor": null,
        "icon": null
    },
    "createdBy": {
        "id": "6736240a-aaaa-aaaa-aaaa-cab026562172",
        "username": "user2",
        "name": "name",
        "surname": "surname",
        "fullName": "name surname",
        "avatar": "https://gitflic.ru/static/image/avatar.jpg"
    },
    "createdAt": "2022-04-20T13:56:00.250341Z",
    "updatedAt": "2022-04-20T14:13:37.491826Z",
    "sourceProject": {
        "id": "4eeae220-aaaa-aaaa-aaaa-85ff50ee88c1",
        "title": "test-project",
        "hash": null,
        "alias": "test-project",
        "ownerAlias": "user2",
        "color": null,
        "hexColor": null,
        "icon": null
    },
    "targetProject": {
        "id": "4eeae220-aaaa-aaaa-aaaa-85ff50ee88c1",
        "title": "test-project",
        "hash": null,
        "alias": "test-project",
        "ownerAlias": "user2",
        "color": null,
        "hexColor": null,
        "icon": null
    },
    "projectAlias": "test-project",
    "userAlias": "user2",
    "canMerge": false,
    "hasConflicts": false,
    "hasLockConflicts": null,
    "conflicts": null,
    "lockConflicts": null,
    "mergeCommit": null
}
    
  

STATUS 403 - No access rights.

STATUS 404 - Data not found.


Method to approve a merge request

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

The request 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 ID of the merge request

Responses

This request returns a unique parameter approved.

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

STATUS 200 - Merge request successfully approved.

Example response
    
{
    "approved": false,
    "mergeRequestModel": {
        "id": "a306ecf4-aaaa-aaaa-aaaa-25b206b7e8b7",
        "localId": 1,
        "description": "test4-changed",
        "title": "test4-changed",
        "removeSourceBranch": true,
        "squashCommit": true,
        "assignedUsers": [],
        "reviewers": [],
        "labels": [],
        "sourceBranch": {
            "id": "master",
            "title": "master",
            "hash": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
            "alias": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
            "ownerAlias": null,
            "color": null,
            "hexColor": null,
            "icon": null
        },
        "targetBranch": {
            "id": "new_branch",
            "title": "new_branch",
            "hash": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
            "alias": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
            "ownerAlias": null,
            "color": null,
            "hexColor": null,
            "icon": null
        },
        "status": {
            "id": "CANCELED",
            "title": "Отменен",
            "hash": null,
            "alias": null,
            "ownerAlias": null,
            "color": null,
            "hexColor": null,
            "icon": null
        },
        "createdBy": {
            "id": "6736240a-aaaa-aaaa-aaaa-cab026562172",
            "username": "user2",
            "name": "name",
            "surname": "surname",
            "fullName": "name surname",
            "avatar": "https://gitflic.ru/static/image/avatar.jpg"
        },
        "createdAt": "2022-04-20T13:56:00.250341Z",
        "updatedAt": "2022-04-20T14:13:37.491826Z",
        "sourceProject": {
            "id": "4eeae220-aaaa-aaaa-aaaa-85ff50ee88c1",
            "title": "test-project",
            "hash": null,
            "alias": "test-project",
            "ownerAlias": "user2",
            "color": null,
            "hexColor": null,
            "icon": null
        },
        "targetProject": {
            "id": "4eeae220-aaaa-aaaa-aaaa-85ff50ee88c1",
            "title": "test-project",
            "hash": null,
            "alias": "test-project",
            "ownerAlias": "user2",
            "color": null,
            "hexColor": null,
            "icon": null
        },
        "projectAlias": "test-project",
        "userAlias": "user2",
        "canMerge": false,
        "hasConflicts": false,
        "hasLockConflicts": null,
        "conflicts": null,
        "lockConflicts": null,
        "mergeCommit": null
    }
}
    
  

STATUS 403 - No access rights.

STATUS 404 - Data not found.


Method to merge a merge request

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

The request performs a merge request.

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

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
    
{
    "id": "a306ecf4-aaaa-aaaa-aaaa-25b206b7e8b7",
    "localId": 1,
    "description": "test4-changed",
    "title": "test4-changed",
    "removeSourceBranch": false,
    "squashCommit": false,
    "assignedUsers": [],
    "reviewers": [],
    "labels": [],
    "sourceBranch": {
        "id": "master",
        "title": "master",
        "hash": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
        "alias": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
        "ownerAlias": null,
        "color": null,
        "hexColor": null,
        "icon": null
    },
    "targetBranch": {
        "id": "new_branch",
        "title": "new_branch",
        "hash": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
        "alias": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
        "ownerAlias": null,
        "color": null,
        "hexColor": null,
        "icon": null
    },
    "status": {
        "id": "MERGED",
        "title": "Слит",
        "hash": null,
        "alias": null,
        "ownerAlias": null,
        "color": "success",
        "hexColor": "28A745",
        "icon": null,
        "isDeleted": false
    },
    "createdBy": {
        "id": "6736240a-aaaa-aaaa-aaaa-cab026562172",
        "username": "user2",
        "name": "name",
        "surname": "surname",
        "fullName": "name surname",
        "avatar": "https://gitflic.ru/static/image/avatar.jpg"
    },
    "createdAt": "2022-04-20T13:56:00.250341Z",
    "updatedAt": "2022-04-20T14:13:37.491826Z",
    "sourceProject": {
        "id": "4eeae220-aaaa-aaaa-aaaa-85ff50ee88c1",
        "title": "test-project",
        "hash": null,
        "alias": "test-project",
        "ownerAlias": "user2",
        "color": null,
        "hexColor": null,
        "icon": null
    },
    "targetProject": {
        "id": "4eeae220-aaaa-aaaa-aaaa-85ff50ee88c1",
        "title": "test-project",
        "hash": null,
        "alias": "test-project",
        "ownerAlias": "user2",
        "color": null,
        "hexColor": null,
        "icon": null
    },
    "projectAlias": "test-project",
    "userAlias": "user2",
    "canMerge": false,
    "hasConflicts": false,
    "hasLockConflicts": null,
    "conflicts": null
    "lockConflicts": null,
    "mergeCommit": {
        "hash": "c3387bc74bb9a0aaaaaaaaaaaab2727a6ed3e835",
        "message": "Обновления",
        "shortMessage": "Обновления",
        "createdAt": "2024-09-04T09:52:50Z",
        "committerIdent": {
            "name": "adminuser",
            "avatar": "/static/image/avatar.jpg",
            "emailAddress": "adminuser@admin.local",
            "when": "2024-09-04T09:52:50Z"
        },
        "authorIdent": {
            "name": "adminuser",
            "avatar": "/static/image/avatar.jpg",
            "emailAddress": "adminuser@admin.local",
            "when": "2024-09-04T09:52:50Z"
        },
        "user": {
            "id": "6736240a-aaaa-aaaa-aaaa-cab026562172",
            "username": "adminuser",
            "name": "admin",
            "surname": "user",
            "fullName": "admin user",
            "avatar": "http://localhost:8080/upload/img/beb67ed7-aaaa-aaaa-aaaa-eb174cda4dbd.jpg"
        },
        "verificationResult": null,
        "parentCommitIds": [
            "587be46840d578aaaaaaaaaaaa85218816d18359"
        ],
        "parentCommitBranches": [
            "master"
        ]
}
    
  

STATUS 403 - No access rights.

STATUS 404 - Data not found.


Method to close a merge request

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

The request closes a merge request.

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

Responses

STATUS 200 - Merge request successfully closed.

Example response
    
{
    "id": "a306ecf4-aaaa-aaaa-aaaa-25b206b7e8b7",
    "localId": 1,
    "description": "test4-changed",
    "title": "test4-changed",
    "removeSourceBranch": false,
    "squashCommit": false,
    "assignedUsers": [],
    "reviewers": [],
    "labels": [],
    "sourceBranch": {
        "id": "master",
        "title": "master",
        "hash": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
        "alias": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
        "ownerAlias": null,
        "color": null,
        "hexColor": null,
        "icon": null
    },
    "targetBranch": {
        "id": "new_branch",
        "title": "new_branch",
        "hash": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
        "alias": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
        "ownerAlias": null,
        "color": null,
        "hexColor": null,
        "icon": null
    },
    "status": {
        "id": "CLOSED",
        "title": "Закрыт",
        "hash": null,
        "alias": null,
        "ownerAlias": null,
        "color": "warning",
        "hexColor": "FFC107",
        "icon": null,
        "isDeleted": false
    },
    "createdBy": {
        "id": "6736240a-aaaa-aaaa-aaaa-cab026562172",
        "username": "user2",
        "name": "name",
        "surname": "surname",
        "fullName": "name surname",
        "avatar": "https://gitflic.ru/static/image/avatar.jpg"
    },
    "createdAt": "2022-04-20T13:56:00.250341Z",
    "updatedAt": "2022-04-20T14:13:37.491826Z",
    "sourceProject": {
        "id": "4eeae220-aaaa-aaaa-aaaa-85ff50ee88c1",
        "title": "test-project",
        "hash": null,
        "alias": "test-project",
        "ownerAlias": "user2",
        "color": null,
        "hexColor": null,
        "icon": null
    },
    "targetProject": {
        "id": "4eeae220-aaaa-aaaa-aaaa-85ff50ee88c1",
        "title": "test-project",
        "hash": null,
        "alias": "test-project",
        "ownerAlias": "user2",
        "color": null,
        "hexColor": null,
        "icon": null
    },
    "projectAlias": "test-project",
    "userAlias": "user2",
    "canMerge": false,
    "hasConflicts": false,
    "hasLockConflicts": null,
    "conflicts": null,
    "lockConflicts": null,
    "mergeCommit": null
}
    
  

STATUS 403 - No access rights.

STATUS 404 - Data not found.


Method to cancel a merge request

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

The request cancels a merge request.

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

Responses

STATUS 200 - Merge request successfully canceled.

Example response
    
{
    "id": "a306ecf4-aaaa-aaaa-aaaa-25b206b7e8b7",
    "localId": 1,
    "description": "test4-changed",
    "title": "test4-changed",
    "removeSourceBranch": false,
    "squashCommit": false,
    "assignedUsers": [],
    "reviewers": [],
    "labels": [],
    "sourceBranch": {
        "id": "master",
        "title": "master",
        "hash": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
        "alias": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
        "ownerAlias": null,
        "color": null,
        "hexColor": null,
        "icon": null
    },
    "targetBranch": {
        "id": "new_branch",
        "title": "new_branch",
        "hash": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
        "alias": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
        "ownerAlias": null,
        "color": null,
        "hexColor": null,
        "icon": null
    },
    "status": {
        "id": "CANCELED",
        "title": "Отменен",
        "hash": null,
        "alias": null,
        "ownerAlias": null,
        "color": "warning",
        "hexColor": "FFC107",
        "icon": null,
        "isDeleted": false
    },
    "createdBy": {
        "id": "6736240a-aaaa-aaaa-aaaa-cab026562172",
        "username": "user2",
        "name": "name",
        "surname": "surname",
        "fullName": "name surname",
        "avatar": "https://gitflic.ru/static/image/avatar.jpg"
    },
    "createdAt": "2022-04-20T13:56:00.250341Z",
    "updatedAt": "2022-04-20T14:13:37.491826Z",
    "sourceProject": {
        "id": "4eeae220-aaaa-aaaa-aaaa-85ff50ee88c1",
        "title": "test-project",
        "hash": null,
        "alias": "test-project",
        "ownerAlias": "user2",
        "color": null,
        "hexColor": null,
        "icon": null
    },
    "targetProject": {
        "id": "4eeae220-aaaa-aaaa-aaaa-85ff50ee88c1",
        "title": "test-project",
        "hash": null,
        "alias": "test-project",
        "ownerAlias": "user2",
        "color": null,
        "hexColor": null,
        "icon": null
    },
    "projectAlias": "test-project",
    "userAlias": "user2",
    "canMerge": false,
    "hasConflicts": false,
    "hasLockConflicts": null,
    "conflicts": null,
    "lockConflicts": null,
    "mergeCommit": null
}
    
  

STATUS 403 - No access rights.

STATUS 404 - Data not found.


Methods for configuring merge requests

Method to get a list of merge request approval rules

Method available in Enterprise version and on gitflic.ru

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

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

The request returns a list of merge request approval rules for the specified entity with the given alias, with pagination support.

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
    
{
    "_embedded": {
        "restMergeRequestApprovalRuleList": [
            {
                "targetBranch": "master",
                "name": "master ветка",
                "minimalApprovals": 2,
                "allowedApprovers": [
                    {
                        "id": "1757a1b5-aaaa-aaaa-aaaa-764a60303236",
                        "username": "test-user",
                        "name": "test",
                        "surname": "user",
                        "fullName": "test-user",
                        "avatar": "https://gitflic.ru/upload/-/user/1757a1b5-aaaa-aaaa-aaaa-764a60303236/avatar/feede29b-aaaa-aaaa-aaaa-49ee70a42929.png",
                        "cover": "https://gitflic.ru/static/image/user-cover.png"
                    },
                    {
                        "id": "6736240a-aaaa-aaaa-aaaa-cab026562172",
                        "username": "adminuser",
                        "name": "Admin",
                        "surname": "User",
                        "fullName": "Admin User",
                        "avatar": "https://gitflic.ru/static/image/avatar.jpg",
                        "cover": "https://gitflic.ru/static/image/user-cover.png"
                    }
                ],
                "uuid": "51352bb5-aaaa-aaaa-aaaa-a9ea23a64d19"
            },
            {
                "targetBranch": "develop",
                "name": "develop ветка",
                "minimalApprovals": 1,
                "allowedApprovers": [
                    {
                        "id": "6736240a-aaaa-aaaa-aaaa-cab026562172",
                        "username": "adminuser",
                        "name": "Admin",
                        "surname": "User",
                        "fullName": "Admin User",
                        "avatar": "https://gitflic.ru/static/image/avatar.jpg",
                        "cover": "https://gitflic.ru/static/image/user-cover.png"
                    }
                ],
                "uuid": "06eff520-aaaa-aaaa-aaaa-94c674ab87e1"
            }
        ]
    },
    "page": {
        "size": 10,
        "totalElements": 2,
        "totalPages": 1,
        "number": 0
    }
}
    
  

STATUS 403 - No access rights.

STATUS 404 - Data not found.


Method to get a merge request approval rule

Method 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}

The request returns a merge request approval rule for the specified entity with the given alias.

Path Variable Type Description
companyAlias String Company alias
teamAlias String Team alias
approvalRuleUuid String UUID of the merge request approval rule

Responses

STATUS 200 - Merge request approval rule successfully returned:

Example response
    
{
    "targetBranch": "master",
    "name": "master ветка",
    "minimalApprovals": 2,
    "allowedApprovers": [
        {
            "id": "1757a1b5-aaaa-aaaa-aaaa-764a60303236",
            "username": "test-user",
            "name": "test",
            "surname": "user",
            "fullName": "test-user",
            "avatar": "https://gitflic.ru/upload/-/user/1757a1b5-aaaa-aaaa-aaaa-764a60303236/avatar/feede29b-aaaa-aaaa-aaaa-49ee70a42929.png",
            "cover": "https://gitflic.ru/static/image/user-cover.png"
        },
        {
            "id": "6736240a-aaaa-aaaa-aaaa-cab026562172",
            "username": "adminuser",
            "name": "Admin",
            "surname": "User",
            "fullName": "Admin User",
            "avatar": "https://gitflic.ru/static/image/avatar.jpg",
            "cover": "https://gitflic.ru/static/image/user-cover.png"
        }
    ],
    "uuid": "51352bb5-aaaa-aaaa-aaaa-a9ea23a64d19"
}
    
  

STATUS 403 - No access rights.

STATUS 404 - Data not found.


Method to create a merge request approval rule

Method 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

The request creates and returns a merge request approval rule for the specified entity with the given alias.

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; merge requests to this branch will follow this approval rule
name String Name of the approval rule
minimalApprovals Integer Minimum number of responsible users who must approve the merge request. Must not exceed the 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
    
{
    "targetBranch": "master",
    "name": "master ветка",
    "minimalApprovals": 2,
    "allowedApprovers": [
        {
            "id": "1757a1b5-aaaa-aaaa-aaaa-764a60303236",
            "username": "test-user",
            "name": "test",
            "surname": "user",
            "fullName": "test-user",
            "avatar": "https://gitflic.ru/upload/-/user/1757a1b5-aaaa-aaaa-aaaa-764a60303236/avatar/feede29b-aaaa-aaaa-aaaa-49ee70a42929.png",
            "cover": "https://gitflic.ru/static/image/user-cover.png"
        },
        {
            "id": "6736240a-aaaa-aaaa-aaaa-cab026562172",
            "username": "adminuser",
            "name": "Admin",
            "surname": "User",
            "fullName": "Admin User",
            "avatar": "https://gitflic.ru/static/image/avatar.jpg",
            "cover": "https://gitflic.ru/static/image/user-cover.png"
        }
    ],
    "uuid": "51352bb5-aaaa-aaaa-aaaa-a9ea23a64d19"
}
    
  

STATUS 403 - No access rights.

STATUS 404 - Data not found.

STATUS 422 - Required field missing in request body.


Method to edit a merge request approval rule

Method 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

The request edits and returns a merge request approval rule for the specified entity with the given alias.

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 field. UUID of the merge request approval rule to edit
targetBranch String Target branch; merge requests to this branch will follow this approval rule
name String Name of the approval rule
minimalApprovals Integer Minimum number of responsible users who must approve the merge request. Must not exceed the 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
    
{
    "targetBranch": "master",
    "name": "master ветка",
    "minimalApprovals": 2,
    "allowedApprovers": [
        {
            "id": "1757a1b5-aaaa-aaaa-aaaa-764a60303236",
            "username": "test-user",
            "name": "test",
            "surname": "user",
            "fullName": "test-user",
            "avatar": "https://gitflic.ru/upload/-/user/1757a1b5-aaaa-aaaa-aaaa-764a60303236/avatar/feede29b-aaaa-aaaa-aaaa-49ee70a42929.png",
            "cover": "https://gitflic.ru/static/image/user-cover.png"
        },
        {
            "id": "6736240a-aaaa-aaaa-aaaa-cab026562172",
            "username": "adminuser",
            "name": "Admin",
            "surname": "User",
            "fullName": "Admin User",
            "avatar": "https://gitflic.ru/static/image/avatar.jpg",
            "cover": "https://gitflic.ru/static/image/user-cover.png"
        }
    ],
    "uuid": "51352bb5-aaaa-aaaa-aaaa-a9ea23a64d19"
}
    
  

STATUS 403 - No access rights.

STATUS 404 - Data not found.

STATUS 422 - Required field missing in request body.


Method to delete a merge request approval rule

Method 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}

The request deletes a merge request approval rule for the specified entity with the given alias.

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

Responses

STATUS 204 - Merge request approval rule successfully deleted.

STATUS 403 - No access rights.

STATUS 404 - Data not found.


Method to get a list of merge request settings

Method available in Enterprise version and on gitflic.ru

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

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

The request returns a list of merge request settings for the specified entity with the given alias.

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

Responses

STATUS 200 - Merge request settings successfully returned:

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

STATUS 403 - No access rights.

STATUS 404 - Data not found.


Method to edit merge request settings

Method 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

The request edits merge request settings for the specified entity with the given alias 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 required approvals for the merge request is active
removeApprovalsOnPush Boolean If true, the setting Remove all approvals in the merge request when a new commit is pushed to the source branch is active
preventAuthorApproving Boolean If true, the setting Prohibit the author from approving their own merge request is active
preventCommitterApproving Boolean If true, the setting Prohibit developers from approving the merge request is active
checkCiCdStatus Boolean If true, the setting Check the status of the latest pipeline when merging the request is active
mergeResultPipelineStatusCheckEnabled Boolean If true, the setting Check the status of the merge result pipeline is active
mergeRequestPipelineStatusCheckEnabled Boolean If true, the setting Check the status of the merge request pipeline is active
branchPipelineStatusCheckEnabled Boolean If true, the setting Check the status of the branch pipeline is active
editMergedMergeRequest Boolean If true, the setting Allow editing of merged merge requests is active
removeApprovalsOnChangingTargetBranch Boolean If true, the setting Remove all approvals in the merge request when changing the 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
    
{
    "canOverrideApprovals": true,
    "preventAuthorApproving": true,
    "preventCommitterApproving": true,
    "requirePasswordToApprove": false,
    "removeApprovalsOnPush": true,
    "checkCiCdStatus": true,
    "editMergedMergeRequest": true,
    "enableRemoveSourceBranchByDefault": true,
    "removeApprovalsOnChangingTargetBranch": true,
    "branchPipelineStatusCheckEnabled": true,
    "mergeRequestPipelineStatusCheckEnabled": true,
    "mergeResultPipelineStatusCheckEnabled": true
}
    
  

STATUS 403 - No access rights.

STATUS 404 - Data not found.


Method to get the squash commit rule

Method 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

The request returns the value of the squash commit rule for the specified entity with the given alias.

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

Responses

STATUS 200 - Squash commit rule returned.

Response Squash Commit 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 - No access rights.

STATUS 404 - Data not found.


Method to edit the squash commit rule

Method 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

The request edits the value of the squash commit rule for the specified entity with the given alias 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 are listed in the table below
Response Squash Commit 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 - No access rights.

STATUS 404 - Data not found.

STATUS 422 - mergeRequestSquashSetting field missing or invalid value.


Method to get the merge method

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

The request returns the merge method for the specified entity with the given alias.

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

Responses

STATUS 200 - Merge method returned.

Response 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 will be suggested.
FAST_FORWARD_MERGE Fast-Forward No merge commit will be created. If merge is not possible due to outdated source branch, rebasing onto target branch will be suggested.
Example response
    
"MERGE_COMMIT"
    
  

STATUS 403 - No access rights.

STATUS 404 - Data not found.


Method to edit the merge method

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

The request edits the merge method for the specified entity with the given alias 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 are listed in the table below
Response 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 will be suggested.
FAST_FORWARD_MERGE Fast-Forward No merge commit will be created. If merge is not possible due to outdated source branch, rebasing onto target branch will be suggested.

Example JSON object

{
    "mergedRequestMethodType": "MERGE_COMMIT"
}

Responses

STATUS 200 - Merge method returned.

Example response
    
"MERGE_COMMIT"
    
  

STATUS 403 - No access rights.

STATUS 404 - Data not found.

STATUS 422 - mergedRequestMethodType field missing or invalid value.


Method to get merge message templates

Method 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

The request returns merge message templates for the specified entity with the given alias.

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

Responses

STATUS 200 - Merge message templates returned.

Example response
    
{
    "mergeCommitMessage": "Сообщение для merge commit",
    "squashCommitMessage": "Сообщение для squash commit",
    "mergeRequestDescriptionTemplate": "Стандартный текст для описания запроса на слияние",
    "canEditMergeCommitMessage": true
}
    
  

STATUS 403 - No access rights.

STATUS 404 - Data not found.


Method to edit merge message templates

Method 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

The request edits merge message templates for the specified entity with the given alias 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 Template for merge commit message
squashCommitMessage String Template for squash commit message
mergeRequestDescriptionTemplate String Template for merge request description
canEditMergeCommitMessage Boolean If true, the option Allow editing of 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
    
{
    "mergeCommitMessage": "Сообщение для merge commit",
    "squashCommitMessage": "Сообщение для squash commit",
    "mergeRequestDescriptionTemplate": "Стандартный текст для описания запроса на слияние",
    "canEditMergeCommitMessage": true
}
    
  

STATUS 403 - No access rights.

STATUS 404 - Data not found.


Method to apply merge request settings to projects

Method 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

The request applies merge request settings to all projects of the specified entity with the given alias.

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 - No access rights.

STATUS 404 - Data not found.


Automated translation!

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