> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upstackdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Versioning

> How Upstack Data API versions are named, how to pick one with the x-upstack-api-version header, and what happens when a version is replaced.

Send the version you built against in the `x-upstack-api-version` header. Every response returns the version it used in the same header.

## Which API version should I send?

Send the newest version in this table. A version is named by the date it went live, as `YYYY-MM-DD`.

| Version | Went live | Status |
| - | - | - |
| `2026-05-26` | 2026-05-26 | Current |

```bash theme={null}
curl https://api.upstackdata.com/db-mgmt/api/measures \
  -H "x-api-key: upstack_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "x-pixel-id: 5f1e6a4f-..." \
  -H "x-upstack-api-version: 2026-05-26"
```

The header works the same way on every endpoint under `/db-mgmt/api`, `/accounts/api` and `/tr/api`.

## What happens if I send no version?

You get the oldest version that still works. When a version is replaced, requests without the header keep getting the old version until it stops working, then move to the newer one.

## How do I know a version is being replaced?

Responses served under a replaced version carry these headers:

| Header | Example | What it means |
| - | - | - |
| `Deprecation` | `@1796083200` | The day the version was replaced, in Unix seconds. |
| `Sunset` | `Thu, 31 Dec 2026 00:00:00 GMT` | The day it stops working. |
| `Link` | `<https://docs.upstackdata.com/api-reference/versioning>; rel="deprecation"` | This page. |

The [API changelog](https://docs.upstackdata.com/api-reference/changelog.md) lists what changed in the newer version.

## How long does a replaced version keep working?

30 days. A version is deprecated on the day its replacement goes live and stops working 30 days later. Every breaking change follows the same rule.

## What happens after a version stops working?

* A request that names it returns `400`:

  ```json theme={null}
  {
    "message": "API version '2026-05-26' was sunset on 2026-12-31. Use '2026-12-01'. See https://docs.upstackdata.com/api-reference/versioning"
  }
  ```

* A request without the header gets the newest version.

* Responses also carry `x-upstack-cli-min-version`, the oldest CLI release that reads the newest version. See [How does the CLI handle versions?](#how-does-the-cli-handle-versions)

## What does an unknown version return?

`400`, naming the versions you can use:

```json theme={null}
{
  "message": "Unsupported API version '1999-01-01'. Supported versions: 2026-05-26. See https://docs.upstackdata.com/api-reference/versioning"
}
```

## How does the CLI handle versions?

The CLI stops itself when it's too old to read the API's responses. When a response carries `x-upstack-cli-min-version` and your CLI is older, it prints this and exits:

```
This CLI version (1.2.0) is below the minimum supported (1.3.0). Upgrade with: npm i -g @upstackdata/upstack-cli@latest
```

The request has already finished by then, so a command that writes has already applied its change. CLI 1.0.7 and later do this. See [Install the CLI](https://docs.upstackdata.com/cli/install.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.