Introducing Mergify API

Introducing Mergify API

Mehdi Abaakouk

Today, we are pleased to announce the general availability of the Mergify API.

This has been one of our focuses over the last months, as it has been one of the most requested features from our beloved users. We are thrilled to release it and are eager to add more features to it.

How it works

Mergify API is a RESTful API that you can use to get the data you need to integrate with Mergify. You can follow our guide to create your first application API key and look at your merge queue statuses.

# curl --request GET \
  --url https://api.mergify.com/v1/repos/Mergifyio/mergify-engine/queues \
  --header 'Authorization: Bearer <my-application-api-key>' \
  --header 'Content-Type: application/json'
{
  "queues": [
    {
      "branch": {
        "name": "main"
      },
      "pull_requests": [
        {
          "number": 5678,
          "position": 1,
          "priority": 100,
          "queue_rule": {
            "name": "default",
            "config": {
              "priority": 100,
              "batch_size": 1,
              "speculative_checks": 2,
              "allow_inplace_speculative_checks": true
            }
          },
          "speculative_check_pull_request": {
            "in_place": true,
            "number": 5678
          },
          "queued_at": "2021-10-14T14:19:12"
        },
        {
          "number": 4242,
          "position": 1,
          "priority": 100,
          "queue_rule": {
            "name": "default",
            "config": {
              "priority": 100,
              "batch_size": 1,
              "speculative_checks": 2,
              "allow_inplace_speculative_checks": true
            }
          },
          "speculative_check_pull_request": {
            "in_place": false,
            "number": 7899
          },
          "queued_at": "2021-10-14T14:19:12"
        }
      ]
    }
  ]
}

Going further

Once ready you can check out the API references to discover all the data you can access.

As we wrote earlier, this is just the beginning. We are impatient to expose more functionalities, giving you more insight into what is going on in your projects!

Stay tuned for future announcements!