View as Markdown

API Versions

How a request to the Mergify API names a dated version, which version it gets when it names none, 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.

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

Terminal windowbash
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, Mergify-Version: 2026-11-16 here.

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 dated versions it serves: name one of those instead. On an on-premise installation, a client newer than the installation gets the same 400: upgrade Mergify, or use an older release of the client.

REQ A request NAMES Names a version? REQ->NAMES KEY Application key? NAMES->KEY no NAMED The version it names NAMES->NAMED yes ORG The organization's version KEY->ORG yes OLDEST The oldest version served KEY->OLDEST no
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.

An organization’s version is set by the first request one of its application keys 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.

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

The Mergify CLI and the test framework plugins (pytest-mergify, rspec-mergify, minitest-mergify and the JavaScript reporters) name the version their release was built against, whatever the organization’s version, until you upgrade them. Keep them on their latest release.

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 and is not for production.

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 and the test framework plugins warn their users when a response carries this header: upgrade them to a release that names a newer version.

Was this page helpful?