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
Application key permission: merge_queue: read.
repository string required The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
200 Successful Response
List of branches with active merge queues
Example Response
{
"branches": [
"string"
]
}
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves, each at the newest point this server serves (YYYY-MM-DD.N).
Body: APIVersionUnknownBody
APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
CONFIGURATION_INVALID: The repository's Mergify configuration is invalid. extended_repository names the repository its extends points to when the error is in that repository's configuration file, and is null otherwise, including when the error only appears once the two configurations are merged. The route's other 422s carry no error_code.
Body: ConfigurationInvalidBody
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
Application key permission: merge_queue: read.
repository string required The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
branch string The name of the branch
200 Successful Response
serial parallel isolatedWhether the repository queues a pull request on its own once it matches its conditions.
Deprecated: it does not count a resolution Mergify pushes into a pull request, so it can be true where conflicts are resolved. Do not rely on it: the API versions released after 2026-11-20 leave it out. true when the repository names conflict_resolvers but no queue rule lands a batch Mergify builds, so no conflict is resolved in a batch of the merge queue: every rule merges each pull request on its own (merge_method merge, squash or rebase) or checks it in place. A queue rule with merge_method: merge-batch lands its batches, and so does one with fast-forward unless its checks run in place. false otherwise, whatever the queue holds.
Example 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,
"succeeded": 45,
"failed": 0,
"running": 20,
"pending": 2
},
"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,
"succeeded": 15,
"failed": 3,
"running": 8,
"pending": 2
},
"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,
"succeeded": 15,
"failed": 0,
"running": 0,
"pending": 0
},
"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,
"succeeded": 0,
"failed": 0,
"running": 13,
"pending": 0
},
"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"
],
"waiting_reason": {
"code": "waiting_for_batch",
"pull_request_numbers": [],
"scopes": [],
"blocks_every_scope": false
}
}
],
"auto_queue": false,
"check_slots": {
"in_use": 2,
"capacity": 3
},
"automatic_conflict_resolution_unsupported": false
}
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves, each at the newest point this server serves (YYYY-MM-DD.N).
Body: APIVersionUnknownBody
APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
CONFIGURATION_INVALID: The repository's Mergify configuration is invalid. extended_repository names the repository its extends points to when the error is in that repository's configuration file, and is null otherwise, including when the error only appears once the two configurations are merged. The route's other 422s carry no error_code.
Body: ConfigurationInvalidBody
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
Application key permission: merge_queue: read.
pr_number integer required The pull request number
min: 1 · max: 9223372036854776000
repository string required The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
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
When the checks of this pull request's batch will time out. Null when no checks timeout applies, while no checks run (before they first start, and until a new draft's start), and once they concluded: the time the batch waits does not count. Checks that read pending again, or start over on an edit to the batch branch or a new draft, get a whole timeout from then.
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
},
"run_id": "string",
"head_sha": "string",
"queue_branch_name": "string"
},
"waiting_reason": {
"code": "waiting_for_base",
"pull_request_numbers": [
1
],
"scopes": [
"string"
],
"blocks_every_scope": true
}
}
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves, each at the newest point this server serves (YYYY-MM-DD.N).
Body: APIVersionUnknownBody
APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
PULL_REQUEST_NOT_QUEUED: The pull request is not in any merge queue of the repository.
Body: APIErrorBody
CONFIGURATION_INVALID: The repository's Mergify configuration is invalid. extended_repository names the repository its extends points to when the error is in that repository's configuration file, and is null otherwise, including when the error only appears once the two configurations are merged. The route's other 422s carry no error_code.
Body: ConfigurationInvalidBody
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
Application key permission: merge_queue: write.
pr_number integer required The pull request number
min: 1 · max: 9223372036854776000
repository string required The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
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
}
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves, each at the newest point this server serves (YYYY-MM-DD.N).
Body: APIVersionUnknownBody
REPOSITORY_WRITE_ROLE_REQUIRED: The caller has read access to this private repository, not write access. APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
PULL_REQUEST_NOT_QUEUED: The pull request is not in any merge queue of the repository.
Body: APIErrorBody
CONFIGURATION_INVALID: The repository's Mergify configuration is invalid. extended_repository names the repository its extends points to when the error is in that repository's configuration file, and is null otherwise, including when the error only appears once the two configurations are merged. The route's other 422s carry no error_code.
Body: ConfigurationInvalidBody
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/merge-queue/pull/:pr_number/dequeue-impact" \
-H "Authorization: Bearer <token>" Queue a pull request #
/repos/{owner}/{repository}/merge-queue/pull/{pr_number}/queue Add the given pull request to the merge queue, as the queue command does: it waits until it matches the queue_conditions of a queue rule, then enters the queue under the first one it matches. The request is accepted once checked; the pull request's queue status and the repository's events tell what became of it. A pull request that is queued, leaving the queue, or already has a queue request pending is refused.
Application key permission: merge_queue: write.
pr_number integer required The pull request number
min: -2147483648 · max: 2147483647
repository string required The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
202 Successful Response
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves, each at the newest point this server serves (YYYY-MM-DD.N).
Body: APIVersionUnknownBody
COMMAND_RESTRICTED: The commands_restrictions of the configuration do not let the caller run this command on the pull request. REPOSITORY_WRITE_ROLE_REQUIRED: The caller has read access to this private repository, not write access. APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
PULL_REQUEST_NOT_FOUND: The repository has no such pull request.
Body: APIErrorBody
PULL_REQUEST_NOT_QUEUEABLE: The pull request cannot be queued: it is closed, merged or locked, or it is a pull request the merge queue opened itself. PULL_REQUEST_ALREADY_QUEUED: The pull request is already in a merge queue of the repository. PULL_REQUEST_LEAVING_QUEUE: The pull request is being removed from the merge queue. It can be queued again once it has left, a few seconds later. PULL_REQUEST_QUEUE_REQUESTED: A queue request for the pull request is already pending: it enters the queue once it matches the queue conditions of a queue rule. MERGE_QUEUE_DISABLED: The merge queue is not enabled on the repository.
Body: APIErrorBody
CONFIGURATION_INVALID: The repository's Mergify configuration is invalid. extended_repository names the repository its extends points to when the error is in that repository's configuration file, and is null otherwise, including when the error only appears once the two configurations are merged. The route's other 422s carry no error_code.
Body: ConfigurationInvalidBody
Example Request
curl -X POST "https://api.mergify.com/v1/repos/:owner/:repository/merge-queue/pull/:pr_number/queue" \
-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, or cancel its queue request while it waits for the queue conditions of its queue rule
Application key permission: merge_queue: write.
pr_number integer required The pull request number
min: -2147483648 · max: 2147483647
repository string required The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves, each at the newest point this server serves (YYYY-MM-DD.N).
Body: APIVersionUnknownBody
COMMAND_RESTRICTED: The commands_restrictions of the configuration do not let the caller run this command on the pull request. REPOSITORY_WRITE_ROLE_REQUIRED: The caller has read access to this private repository, not write access. APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
PULL_REQUEST_NOT_QUEUED: The pull request is not in any merge queue of the repository.
Body: APIErrorBody
CONFIGURATION_INVALID: The repository's Mergify configuration is invalid. extended_repository names the repository its extends points to when the error is in that repository's configuration file, and is null otherwise, including when the error only appears once the two configurations are merged. The route's other 422s carry no error_code.
Body: ConfigurationInvalidBody
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
Application key permission: merge_queue_pause: write.
repository string required The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
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"
}
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves, each at the newest point this server serves (YYYY-MM-DD.N).
Body: APIVersionUnknownBody
REPOSITORY_WRITE_ROLE_REQUIRED: The caller has read access to this private repository, not write access. APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
CONFIGURATION_INVALID: The repository's Mergify configuration is invalid. extended_repository names the repository its extends points to when the error is in that repository's configuration file, and is null otherwise, including when the error only appears once the two configurations are merged. The route's other 422s carry no error_code.
Body: ConfigurationInvalidBody
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
Application key permission: merge_queue_pause: write.
repository string required The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves, each at the newest point this server serves (YYYY-MM-DD.N).
Body: APIVersionUnknownBody
REPOSITORY_WRITE_ROLE_REQUIRED: The caller has read access to this private repository, not write access. APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
CONFIGURATION_INVALID: it works whatever the state of the repository's Mergify configuration. That body stays described for the clients that read it.
Body: ConfigurationInvalidBody
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
Application key permission: merge_queue: read.
repository string required The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
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"
}
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves, each at the newest point this server serves (YYYY-MM-DD.N).
Body: APIVersionUnknownBody
APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
CONFIGURATION_INVALID: it works whatever the state of the repository's Mergify configuration. That body stays described for the clients that read it.
Body: ConfigurationInvalidBody
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/merge-queue/pause" \
-H "Authorization: Bearer <token>" List the pull requests nobody has queued #
/repos/{owner}/{repository}/merge-queue/unqueued-pulls List the open pull requests of a branch that nobody has queued and whose merge queue check reports them ready to queue or waiting for their queue conditions. A pull request the merge queue dequeued keeps the check that says why until its next push, and is not listed until then.
Application key permission: merge_queue: read.
repository string required The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
branch string required The base branch of the pull requests
min length: 1 · max length: 255
state "ready" | "waiting_for_conditions" Only list the pull requests in this state
cursor string The opaque cursor of the current page. Must be extracted from RFC 5988 pagination links to get the previous/next pages
per_page integer The number of items per page
min: 1 · max: 100
200 Successful Response
The number of items in this page
The number of items per page
Whether the repository queues a pull request on its own once it matches its conditions. None is then listed ready: a waiting_for_conditions one is queued without anyone once it matches, or can be queued by hand before.
Example Response
{
"size": 0,
"per_page": 0,
"pull_requests": [
{
"number": 1,
"title": "string",
"url": "string",
"author": {},
"state": "ready"
}
],
"counts": {
"ready": 0,
"waiting_for_conditions": 0
},
"auto_queue": true
}
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves, each at the newest point this server serves (YYYY-MM-DD.N).
Body: APIVersionUnknownBody
APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
CONFIGURATION_INVALID: The repository's Mergify configuration is invalid. extended_repository names the repository its extends points to when the error is in that repository's configuration file, and is null otherwise, including when the error only appears once the two configurations are merged. The route's other 422s carry no error_code.
Body: ConfigurationInvalidBody
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/merge-queue/unqueued-pulls" \
-H "Authorization: Bearer <token>" List the merge queue policies of an organization #
/orgs/{owner}/merge-queue/policies List the organization's own merge queue policies, which apply to the repositories and base branches their targets hold. A repository's own policies are listed under the repository. For a caller who is not an organization admin, a target's repositories hold only the names of the repositories that caller can see in Mergify, beside the glob patterns and ~ALL. A policy targeting none of those is not listed.
Application key permission: merge_queue_settings: read.
owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
repository string Only the policies whose target holds the repository of this name, or may: one of its glob patterns gave up on the name. For a caller who is not an organization admin, only a repository that caller can read has any.
max length: 255
200 Successful Response
Example Response
{
"policies": [
{
"id": "string",
"name": "string",
"enforcement": "active",
"repository": "string",
"target": {},
"settings": {},
"created_at": "2024-01-15T09:00:00Z",
"created_by": {},
"updated_at": "2024-01-15T09:00:00Z",
"updated_by": {}
}
]
}
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves, each at the newest point this server serves (YYYY-MM-DD.N).
Body: APIVersionUnknownBody
APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
Example Request
curl -X GET "https://api.mergify.com/v1/orgs/:owner/merge-queue/policies" \
-H "Authorization: Bearer <token>" Create a merge queue policy for an organization #
/orgs/{owner}/merge-queue/policies Add a merge queue policy to the organization. Its repositories' merge queues apply it on their next pass. Requires the organization admin role.
Application key permission: merge_queue_settings: write.
owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
The policy's name, unique among the policies of its scope
active applies the policy; disabled keeps it listed without applying it
active disabled201 Successful Response
active applies the policy; disabled keeps it listed without applying it
active disabledThe repository holding the policy; null for an organization's
Example Response
{
"id": "string",
"name": "string",
"enforcement": "active",
"repository": "string",
"target": {
"repositories": {
"include_patterns": null,
"exclude_patterns": null
},
"branches": {
"include_patterns": null,
"exclude_patterns": null
}
},
"settings": {
"batch_pull_request": true
},
"created_at": "2024-01-15T09:00:00Z",
"created_by": {
"type": "application",
"id": 0,
"name": "string"
},
"updated_at": "2024-01-15T09:00:00Z",
"updated_by": {
"type": "application",
"id": 0,
"name": "string"
}
}
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves, each at the newest point this server serves (YYYY-MM-DD.N).
Body: APIVersionUnknownBody
APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
MERGE_QUEUE_POLICY_NAME_TAKEN: Another merge queue policy of the same organization or repository has this name. Pick another name, or edit that policy instead.
Body: APIErrorBody
MERGE_QUEUE_POLICY_LIMIT_REACHED: An organization, and a repository, hold at most 100 merge queue policies. Merge policies that set the same values, widen a pattern, or delete a policy instead. MERGE_QUEUE_POLICY_INVALID_PATTERN : A repository or branch pattern of the target is not a name, a glob pattern, ~ALL or, for branches, ~DEFAULT_BRANCH. Fix the pattern the error names.
Body: APIErrorBody
Example Request
curl -X POST "https://api.mergify.com/v1/orgs/:owner/merge-queue/policies" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"enforcement": "active",
"target": {
"repositories": {
"include_patterns": null,
"exclude_patterns": null
},
"branches": {
"include_patterns": null,
"exclude_patterns": null
}
},
"settings": {
"batch_pull_request": true
}
}' Get a merge queue policy of an organization #
/orgs/{owner}/merge-queue/policies/{policy_id} Get one of the organization's own merge queue policies. For a caller who is not an organization admin, a target's repositories hold only the names of the repositories that caller can see in Mergify, beside the glob patterns and ~ALL. A policy targeting none of those is not found.
Application key permission: merge_queue_settings: read.
policy_id string <uuid> required The id of the policy
owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
200 Successful Response
active applies the policy; disabled keeps it listed without applying it
active disabledThe repository holding the policy; null for an organization's
Example Response
{
"id": "string",
"name": "string",
"enforcement": "active",
"repository": "string",
"target": {
"repositories": {
"include_patterns": null,
"exclude_patterns": null
},
"branches": {
"include_patterns": null,
"exclude_patterns": null
}
},
"settings": {
"batch_pull_request": true
},
"created_at": "2024-01-15T09:00:00Z",
"created_by": {
"type": "application",
"id": 0,
"name": "string"
},
"updated_at": "2024-01-15T09:00:00Z",
"updated_by": {
"type": "application",
"id": 0,
"name": "string"
}
}
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves, each at the newest point this server serves (YYYY-MM-DD.N).
Body: APIVersionUnknownBody
APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
MERGE_QUEUE_POLICY_NOT_FOUND: There is no merge queue policy with this id here. List the policies to find the id of the one you meant.
Body: APIErrorBody
Example Request
curl -X GET "https://api.mergify.com/v1/orgs/:owner/merge-queue/policies/:policy_id" \
-H "Authorization: Bearer <token>" Update a merge queue policy of an organization #
/orgs/{owner}/merge-queue/policies/{policy_id} Change an organization's merge queue policy: a field left out keeps its value. Its repositories' merge queues apply it on their next pass. Requires the organization admin role.
Application key permission: merge_queue_settings: write.
policy_id string <uuid> required The id of the policy
owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
The policy's name, unique among the policies of its scope
active applies the policy; disabled keeps it listed without applying it
active disabled200 Successful Response
active applies the policy; disabled keeps it listed without applying it
active disabledThe repository holding the policy; null for an organization's
Example Response
{
"id": "string",
"name": "string",
"enforcement": "active",
"repository": "string",
"target": {
"repositories": {
"include_patterns": null,
"exclude_patterns": null
},
"branches": {
"include_patterns": null,
"exclude_patterns": null
}
},
"settings": {
"batch_pull_request": true
},
"created_at": "2024-01-15T09:00:00Z",
"created_by": {
"type": "application",
"id": 0,
"name": "string"
},
"updated_at": "2024-01-15T09:00:00Z",
"updated_by": {
"type": "application",
"id": 0,
"name": "string"
}
}
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves, each at the newest point this server serves (YYYY-MM-DD.N).
Body: APIVersionUnknownBody
APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
MERGE_QUEUE_POLICY_NOT_FOUND: There is no merge queue policy with this id here. List the policies to find the id of the one you meant.
Body: APIErrorBody
MERGE_QUEUE_POLICY_NAME_TAKEN: Another merge queue policy of the same organization or repository has this name. Pick another name, or edit that policy instead.
Body: APIErrorBody
MERGE_QUEUE_POLICY_INVALID_PATTERN : A repository or branch pattern of the target is not a name, a glob pattern, ~ALL or, for branches, ~DEFAULT_BRANCH. Fix the pattern the error names.
Body: APIErrorBody
Example Request
curl -X PATCH "https://api.mergify.com/v1/orgs/:owner/merge-queue/policies/:policy_id" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"enforcement": "active",
"settings": {
"batch_pull_request": true
},
"target": {
"repositories": {
"include_patterns": null,
"exclude_patterns": null
},
"branches": {
"include_patterns": null,
"exclude_patterns": null
}
}
}' Delete a merge queue policy of an organization #
/orgs/{owner}/merge-queue/policies/{policy_id} Delete an organization's merge queue policy. Its repositories' merge queues apply the change on their next pass. Requires the organization admin role.
Application key permission: merge_queue_settings: write.
policy_id string <uuid> required The id of the policy
owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves, each at the newest point this server serves (YYYY-MM-DD.N).
Body: APIVersionUnknownBody
APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
MERGE_QUEUE_POLICY_NOT_FOUND: There is no merge queue policy with this id here. List the policies to find the id of the one you meant.
Body: APIErrorBody
Example Request
curl -X DELETE "https://api.mergify.com/v1/orgs/:owner/merge-queue/policies/:policy_id" \
-H "Authorization: Bearer <token>" Simulate a merge queue policy #
/orgs/{owner}/merge-queue/simulator/policies Preview what a merge queue policy would change before it is created or saved: the base branches with a merge queue whose settings it changes, and the queue rules that need a draft pull request on the branches it turns drafts off for. Nothing is saved. Every active merge queue policy whose target holds a base branch applies to it, with no order between them. For each setting, a branch gets the default when no policy that applies sets it, their value when they agree, and the safest value when they disagree: for batch_pull_request, true, a draft pull request, which works with any CI. A policy one of whose glob patterns gives up on the repository or branch name may apply: the branch gets the safest of the values it could get.
Application key permission: merge_queue_settings: read.
owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
The policy the body would replace, to preview an edit; left out for a new policy
The repository that would hold the policy; left out for an organization's policy
active applies the policy; disabled keeps it listed without applying it
active disabled200 Successful Response
false when the policy changes more base branches than the 2000 listed, the first ones by repository and branch name: narrow the target to preview the rest. Also false when the organization has more than 50,000 base branches with a merge queue, of which a simulation reads the first ones
false when some repositories' configurations were not read: past the first 20 repositories, or when one could not be read. Their queue rules are checked when a pull request is queued. Also false when more than 2,000 queue rules need a draft, of which the first ones are listed
Example Response
{
"branches": [
{
"repository": "string",
"branch": "string",
"before": {},
"after": {}
}
],
"branches_complete": true,
"draft_needs": [
{
"repository": "string",
"branch": "string",
"queue_rule": "string",
"reason": "string"
}
],
"draft_needs_complete": true
}
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves, each at the newest point this server serves (YYYY-MM-DD.N).
Body: APIVersionUnknownBody
APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
MERGE_QUEUE_POLICY_INVALID_PATTERN : A repository or branch pattern of the target is not a name, a glob pattern, ~ALL or, for branches, ~DEFAULT_BRANCH. Fix the pattern the error names.
Body: APIErrorBody
Example Request
curl -X POST "https://api.mergify.com/v1/orgs/:owner/merge-queue/simulator/policies" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"policy_id": "string",
"repository": "string",
"enforcement": "active",
"target": {
"repositories": {
"include_patterns": null,
"exclude_patterns": null
},
"branches": {
"include_patterns": null,
"exclude_patterns": null
}
},
"settings": {
"batch_pull_request": true
}
}' List the base branches with a merge queue in an organization #
/orgs/{owner}/merge-queue/branches List the names of the base branches the merge queue has run on in the organization's repositories, each listed once, to pick a merge queue policy's branches from.
Application key permission: merge_queue_settings: read.
owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
200 Successful Response
false when there are more names than the 1,000 listed: the ones left out are those of the fewest repositories
Example Response
{
"branches": [
{
"name": "string"
}
],
"branches_complete": true
}
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves, each at the newest point this server serves (YYYY-MM-DD.N).
Body: APIVersionUnknownBody
APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
Example Request
curl -X GET "https://api.mergify.com/v1/orgs/:owner/merge-queue/branches" \
-H "Authorization: Bearer <token>" Get the merge queue settings a base branch uses #
/orgs/{owner}/repositories/{repository}/merge-queue/branches/{branch_name}/settings Get the merge queue settings a base branch uses, every policy that applies to it, and how each value was settled. Any branch name works, whether or not the branch exists. Every active merge queue policy whose target holds a base branch applies to it, with no order between them. For each setting, a branch gets the default when no policy that applies sets it, their value when they agree, and the safest value when they disagree: for batch_pull_request, true, a draft pull request, which works with any CI. A policy one of whose glob patterns gives up on the repository or branch name may apply: the branch gets the safest of the values it could get.
Application key permission: merge_queue_settings: read.
branch_name string required The name of the base branch
min length: 1 · max length: 255
repository string required The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
200 Successful Response
The name of the base branch
Example Response
{
"branch": "string",
"settings": {
"batch_pull_request": true
},
"decisions": {
"batch_pull_request": {
"rule": "default",
"policy_ids": null
}
},
"policies": [
{
"id": "string",
"name": "string",
"repository": "string",
"level": "organization",
"target": {},
"settings": {},
"pattern_gave_up": true
}
],
"sources": {
"batch_pull_request": {
"level": "branch",
"branch_pattern": "string"
}
}
}
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves, each at the newest point this server serves (YYYY-MM-DD.N).
Body: APIVersionUnknownBody
APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
Example Request
curl -X GET "https://api.mergify.com/v1/orgs/:owner/repositories/:repository/merge-queue/branches/:branch_name/settings" \
-H "Authorization: Bearer <token>" List the merge queue policies of a repository #
/orgs/{owner}/repositories/{repository}/merge-queue/policies List the repository's own merge queue policies. The organization's policies that target the repository are listed under the organization, with ?repository=.
Application key permission: merge_queue_settings: read.
repository string required The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
200 Successful Response
Example Response
{
"policies": [
{
"id": "string",
"name": "string",
"enforcement": "active",
"repository": "string",
"target": {},
"settings": {},
"created_at": "2024-01-15T09:00:00Z",
"created_by": {},
"updated_at": "2024-01-15T09:00:00Z",
"updated_by": {}
}
]
}
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves, each at the newest point this server serves (YYYY-MM-DD.N).
Body: APIVersionUnknownBody
APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
Example Request
curl -X GET "https://api.mergify.com/v1/orgs/:owner/repositories/:repository/merge-queue/policies" \
-H "Authorization: Bearer <token>" Create a merge queue policy for a repository #
/orgs/{owner}/repositories/{repository}/merge-queue/policies Add a merge queue policy to the repository. The repository's merge queues apply it right away. Requires the admin role.
Application key permission: merge_queue_settings: write.
repository string required The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
The policy's name, unique among the policies of its scope
active applies the policy; disabled keeps it listed without applying it
active disabled201 Successful Response
active applies the policy; disabled keeps it listed without applying it
active disabledThe repository holding the policy; null for an organization's
Example Response
{
"id": "string",
"name": "string",
"enforcement": "active",
"repository": "string",
"target": {
"repositories": {
"include_patterns": null,
"exclude_patterns": null
},
"branches": {
"include_patterns": null,
"exclude_patterns": null
}
},
"settings": {
"batch_pull_request": true
},
"created_at": "2024-01-15T09:00:00Z",
"created_by": {
"type": "application",
"id": 0,
"name": "string"
},
"updated_at": "2024-01-15T09:00:00Z",
"updated_by": {
"type": "application",
"id": 0,
"name": "string"
}
}
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves, each at the newest point this server serves (YYYY-MM-DD.N).
Body: APIVersionUnknownBody
REPOSITORY_ADMIN_ROLE_REQUIRED: The caller does not have admin access to the repository. APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
MERGE_QUEUE_POLICY_NAME_TAKEN: Another merge queue policy of the same organization or repository has this name. Pick another name, or edit that policy instead.
Body: APIErrorBody
MERGE_QUEUE_POLICY_LIMIT_REACHED: An organization, and a repository, hold at most 100 merge queue policies. Merge policies that set the same values, widen a pattern, or delete a policy instead. MERGE_QUEUE_POLICY_INVALID_PATTERN : A repository or branch pattern of the target is not a name, a glob pattern, ~ALL or, for branches, ~DEFAULT_BRANCH. Fix the pattern the error names.
Body: APIErrorBody
Example Request
curl -X POST "https://api.mergify.com/v1/orgs/:owner/repositories/:repository/merge-queue/policies" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"enforcement": "active",
"target": {
"branches": {
"include_patterns": null,
"exclude_patterns": null
}
},
"settings": {
"batch_pull_request": true
}
}' Get a merge queue policy of a repository #
/orgs/{owner}/repositories/{repository}/merge-queue/policies/{policy_id} Get one of the repository's own merge queue policies.
Application key permission: merge_queue_settings: read.
policy_id string <uuid> required The id of the policy
repository string required The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
200 Successful Response
active applies the policy; disabled keeps it listed without applying it
active disabledThe repository holding the policy; null for an organization's
Example Response
{
"id": "string",
"name": "string",
"enforcement": "active",
"repository": "string",
"target": {
"repositories": {
"include_patterns": null,
"exclude_patterns": null
},
"branches": {
"include_patterns": null,
"exclude_patterns": null
}
},
"settings": {
"batch_pull_request": true
},
"created_at": "2024-01-15T09:00:00Z",
"created_by": {
"type": "application",
"id": 0,
"name": "string"
},
"updated_at": "2024-01-15T09:00:00Z",
"updated_by": {
"type": "application",
"id": 0,
"name": "string"
}
}
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves, each at the newest point this server serves (YYYY-MM-DD.N).
Body: APIVersionUnknownBody
APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
MERGE_QUEUE_POLICY_NOT_FOUND: There is no merge queue policy with this id here. List the policies to find the id of the one you meant.
Body: APIErrorBody
Example Request
curl -X GET "https://api.mergify.com/v1/orgs/:owner/repositories/:repository/merge-queue/policies/:policy_id" \
-H "Authorization: Bearer <token>" Update a merge queue policy of a repository #
/orgs/{owner}/repositories/{repository}/merge-queue/policies/{policy_id} Change a repository's merge queue policy: a field left out keeps its value. The repository's merge queues apply it right away. Requires the admin role.
Application key permission: merge_queue_settings: write.
policy_id string <uuid> required The id of the policy
repository string required The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
The policy's name, unique among the policies of its scope
active applies the policy; disabled keeps it listed without applying it
active disabled200 Successful Response
active applies the policy; disabled keeps it listed without applying it
active disabledThe repository holding the policy; null for an organization's
Example Response
{
"id": "string",
"name": "string",
"enforcement": "active",
"repository": "string",
"target": {
"repositories": {
"include_patterns": null,
"exclude_patterns": null
},
"branches": {
"include_patterns": null,
"exclude_patterns": null
}
},
"settings": {
"batch_pull_request": true
},
"created_at": "2024-01-15T09:00:00Z",
"created_by": {
"type": "application",
"id": 0,
"name": "string"
},
"updated_at": "2024-01-15T09:00:00Z",
"updated_by": {
"type": "application",
"id": 0,
"name": "string"
}
}
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves, each at the newest point this server serves (YYYY-MM-DD.N).
Body: APIVersionUnknownBody
REPOSITORY_ADMIN_ROLE_REQUIRED: The caller does not have admin access to the repository. APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
MERGE_QUEUE_POLICY_NOT_FOUND: There is no merge queue policy with this id here. List the policies to find the id of the one you meant.
Body: APIErrorBody
MERGE_QUEUE_POLICY_NAME_TAKEN: Another merge queue policy of the same organization or repository has this name. Pick another name, or edit that policy instead.
Body: APIErrorBody
MERGE_QUEUE_POLICY_INVALID_PATTERN : A repository or branch pattern of the target is not a name, a glob pattern, ~ALL or, for branches, ~DEFAULT_BRANCH. Fix the pattern the error names.
Body: APIErrorBody
Example Request
curl -X PATCH "https://api.mergify.com/v1/orgs/:owner/repositories/:repository/merge-queue/policies/:policy_id" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"enforcement": "active",
"settings": {
"batch_pull_request": true
},
"target": {
"branches": {
"include_patterns": null,
"exclude_patterns": null
}
}
}' Delete a merge queue policy of a repository #
/orgs/{owner}/repositories/{repository}/merge-queue/policies/{policy_id} Delete a repository's merge queue policy. The repository's merge queues apply the change right away. Requires the admin role.
Application key permission: merge_queue_settings: write.
policy_id string <uuid> required The id of the policy
repository string required The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves, each at the newest point this server serves (YYYY-MM-DD.N).
Body: APIVersionUnknownBody
REPOSITORY_ADMIN_ROLE_REQUIRED: The caller does not have admin access to the repository. APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
MERGE_QUEUE_POLICY_NOT_FOUND: There is no merge queue policy with this id here. List the policies to find the id of the one you meant.
Body: APIErrorBody
Example Request
curl -X DELETE "https://api.mergify.com/v1/orgs/:owner/repositories/:repository/merge-queue/policies/:policy_id" \
-H "Authorization: Bearer <token>" Error response bodies #
An endpoint lists each error status it returns and links to the body that comes with it.
APIVersionUnknownBody
ACTIVITY_LOG_METADATA_FILTER_NOT_INDEXED API_VERSION_NOT_NEWER API_VERSION_ROLLBACK_UNAVAILABLE API_VERSION_UNKNOWN APPLICATION_KEY_EXPIRED APPLICATION_KEY_REFUSED AUTO_QUARANTINE_CONFIG_NOT_FOUND CI_ADMIN_ROLE_REQUIRED CI_ID_TOKEN_AUDIENCE_REFUSED CI_ID_TOKEN_EXCHANGE_NOT_FOUND CI_ID_TOKEN_EXPIRED CI_ID_TOKEN_INVALID CI_ID_TOKEN_ISSUER_REFUSED CI_ID_TOKEN_ISSUER_UNAVAILABLE CI_ID_TOKEN_NO_MATCHING_TRUST_POLICY CI_ID_TOKEN_NO_TRUST_POLICY CI_ID_TOKEN_REPOSITORY_NOT_INSTALLED CI_TOKEN_REFUSED CI_TOKEN_SCOPES_TARGET_REFUSED CI_TRACES_UPLOAD_UNUSABLE CI_TRUST_POLICY_GRANT_REFUSED CI_TRUST_POLICY_LIMIT_REACHED CI_TRUST_POLICY_NAME_TAKEN CI_TRUST_POLICY_NOT_FOUND CI_TRUST_POLICY_REPOSITORY_UNKNOWN COMMAND_RESTRICTED CONFIGURATION_BRANCH_REFUSED CONFIGURATION_GITHUB_APP_ACCESS_REQUIRED CONFIGURATION_INVALID CONFIGURATION_REFUSED_BY_REPOSITORY_RULES CONFIGURATION_SIGNED_COMMITS_REQUIRED DEFAULT_BRANCH_NOT_FOUND FLAKY_DETECTION_NOT_CONFIGURED GITHUB_ACCOUNT_SUSPENDED GITHUB_APP_ACCESS_LOST GITHUB_RATE_LIMITED GITHUB_TOKEN_NOT_ACCEPTED GITHUB_TWO_FACTOR_AUTHENTICATION_NONCOMPLIANT GITHUB_UPSTREAM_REQUEST_FORBIDDEN GITHUB_UPSTREAM_REQUEST_REJECTED GITHUB_UPSTREAM_UNAVAILABLE INTEGRATION_NOT_CONFIGURED INVALID_CURSOR IP_ALLOW_LIST_NOT_CONFIGURED KNOWN_TESTS_BEING_COMPUTED KNOWN_TESTS_NOT_SERVED MERGE_QUEUE_DISABLED MERGE_QUEUE_POLICY_INVALID_PATTERN MERGE_QUEUE_POLICY_LIMIT_REACHED MERGE_QUEUE_POLICY_NAME_TAKEN MERGE_QUEUE_POLICY_NOT_FOUND MERGE_QUEUE_SETTING_INVALID_BRANCH_PATTERN MERGE_QUEUE_SETTING_NOT_AVAILABLE MERGE_QUEUE_SETTING_TOO_MANY_BRANCH_PATTERNS NOT_GENERALLY_AVAILABLE NO_LOGIN_IN_PROGRESS ORGANIZATION_MEMBERS_ONLY PULL_REQUEST_ALREADY_QUEUED PULL_REQUEST_LEAVING_QUEUE PULL_REQUEST_NOT_FOUND PULL_REQUEST_NOT_QUEUEABLE PULL_REQUEST_NOT_QUEUED PULL_REQUEST_QUEUE_REQUESTED PULL_REQUEST_UNREADABLE REPOSITORY_ADMIN_ROLE_REQUIRED REPOSITORY_READ_ROLE_REQUIRED REPOSITORY_WRITE_ROLE_REQUIRED RETRY_RULE_NOT_FOUND ROLE_ALREADY_GRANTED ROLE_CHANGE_REFUSED ROLE_GRANTEE_REFUSED ROLE_GRANT_NOT_FOUND SAML_ENFORCEMENT_NOT_AUTHORIZED SCHEDULED_FREEZE_NOT_FOUND SCOPES_COVERAGE_GLOB_TOO_COSTLY SCOPES_COVERAGE_MANUAL_SOURCE SCOPES_COVERAGE_PATH_NOT_FOUND SCOPES_COVERAGE_UNAVAILABLE SETTING_MANAGED_BY_ENV SETUP_ALREADY_DONE SETUP_TOKEN_MISMATCH STAFF_SESSION_REFUSED STATISTICS_SCOPE_PERIOD_TOO_LARGE SUBSCRIPTION_API_UNAVAILABLE SUBSCRIPTION_FEATURE_REQUIRED SUBSCRIPTION_INACTIVE SUBSCRIPTION_TOKEN_INVALID TEST_ALREADY_QUARANTINED TEST_BRANCH_NOT_TRACKED TEST_FAILURE_NOT_FOUND TEST_NOT_FOUND TEST_RESULTS_INGESTION_NOT_ENABLED TEST_RETRY_NOT_CONFIGURED TEST_STATE_NOT_FOUND TEST_STATE_OVERLAPExample Response
{
"detail": "string",
"error_code": "API_VERSION_UNKNOWN",
"documentation_url": "string",
"served_versions": [
"string"
]
}
CredentialRefusedBody
ACTIVITY_LOG_METADATA_FILTER_NOT_INDEXED API_VERSION_NOT_NEWER API_VERSION_ROLLBACK_UNAVAILABLE API_VERSION_UNKNOWN APPLICATION_KEY_EXPIRED APPLICATION_KEY_REFUSED AUTO_QUARANTINE_CONFIG_NOT_FOUND CI_ADMIN_ROLE_REQUIRED CI_ID_TOKEN_AUDIENCE_REFUSED CI_ID_TOKEN_EXCHANGE_NOT_FOUND CI_ID_TOKEN_EXPIRED CI_ID_TOKEN_INVALID CI_ID_TOKEN_ISSUER_REFUSED CI_ID_TOKEN_ISSUER_UNAVAILABLE CI_ID_TOKEN_NO_MATCHING_TRUST_POLICY CI_ID_TOKEN_NO_TRUST_POLICY CI_ID_TOKEN_REPOSITORY_NOT_INSTALLED CI_TOKEN_REFUSED CI_TOKEN_SCOPES_TARGET_REFUSED CI_TRACES_UPLOAD_UNUSABLE CI_TRUST_POLICY_GRANT_REFUSED CI_TRUST_POLICY_LIMIT_REACHED CI_TRUST_POLICY_NAME_TAKEN CI_TRUST_POLICY_NOT_FOUND CI_TRUST_POLICY_REPOSITORY_UNKNOWN COMMAND_RESTRICTED CONFIGURATION_BRANCH_REFUSED CONFIGURATION_GITHUB_APP_ACCESS_REQUIRED CONFIGURATION_INVALID CONFIGURATION_REFUSED_BY_REPOSITORY_RULES CONFIGURATION_SIGNED_COMMITS_REQUIRED DEFAULT_BRANCH_NOT_FOUND FLAKY_DETECTION_NOT_CONFIGURED GITHUB_ACCOUNT_SUSPENDED GITHUB_APP_ACCESS_LOST GITHUB_RATE_LIMITED GITHUB_TOKEN_NOT_ACCEPTED GITHUB_TWO_FACTOR_AUTHENTICATION_NONCOMPLIANT GITHUB_UPSTREAM_REQUEST_FORBIDDEN GITHUB_UPSTREAM_REQUEST_REJECTED GITHUB_UPSTREAM_UNAVAILABLE INTEGRATION_NOT_CONFIGURED INVALID_CURSOR IP_ALLOW_LIST_NOT_CONFIGURED KNOWN_TESTS_BEING_COMPUTED KNOWN_TESTS_NOT_SERVED MERGE_QUEUE_DISABLED MERGE_QUEUE_POLICY_INVALID_PATTERN MERGE_QUEUE_POLICY_LIMIT_REACHED MERGE_QUEUE_POLICY_NAME_TAKEN MERGE_QUEUE_POLICY_NOT_FOUND MERGE_QUEUE_SETTING_INVALID_BRANCH_PATTERN MERGE_QUEUE_SETTING_NOT_AVAILABLE MERGE_QUEUE_SETTING_TOO_MANY_BRANCH_PATTERNS NOT_GENERALLY_AVAILABLE NO_LOGIN_IN_PROGRESS ORGANIZATION_MEMBERS_ONLY PULL_REQUEST_ALREADY_QUEUED PULL_REQUEST_LEAVING_QUEUE PULL_REQUEST_NOT_FOUND PULL_REQUEST_NOT_QUEUEABLE PULL_REQUEST_NOT_QUEUED PULL_REQUEST_QUEUE_REQUESTED PULL_REQUEST_UNREADABLE REPOSITORY_ADMIN_ROLE_REQUIRED REPOSITORY_READ_ROLE_REQUIRED REPOSITORY_WRITE_ROLE_REQUIRED RETRY_RULE_NOT_FOUND ROLE_ALREADY_GRANTED ROLE_CHANGE_REFUSED ROLE_GRANTEE_REFUSED ROLE_GRANT_NOT_FOUND SAML_ENFORCEMENT_NOT_AUTHORIZED SCHEDULED_FREEZE_NOT_FOUND SCOPES_COVERAGE_GLOB_TOO_COSTLY SCOPES_COVERAGE_MANUAL_SOURCE SCOPES_COVERAGE_PATH_NOT_FOUND SCOPES_COVERAGE_UNAVAILABLE SETTING_MANAGED_BY_ENV SETUP_ALREADY_DONE SETUP_TOKEN_MISMATCH STAFF_SESSION_REFUSED STATISTICS_SCOPE_PERIOD_TOO_LARGE SUBSCRIPTION_API_UNAVAILABLE SUBSCRIPTION_FEATURE_REQUIRED SUBSCRIPTION_INACTIVE SUBSCRIPTION_TOKEN_INVALID TEST_ALREADY_QUARANTINED TEST_BRANCH_NOT_TRACKED TEST_FAILURE_NOT_FOUND TEST_NOT_FOUND TEST_RESULTS_INGESTION_NOT_ENABLED TEST_RETRY_NOT_CONFIGURED TEST_STATE_NOT_FOUND TEST_STATE_OVERLAPExample Response
{
"detail": "string",
"error_code": "APPLICATION_KEY_REFUSED",
"documentation_url": "string",
"accepted_permissions": [
{
"resource": "merge_queue",
"access": "read"
}
]
}
ConfigurationInvalidBody
ACTIVITY_LOG_METADATA_FILTER_NOT_INDEXED API_VERSION_NOT_NEWER API_VERSION_ROLLBACK_UNAVAILABLE API_VERSION_UNKNOWN APPLICATION_KEY_EXPIRED APPLICATION_KEY_REFUSED AUTO_QUARANTINE_CONFIG_NOT_FOUND CI_ADMIN_ROLE_REQUIRED CI_ID_TOKEN_AUDIENCE_REFUSED CI_ID_TOKEN_EXCHANGE_NOT_FOUND CI_ID_TOKEN_EXPIRED CI_ID_TOKEN_INVALID CI_ID_TOKEN_ISSUER_REFUSED CI_ID_TOKEN_ISSUER_UNAVAILABLE CI_ID_TOKEN_NO_MATCHING_TRUST_POLICY CI_ID_TOKEN_NO_TRUST_POLICY CI_ID_TOKEN_REPOSITORY_NOT_INSTALLED CI_TOKEN_REFUSED CI_TOKEN_SCOPES_TARGET_REFUSED CI_TRACES_UPLOAD_UNUSABLE CI_TRUST_POLICY_GRANT_REFUSED CI_TRUST_POLICY_LIMIT_REACHED CI_TRUST_POLICY_NAME_TAKEN CI_TRUST_POLICY_NOT_FOUND CI_TRUST_POLICY_REPOSITORY_UNKNOWN COMMAND_RESTRICTED CONFIGURATION_BRANCH_REFUSED CONFIGURATION_GITHUB_APP_ACCESS_REQUIRED CONFIGURATION_INVALID CONFIGURATION_REFUSED_BY_REPOSITORY_RULES CONFIGURATION_SIGNED_COMMITS_REQUIRED DEFAULT_BRANCH_NOT_FOUND FLAKY_DETECTION_NOT_CONFIGURED GITHUB_ACCOUNT_SUSPENDED GITHUB_APP_ACCESS_LOST GITHUB_RATE_LIMITED GITHUB_TOKEN_NOT_ACCEPTED GITHUB_TWO_FACTOR_AUTHENTICATION_NONCOMPLIANT GITHUB_UPSTREAM_REQUEST_FORBIDDEN GITHUB_UPSTREAM_REQUEST_REJECTED GITHUB_UPSTREAM_UNAVAILABLE INTEGRATION_NOT_CONFIGURED INVALID_CURSOR IP_ALLOW_LIST_NOT_CONFIGURED KNOWN_TESTS_BEING_COMPUTED KNOWN_TESTS_NOT_SERVED MERGE_QUEUE_DISABLED MERGE_QUEUE_POLICY_INVALID_PATTERN MERGE_QUEUE_POLICY_LIMIT_REACHED MERGE_QUEUE_POLICY_NAME_TAKEN MERGE_QUEUE_POLICY_NOT_FOUND MERGE_QUEUE_SETTING_INVALID_BRANCH_PATTERN MERGE_QUEUE_SETTING_NOT_AVAILABLE MERGE_QUEUE_SETTING_TOO_MANY_BRANCH_PATTERNS NOT_GENERALLY_AVAILABLE NO_LOGIN_IN_PROGRESS ORGANIZATION_MEMBERS_ONLY PULL_REQUEST_ALREADY_QUEUED PULL_REQUEST_LEAVING_QUEUE PULL_REQUEST_NOT_FOUND PULL_REQUEST_NOT_QUEUEABLE PULL_REQUEST_NOT_QUEUED PULL_REQUEST_QUEUE_REQUESTED PULL_REQUEST_UNREADABLE REPOSITORY_ADMIN_ROLE_REQUIRED REPOSITORY_READ_ROLE_REQUIRED REPOSITORY_WRITE_ROLE_REQUIRED RETRY_RULE_NOT_FOUND ROLE_ALREADY_GRANTED ROLE_CHANGE_REFUSED ROLE_GRANTEE_REFUSED ROLE_GRANT_NOT_FOUND SAML_ENFORCEMENT_NOT_AUTHORIZED SCHEDULED_FREEZE_NOT_FOUND SCOPES_COVERAGE_GLOB_TOO_COSTLY SCOPES_COVERAGE_MANUAL_SOURCE SCOPES_COVERAGE_PATH_NOT_FOUND SCOPES_COVERAGE_UNAVAILABLE SETTING_MANAGED_BY_ENV SETUP_ALREADY_DONE SETUP_TOKEN_MISMATCH STAFF_SESSION_REFUSED STATISTICS_SCOPE_PERIOD_TOO_LARGE SUBSCRIPTION_API_UNAVAILABLE SUBSCRIPTION_FEATURE_REQUIRED SUBSCRIPTION_INACTIVE SUBSCRIPTION_TOKEN_INVALID TEST_ALREADY_QUARANTINED TEST_BRANCH_NOT_TRACKED TEST_FAILURE_NOT_FOUND TEST_NOT_FOUND TEST_RESULTS_INGESTION_NOT_ENABLED TEST_RETRY_NOT_CONFIGURED TEST_STATE_NOT_FOUND TEST_STATE_OVERLAPExample Response
{
"detail": "string",
"error_code": "CONFIGURATION_INVALID",
"documentation_url": "string",
"extended_repository": "string"
}
APIErrorBody
ACTIVITY_LOG_METADATA_FILTER_NOT_INDEXED API_VERSION_NOT_NEWER API_VERSION_ROLLBACK_UNAVAILABLE API_VERSION_UNKNOWN APPLICATION_KEY_EXPIRED APPLICATION_KEY_REFUSED AUTO_QUARANTINE_CONFIG_NOT_FOUND CI_ADMIN_ROLE_REQUIRED CI_ID_TOKEN_AUDIENCE_REFUSED CI_ID_TOKEN_EXCHANGE_NOT_FOUND CI_ID_TOKEN_EXPIRED CI_ID_TOKEN_INVALID CI_ID_TOKEN_ISSUER_REFUSED CI_ID_TOKEN_ISSUER_UNAVAILABLE CI_ID_TOKEN_NO_MATCHING_TRUST_POLICY CI_ID_TOKEN_NO_TRUST_POLICY CI_ID_TOKEN_REPOSITORY_NOT_INSTALLED CI_TOKEN_REFUSED CI_TOKEN_SCOPES_TARGET_REFUSED CI_TRACES_UPLOAD_UNUSABLE CI_TRUST_POLICY_GRANT_REFUSED CI_TRUST_POLICY_LIMIT_REACHED CI_TRUST_POLICY_NAME_TAKEN CI_TRUST_POLICY_NOT_FOUND CI_TRUST_POLICY_REPOSITORY_UNKNOWN COMMAND_RESTRICTED CONFIGURATION_BRANCH_REFUSED CONFIGURATION_GITHUB_APP_ACCESS_REQUIRED CONFIGURATION_INVALID CONFIGURATION_REFUSED_BY_REPOSITORY_RULES CONFIGURATION_SIGNED_COMMITS_REQUIRED DEFAULT_BRANCH_NOT_FOUND FLAKY_DETECTION_NOT_CONFIGURED GITHUB_ACCOUNT_SUSPENDED GITHUB_APP_ACCESS_LOST GITHUB_RATE_LIMITED GITHUB_TOKEN_NOT_ACCEPTED GITHUB_TWO_FACTOR_AUTHENTICATION_NONCOMPLIANT GITHUB_UPSTREAM_REQUEST_FORBIDDEN GITHUB_UPSTREAM_REQUEST_REJECTED GITHUB_UPSTREAM_UNAVAILABLE INTEGRATION_NOT_CONFIGURED INVALID_CURSOR IP_ALLOW_LIST_NOT_CONFIGURED KNOWN_TESTS_BEING_COMPUTED KNOWN_TESTS_NOT_SERVED MERGE_QUEUE_DISABLED MERGE_QUEUE_POLICY_INVALID_PATTERN MERGE_QUEUE_POLICY_LIMIT_REACHED MERGE_QUEUE_POLICY_NAME_TAKEN MERGE_QUEUE_POLICY_NOT_FOUND MERGE_QUEUE_SETTING_INVALID_BRANCH_PATTERN MERGE_QUEUE_SETTING_NOT_AVAILABLE MERGE_QUEUE_SETTING_TOO_MANY_BRANCH_PATTERNS NOT_GENERALLY_AVAILABLE NO_LOGIN_IN_PROGRESS ORGANIZATION_MEMBERS_ONLY PULL_REQUEST_ALREADY_QUEUED PULL_REQUEST_LEAVING_QUEUE PULL_REQUEST_NOT_FOUND PULL_REQUEST_NOT_QUEUEABLE PULL_REQUEST_NOT_QUEUED PULL_REQUEST_QUEUE_REQUESTED PULL_REQUEST_UNREADABLE REPOSITORY_ADMIN_ROLE_REQUIRED REPOSITORY_READ_ROLE_REQUIRED REPOSITORY_WRITE_ROLE_REQUIRED RETRY_RULE_NOT_FOUND ROLE_ALREADY_GRANTED ROLE_CHANGE_REFUSED ROLE_GRANTEE_REFUSED ROLE_GRANT_NOT_FOUND SAML_ENFORCEMENT_NOT_AUTHORIZED SCHEDULED_FREEZE_NOT_FOUND SCOPES_COVERAGE_GLOB_TOO_COSTLY SCOPES_COVERAGE_MANUAL_SOURCE SCOPES_COVERAGE_PATH_NOT_FOUND SCOPES_COVERAGE_UNAVAILABLE SETTING_MANAGED_BY_ENV SETUP_ALREADY_DONE SETUP_TOKEN_MISMATCH STAFF_SESSION_REFUSED STATISTICS_SCOPE_PERIOD_TOO_LARGE SUBSCRIPTION_API_UNAVAILABLE SUBSCRIPTION_FEATURE_REQUIRED SUBSCRIPTION_INACTIVE SUBSCRIPTION_TOKEN_INVALID TEST_ALREADY_QUARANTINED TEST_BRANCH_NOT_TRACKED TEST_FAILURE_NOT_FOUND TEST_NOT_FOUND TEST_RESULTS_INGESTION_NOT_ENABLED TEST_RETRY_NOT_CONFIGURED TEST_STATE_NOT_FOUND TEST_STATE_OVERLAPExample Response
{
"detail": "string",
"error_code": "MERGE_QUEUE_POLICY_NOT_FOUND",
"documentation_url": "string"
}
Was this page helpful?
Thanks for your feedback!