Merge Queue
Control merge queue state — pause, unpause, and inspect status.
Get branches with active merge queues #
/repos/{owner}/{repository}/merge-queue/branches
Get the list of branches that currently have active merge queues
owner
string
required
The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
repository
string
required
The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
200 Successful Response
List of branches with active merge queues
Example Response
{
"branches": [
"string"
]
}
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/merge-queue/branches" \
-H "Authorization: Bearer <token>"
Get the current status of the merge queue #
/repos/{owner}/{repository}/merge-queue/status
Get the current status of the speculative checks, batches, and queued pull requests in the merge queue
owner
string
required
The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
repository
string
required
The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
branch
string
The name of the branch
200 Successful Response
serial parallel isolatedExample Response
{
"scope_queues": {
"__default__": [
"550e8400-e29b-41d4-a716-446655440001",
"550e8400-e29b-41d4-a716-446655440002"
]
},
"batches": [
{
"id": "550e8400-e29b-41d4-a716-446655440001",
"parent_ids": [],
"name": "Batch 1",
"status": {
"code": "running"
},
"started_at": "2025-11-05T14:05:00Z",
"estimated_merge_at": "2025-11-05T14:35:00Z",
"estimated_ci_finish_at": "2025-11-05T14:34:30Z",
"ci_finished_at": "2025-11-05T14:34:30Z",
"scopes": [
"frontend",
"backend"
],
"queue_rule_name": "default",
"checks_summary": {
"passed": 45,
"total": 67
},
"pull_requests": [
{
"number": 1421,
"title": "feat(auth): add \"Reset Password\" flow to login UI",
"url": "https://github.com/org/repo/pull/1421",
"author": {
"id": 123,
"login": "james"
},
"queued_at": "2025-11-05T13:30:00Z",
"priority_alias": "high",
"priority_rule_name": "hotfix",
"labels": [
"feature",
"auth"
],
"github_labels": [
{
"id": 1,
"name": "feature",
"color": "0e8a16",
"default": false
},
{
"id": 2,
"name": "auth",
"color": "1d76db",
"default": false
}
],
"scopes": [
"frontend"
]
}
]
},
{
"id": "550e8400-e29b-41d4-a716-446655440002",
"parent_ids": [
"550e8400-e29b-41d4-a716-446655440001"
],
"name": "Batch 2",
"status": {
"code": "bisecting"
},
"started_at": "2025-11-05T13:35:00Z",
"estimated_merge_at": "2025-11-05T15:35:00Z",
"estimated_ci_finish_at": "2025-11-05T15:34:30Z",
"ci_finished_at": "2025-11-05T14:34:30Z",
"scopes": [
"frontend"
],
"queue_rule_name": "default",
"checks_summary": {
"passed": 15,
"total": 28
},
"sub_batches": [
{
"id": "550e8400-e29b-41d4-a716-446655440003",
"parent_ids": [],
"name": "Sub Batch 1",
"status": {
"code": "merged"
},
"started_at": "2025-11-05T13:40:00Z",
"estimated_merge_at": "2025-11-05T13:50:00Z",
"estimated_ci_finish_at": "2025-11-05T13:49:30Z",
"ci_finished_at": "2025-11-05T13:49:30Z",
"scopes": [
"frontend"
],
"queue_rule_name": "default",
"checks_summary": {
"passed": 15,
"total": 15
},
"pull_requests": []
},
{
"id": "550e8400-e29b-41d4-a716-446655440004",
"parent_ids": [],
"name": "Sub Batch 2",
"status": {
"code": "running"
},
"started_at": "2025-11-05T13:50:00Z",
"estimated_merge_at": "2025-11-05T14:00:00Z",
"estimated_ci_finish_at": "2025-11-05T13:59:30Z",
"ci_finished_at": "2025-11-05T14:34:30Z",
"scopes": [
"frontend"
],
"queue_rule_name": "default",
"checks_summary": {
"passed": 0,
"total": 13
},
"pull_requests": []
}
],
"pull_requests": []
}
],
"forming_batches": [
{
"queue_rule_name": "default",
"scopes": [
"backend"
],
"all_scopes": false,
"pull_request_numbers": [
1440
],
"max_batch_slots": 5,
"batch_max_start_at": "2025-11-05T14:52:00Z"
}
],
"waiting_pull_requests": [
{
"number": 1440,
"title": "fix(api): retry the S3 client",
"url": "https://github.com/org/repo/pull/1440",
"author": {
"id": 123,
"login": "james"
},
"queued_at": "2025-11-05T14:42:00Z",
"priority_alias": "medium",
"priority_rule_name": "<default>",
"labels": [],
"github_labels": [],
"scopes": [
"backend"
]
}
],
"automatic_conflict_resolution_unsupported": false
}
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/merge-queue/status" \
-H "Authorization: Bearer <token>"
Get a pull request in the merge queue #
/repos/{owner}/{repository}/merge-queue/pull/{pr_number}
Get details about a specific pull request in the merge queue
pr_number
integer
required
The pull request number
min: 1 · max: 9223372036854776000
owner
string
required
The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
repository
string
required
The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
200 Successful Response
The number of the pull request
The timestamp when the pull request entered the queue
The estimated timestamp when this pull request will be merged
The position of the pull request in the queue (0-indexed)
The name of the priority rule applied to this pull request
The name of the queue rule
The timestamp when the checks will timeout for this pull request
Example Response
{
"number": 1,
"queued_at": "2024-01-15T09:00:00Z",
"estimated_time_of_merge": "2024-01-15T09:00:00Z",
"position": 0,
"priority_rule_name": "string",
"queue_rule_name": "string",
"checks_timeout_at": "2024-01-15T09:00:00Z",
"queue_rule": {
"name": "string",
"config": {}
},
"mergeability_check": {
"check_type": "in_place",
"queue_pull_request_number": 1,
"started_at": "2024-01-15T09:00:00Z",
"ci_ended_at": "2024-01-15T09:00:00Z",
"ci_state": "pending",
"state": "string",
"checks": [
{}
],
"conditions_evaluation": {
"match": true,
"label": "string",
"description": "string",
"documentation_url": "string",
"schedule": {},
"subconditions": null,
"evaluations": null
}
}
}
403 Forbidden
404 `PULL_REQUEST_NOT_QUEUED`: The pull request is not in any merge queue of the repository.
CONFIGURATION_BRANCH_REFUSED CONFIGURATION_REFUSED_BY_REPOSITORY_RULES CONFIGURATION_SIGNED_COMMITS_REQUIRED DEFAULT_BRANCH_NOT_FOUND GITHUB_ACCOUNT_SUSPENDED GITHUB_APP_ACCESS_LOST GITHUB_RATE_LIMITED GITHUB_UPSTREAM_REQUEST_FORBIDDEN GITHUB_UPSTREAM_REQUEST_REJECTED GITHUB_UPSTREAM_UNAVAILABLE IP_ALLOW_LIST_NOT_CONFIGURED NO_LOGIN_IN_PROGRESS ORGANIZATION_MEMBERS_ONLY PULL_REQUEST_NOT_QUEUED RETRY_RULE_NOT_FOUND SAML_ENFORCEMENT_NOT_AUTHORIZED SETTING_MANAGED_BY_ENV SETUP_ALREADY_DONE SETUP_TOKEN_MISMATCH SHADOW_OFFICE_UNAVAILABLE SUBSCRIPTION_INACTIVE SUBSCRIPTION_TOKEN_INVALID TEST_ALREADY_QUARANTINEDExample Response
{
"detail": "string",
"error_code": "CONFIGURATION_BRANCH_REFUSED",
"documentation_url": "string"
}
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/merge-queue/pull/:pr_number" \
-H "Authorization: Bearer <token>"
Preview the impact of dequeuing a pull request #
/repos/{owner}/{repository}/merge-queue/pull/{pr_number}/dequeue-impact
Return how many batches would be interrupted, how many other pull requests would be rechecked, and how many stacked pull requests would also be dequeued if the given pull request is manually dequeued
pr_number
integer
required
The pull request number
min: 1 · max: 9223372036854776000
owner
string
required
The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
repository
string
required
The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
200 Successful Response
Number of in-progress batches whose checks would be interrupted and restarted if this pull request is dequeued
Number of other pull requests from the interrupted batches that would be re-embarked and rechecked
Number of queued pull requests stacked on top of this one that would also be dequeued (excludes the dequeued pull request itself)
Example Response
{
"interrupted_batches": 0,
"rechecked_pull_requests": 0,
"cascaded_pull_requests": 0
}
403 Forbidden
404 `PULL_REQUEST_NOT_QUEUED`: The pull request is not in any merge queue of the repository.
CONFIGURATION_BRANCH_REFUSED CONFIGURATION_REFUSED_BY_REPOSITORY_RULES CONFIGURATION_SIGNED_COMMITS_REQUIRED DEFAULT_BRANCH_NOT_FOUND GITHUB_ACCOUNT_SUSPENDED GITHUB_APP_ACCESS_LOST GITHUB_RATE_LIMITED GITHUB_UPSTREAM_REQUEST_FORBIDDEN GITHUB_UPSTREAM_REQUEST_REJECTED GITHUB_UPSTREAM_UNAVAILABLE IP_ALLOW_LIST_NOT_CONFIGURED NO_LOGIN_IN_PROGRESS ORGANIZATION_MEMBERS_ONLY PULL_REQUEST_NOT_QUEUED RETRY_RULE_NOT_FOUND SAML_ENFORCEMENT_NOT_AUTHORIZED SETTING_MANAGED_BY_ENV SETUP_ALREADY_DONE SETUP_TOKEN_MISMATCH SHADOW_OFFICE_UNAVAILABLE SUBSCRIPTION_INACTIVE SUBSCRIPTION_TOKEN_INVALID TEST_ALREADY_QUARANTINEDExample Response
{
"detail": "string",
"error_code": "CONFIGURATION_BRANCH_REFUSED",
"documentation_url": "string"
}
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/merge-queue/pull/:pr_number/dequeue-impact" \
-H "Authorization: Bearer <token>"
Dequeue a pull request from the merge queue #
/repos/{owner}/{repository}/merge-queue/pull/{pr_number}/dequeue
Manually remove the given pull request (and its queued stack successors) from the merge queue
pr_number
integer
required
The pull request number
min: 1 · max: 9223372036854776000
owner
string
required
The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
repository
string
required
The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
204 Successful Response
403 Forbidden
404 `PULL_REQUEST_NOT_QUEUED`: The pull request is not in any merge queue of the repository.
CONFIGURATION_BRANCH_REFUSED CONFIGURATION_REFUSED_BY_REPOSITORY_RULES CONFIGURATION_SIGNED_COMMITS_REQUIRED DEFAULT_BRANCH_NOT_FOUND GITHUB_ACCOUNT_SUSPENDED GITHUB_APP_ACCESS_LOST GITHUB_RATE_LIMITED GITHUB_UPSTREAM_REQUEST_FORBIDDEN GITHUB_UPSTREAM_REQUEST_REJECTED GITHUB_UPSTREAM_UNAVAILABLE IP_ALLOW_LIST_NOT_CONFIGURED NO_LOGIN_IN_PROGRESS ORGANIZATION_MEMBERS_ONLY PULL_REQUEST_NOT_QUEUED RETRY_RULE_NOT_FOUND SAML_ENFORCEMENT_NOT_AUTHORIZED SETTING_MANAGED_BY_ENV SETUP_ALREADY_DONE SETUP_TOKEN_MISMATCH SHADOW_OFFICE_UNAVAILABLE SUBSCRIPTION_INACTIVE SUBSCRIPTION_TOKEN_INVALID TEST_ALREADY_QUARANTINEDExample Response
{
"detail": "string",
"error_code": "CONFIGURATION_BRANCH_REFUSED",
"documentation_url": "string"
}
409 Conflict
422 Unprocessable entity
Example Request
curl -X POST "https://api.mergify.com/v1/repos/:owner/:repository/merge-queue/pull/:pr_number/dequeue" \
-H "Authorization: Bearer <token>"
Pause the merge queue #
/repos/{owner}/{repository}/merge-queue/pause
Pause the merge of the requested repository
owner
string
required
The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
repository
string
required
The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
The reason of the merge queue pause
200 Successful Response
Whether the merge queue is currently paused
The reason of the merge queue pause
The date and time when the merge queue was paused
Example Response
{
"paused": true,
"reason": "string",
"paused_at": "2024-01-15T09:00:00Z"
}
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X PUT "https://api.mergify.com/v1/repos/:owner/:repository/merge-queue/pause" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"reason": "string"
}'
Unpause merge queue #
/repos/{owner}/{repository}/merge-queue/pause
Unpause the merge queue of the requested repository
owner
string
required
The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
repository
string
required
The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
204 Successful Response
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X DELETE "https://api.mergify.com/v1/repos/:owner/:repository/merge-queue/pause" \
-H "Authorization: Bearer <token>"
Get merge queue pause data #
/repos/{owner}/{repository}/merge-queue/pause
Checks if the merge queue is paused and returns the pause data
owner
string
required
The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
repository
string
required
The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
200 Successful Response
Whether the merge queue is currently paused
The reason of the merge queue pause
The date and time when the merge queue was paused
Example Response
{
"paused": true,
"reason": "string",
"paused_at": "2024-01-15T09:00:00Z"
}
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/merge-queue/pause" \
-H "Authorization: Bearer <token>"
Was this page helpful?
Thanks for your feedback!