---
title: API Versions
description: How a request to the Mergify API names a dated version, which version it gets when it names none, how an organization moves to a newer one, and how long Mergify serves each one.
---

The Mergify API is versioned by date. A version sets the operations the API
serves and what they accept and return. Mergify adds operations and fields to
every version it serves, but a change that would break a caller, such as
removing an operation, only comes in a new version: a script keeps working
until you move it.

Every version is served at `https://api.mergify.com/v1`. `/v1` is the API's
address, not its version.

| Version | What it changes |
| --- | --- |
| `2026-11-16` | The initial version: the API as it was before it had versions. |
| `2026-11-20` | [No longer serves 25 deprecated operations](/api/versions/2026-11-20). |

## Naming a version

A request names the version it is written for in its `Mergify-Version` header,
as a date:

```bash
curl -H "Authorization: Bearer <your-application-key>" \
     -H "Mergify-Version: 2026-11-16" \
     https://api.mergify.com/v1/application
```

The response names the version that served it in the same header, in full,
with its [point](#points): `Mergify-Version: 2026-11-16.N`.

A request naming a version Mergify does not serve is refused with `400`, error
code `API_VERSION_UNKNOWN`, and a `served_versions` field listing the versions
it serves, each in full at the newest point it serves: name one of those, or
its date alone, instead. On an on-premise
installation, a client newer than the installation gets the same `400`:
[upgrade Mergify](/enterprise/releases#upgrading), or use an older release of
the client.

## Points

Mergify adds operations and fields to a version after its release, and counts
them: each addition is the version's next point, and a version's full name is
its date and its point. `2026-11-20.0` is version `2026-11-20` as released,
`2026-11-20.1` the same version with its first addition. An
addition reaches every version Mergify serves at once, each at a point of its
own.

You do not need the full name: a request naming a date alone, or no version,
gets the newest point Mergify serves on that version.

A point is for a client that runs against a server it does not control, such
as an on-premise installation on an older release. Naming the point it was
built against, the client is refused with `API_VERSION_UNKNOWN` by a server
that lacks one of its additions, instead of getting a `404` it cannot tell
from a missing resource. The `detail` names the newest point the server has:
upgrade the installation to a release that serves the point, or use a client
release built against the older one. A request naming an older point is
served everything the server has.

## Which version a request gets

```dot class="flow" title="A request gets the version it names. Naming none, it gets its organization's version with an application key, and the oldest version Mergify serves with any other credential."
digraph {
  REQ [label="A request", class="external"];
  NAMES [label="Names a\nversion?", class="mergify"];
  KEY [label="Application\nkey?", class="mergify"];
  NAMED [label="The version\nit names", class="config"];
  ORG [label="The\norganization's\nversion", class="config"];
  OLDEST [label="The oldest\nversion served", class="config"];

  REQ -> NAMES;
  NAMES -> NAMED [label="yes"];
  NAMES -> KEY [label=" no"];
  KEY -> ORG [label="yes"];
  KEY -> OLDEST [label=" no"];

  { rank=same; NAMES; NAMED; }
  { rank=same; KEY; ORG; }
}
```

An organization's version is set by the first request one of its
[application keys](/api/application-keys#creating-an-application-key) makes
without naming a version. It is set to the newest version released when the
organization's oldest application key was created: an organization new to the
API starts on the newest version, and one whose keys are older keeps the version
its scripts were written against. It changes only when an organization admin
[moves it](#seeing-and-moving-your-organizations-version).

To keep a caller on one version whatever the organization's is, name that
version in its requests.

The [Mergify CLI](/cli/usage), the [test framework
plugins](/test-engine/test-frameworks) (pytest-mergify, rspec-mergify,
minitest-mergify and the JavaScript reporters) and the [Terraform
provider](/integrations/terraform#api-version) name the version their release
was built against, whatever the organization's version, until you upgrade them.
Keep them on their latest release.

## Seeing and moving your organization's version

> **Preview:** This feature is in [Preview](/feature-stages#preview): every organization can use it, and it may change before it is generally available. It is not in Mergify Enterprise until then.

**Settings > API Version** on the dashboard shows your organization's version,
when it was set, and which calls get it. Every member of the organization can
open it.

Organization admins and CI admins also see who called your organization's API
in the last 90 days, under the version each call got: every application key,
CI job and person, with the client release it named. A call shows up there
within an hour.

When Mergify releases a newer version, an organization admin moves to it from
the same page. The newer version's page, linked from the table at the top,
says what it changes: name your current version in the calls that are not
ready for it, then move. Before the move, the page lists the callers it takes
along, the application keys whose calls name no version, and those it leaves on
the version they get today.

For 72 hours after a move, an organization admin can move back to the version
the organization left, from the same page. After that, keep a caller on the
older version by naming it in its `Mergify-Version` header.

The [API](/api) reads and moves the version too. An application key needs the
**API Version** [permission](/api/application-keys#application-key-permissions):
Read to read the version and its callers, Read & write to move it.

## Trying the next version

Name `next` in the `Mergify-Version` header to try the version Mergify is
preparing: the breaking changes collected since the newest release. It changes
without notice, has no point, and is not for production.

## How long a version is served

Mergify serves a version for at least 12 months after the version that
supersedes it is released.

Before a version stops being served, every response served at it carries the
date it stops in a `Mergify-Version-Sunset` header:

```http
Mergify-Version: 2026-11-16
Mergify-Version-Sunset: YYYY-MM-DD
```

Before that date, move its callers: name a newer version in their requests. The
Mergify CLI, the test framework plugins and the Terraform provider warn their
users when a response carries this header: upgrade them to a release that names
a newer version.
