Queues

Configure and inspect merge queues for your repositories.


Get merge queues configuration #

GET /repos/{owner}/{repository}/queues/configuration
Deprecated

Get the list of all merge queues configuration sorted by processing order

Admin Application Key MergifyTokenBearerAuth GitHub Token
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
configurationQueueRule[]required

The queues configuration of the repository

namestringrequired

The name of the queue rule

configobjectrequired

The configuration of the queue rule

Example Response
                          {
  "configuration": [
    {
      "name": "string",
      "config": {}
    }
  ]
}
                        
403 Forbidden
404 Not found
409 Conflict
422 The configuration file is invalid.
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/queues/configuration" \
  -H "Authorization: Bearer <token>"

Pause the merge queue #

PUT /repos/{owner}/{repository}/queue/pause
Deprecated

Pause the merge of the requested repository

Admin Application Key MergifyTokenBearerAuth GitHub Token
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\-\.]+$

reasonstringrequired

The reason of the queue pause

max length: 255
200 Successful Response
queue_pauseQueuePause[]required

The pause of the repository

reasonstringrequired

The reason of the queue pause

max length: 255
pause_datestring <date-time>required

The date and time of the freeze

Example Response
                          {
  "queue_pause": [
    {
      "reason": "string",
      "pause_date": "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/queue/pause" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
  "reason": "string"
}'

Unpause merge queue #

DELETE /repos/{owner}/{repository}/queue/pause
Deprecated

Unpause the merge queue of the requested repository

Admin Application Key MergifyTokenBearerAuth GitHub Token
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/queue/pause" \
  -H "Authorization: Bearer <token>"

Get queue pause data #

GET /repos/{owner}/{repository}/queue/pause
Deprecated

Checks if the merge queue is paused and get the queue pause data

Admin Application Key MergifyTokenBearerAuth GitHub Token
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
queue_pauseQueuePause[]required

The pause of the repository

reasonstringrequired

The reason of the queue pause

max length: 255
pause_datestring <date-time>required

The date and time of the freeze

Example Response
                          {
  "queue_pause": [
    {
      "reason": "string",
      "pause_date": "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/queue/pause" \
  -H "Authorization: Bearer <token>"

Unpause merge queue #

POST /repos/{owner}/{repository}/queue/pause/delete
Deprecated

Unpause the merge queue of the requested repository

Admin Application Key MergifyTokenBearerAuth GitHub Token
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 POST "https://api.mergify.com/v1/repos/:owner/:repository/queue/pause/delete" \
  -H "Authorization: Bearer <token>"

Get merge queues #

GET /repos/{owner}/{repository}/queues
Deprecated

Get the list of pull requests queued in a merge queue of a repository

Admin Application Key MergifyTokenBearerAuth GitHub Token
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
queuesQueue[]required

The queues of the repository

branchBranchrequired

The branch of this queue

namestringrequired

The name of the branch

pull_requestsPullRequestQueued[]required

The pull requests in this queue

numberintegerrequired

The number of the pull request

min: 0 · max: 9223372036854776000
positionintegerrequired

The position of the pull request in the queue. The first pull request in the queue is at position 0

priorityintegerrequired

The priority of this pull request

effective_priorityintegerrequired

The effective priority of this pull request

priority_aliasstringrequired

The priority textual value of this pull request

queue_ruleQueueRulerequired

The queue rule associated to this pull request

namestringrequired

The name of the queue rule

configobjectrequired

The configuration of the queue rule

queued_atstring <date-time>required

The timestamp when the pull requested has entered in the queue

speculative_check_pull_requestQueues_SpeculativeCheckPullRequest | nullrequired

Use `mergeability_check` instead

in_placebooleanrequired

Whether the pull request has been checked in-place

numberintegerrequired

The number of the pull request used by the speculative check

min: 0 · max: 9223372036854776000
started_atstring <date-time> | nullrequired

The timestamp when the checks have started for this pull request

ended_atstring <date-time> | nullrequired

The timestamp when the checks have ended for this pull request

checksQueueCheck[]required

The list of pull request checks

namestringrequired

Check name

descriptionstringrequired

Check description

urlstring | nullrequired

Check detail url

details_urlstring | null

External integrator's direct URL (e.g. Jenkins build URL)

state"failure" | "error" | "cancelled" | "action_required" | "timed_out" | "pending" | "neutral" | "skipped" | "stale" | "success"required

Check state

Enum: failure error cancelled action_required timed_out pending neutral skipped stale success
avatar_urlstring | nullrequired

Check avatar_url

evaluated_conditionsstringrequired

The queue rule conditions evaluation report

state"failure" | "error" | "cancelled" | "action_required" | "timed_out" | "pending" | "neutral" | "skipped" | "stale" | "success"required

The global state of the checks

Enum: failure error cancelled action_required timed_out pending neutral skipped stale success
mergeability_checkBriefMergeabilityCheck | nullrequired

Information about the mergeability check currently processed

check_type"in_place" | "draft_pr" | "trusted"required

The type of queue check: `in_place` (checks run on the pull request itself), `draft_pr` (checks run on a Mergify draft pull request), or `trusted` (no fresh queue check ran; the pull request was merged trusting its own green CI because the base commits it was missing did not affect its scopes).

Enum: in_place draft_pr trusted
pull_request_numberintegerrequired

The number of the pull request used by the speculative check

min: 0 · max: 9223372036854776000
started_atstring <date-time> | nullrequired

The timestamp when the checks have started for this pull request

ended_atstring <date-time> | nullrequired

The timestamp when the checks have ended for this pull request

state"failure" | "error" | "cancelled" | "action_required" | "timed_out" | "pending" | "neutral" | "skipped" | "stale" | "success"required

The global state of the checks

Enum: failure error cancelled action_required timed_out pending neutral skipped stale success
estimated_time_of_mergestring <date-time> | nullrequired

The estimated timestamp when this pull request will be merged

partition_namestringrequired

The name of the partition, if any, in which the pull request is queued

Example Response
                          {
  "queues": [
    {
      "branch": {
        "name": "main"
      },
      "pull_requests": [
        {
          "number": 5678,
          "position": 1,
          "priority": 100,
          "effective_priority": 100,
          "priority_alias": "low",
          "partition_name": "__default__",
          "queue_rule": {
            "name": "default",
            "config": {
              "priority": 100,
              "batch_size": 1,
              "batch_max_wait_time": 0,
              "allow_inplace_checks": true,
              "allow_queue_branch_edit": false,
              "checks_timeout": 60,
              "draft_bot_account": "",
              "queue_branch_prefix": "mergify/merge-queue/",
              "queue_branch_merge_method": "fast-forward",
              "batch_max_failure_resolution_attempts": 10,
              "commit_message_template": "",
              "merge_bot_account": "",
              "merge_method": "merge",
              "update_bot_account": "",
              "update_method": "rebase"
            }
          },
          "speculative_check_pull_request": {
            "in_place": true,
            "number": 5678,
            "started_at": "2021-10-14T14:19:12+00:00",
            "ended_at": "2021-10-14T15:00:42+00:00",
            "checks": [],
            "evaluated_conditions": "",
            "state": "success"
          },
          "mergeability_check": {
            "check_type": "in_place",
            "pull_request_number": 5678,
            "started_at": "2021-10-14T14:19:12+00:00",
            "ended_at": "2021-10-14T15:00:42+00:00",
            "state": "success"
          },
          "queued_at": "2021-10-14T14:19:12+00:00",
          "estimated_time_of_merge": "2021-10-14T15:19:12+00:00"
        },
        {
          "number": 4242,
          "position": 1,
          "priority": 100,
          "effective_priority": 100,
          "priority_alias": "low",
          "partition_name": "__default__",
          "queue_rule": {
            "name": "default",
            "config": {
              "priority": 100,
              "batch_size": 1,
              "batch_max_wait_time": 0,
              "allow_inplace_checks": true,
              "allow_queue_branch_edit": false,
              "checks_timeout": 60,
              "draft_bot_account": "",
              "queue_branch_prefix": "mergify/merge-queue/",
              "queue_branch_merge_method": "fast-forward",
              "batch_max_failure_resolution_attempts": 10,
              "commit_message_template": "",
              "merge_bot_account": "",
              "merge_method": "merge",
              "update_bot_account": "",
              "update_method": "rebase"
            }
          },
          "speculative_check_pull_request": {
            "in_place": false,
            "number": 7899,
            "started_at": "2021-10-14T14:19:12+00:00",
            "ended_at": "2021-10-14T15:00:42+00:00",
            "checks": [],
            "evaluated_conditions": "",
            "state": "success"
          },
          "mergeability_check": {
            "check_type": "draft_pr",
            "pull_request_number": 7899,
            "started_at": "2021-10-14T14:19:12+00:00",
            "ended_at": "2021-10-14T15:00:42+00:00",
            "state": "success"
          },
          "queued_at": "2021-10-14T14:19:12+00:00",
          "estimated_time_of_merge": "2021-10-14T15:19:12+00:00"
        }
      ]
    }
  ]
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/queues" \
  -H "Authorization: Bearer <token>"

Get the base refs in the repository #

GET /repos/{owner}/{repository}/queues/branches
Deprecated

Retrieve a list of base refs branches affected by queue activity

Admin Application Key MergifyTokenBearerAuth GitHub Token
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\-\.]+$

start_at string <date-time>

Get the stats until this date, default 1 day before end_at

end_at string <date-time>

Get the stats from this date, default now

200 Successful Response
base_refsstring[]required
Example Response
                          {
  "base_refs": [
    "string"
  ]
}
                        
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/queues/branches" \
  -H "Authorization: Bearer <token>"

Was this page helpful?