# `invalid_version`: Unsupported contract version

> HTTP 400. The `Commune-Version` header names a contract version this API does not serve. Send one from `allowed_values`, or leave the header out.

The API is versioned by the `Commune-Version` request header, not by the URL. This error means the header was present and its value is not a version the API currently serves. `allowed_values` lists every version it does serve, and `param` is `Commune-Version`.

A version is an opaque string. Today every published version looks like a date, but the API compares the value for exact equality and never parses it, so `2026-8-26` or a date with a time attached is simply an unknown version.

It is a `400` like `bad_request`, and has its own code because nothing in the body or the query string will fix it. If the header is left out, the request is served the version your API key was issued against, so an integration is never moved to a new contract without asking for it. An empty header counts as absent. See [pinning the contract version](https://usecommune.dev/guides/getting-started#pinning).

The version is checked after the credential, so a request with both a bad credential and a bad version reports `unauthorized` first.

## Why it happens, and how to fix it

### 1. A typo or a different format

The value is close to a real version but not equal to it: a missing leading zero, surrounding quotes, a trailing time or time zone, or a different separator.

**Fix:** Copy a value from `allowed_values` exactly. `GET /status` reports the newest version as `version`, and every response echoes the version that served it in its own `Commune-Version` header.

### 2. A version that is not released, or no longer served

The value names a contract that does not exist yet (for example today's date, guessed rather than looked up), or an old one that has been retired.

**Fix:** Send one of `allowed_values`, normally the newest. If you are moving off a retired version, read the API changelog first, since the shapes you depend on may have changed.

### 3. A header meant for something else

The header was set by a client library or a copied snippet with a value from another API or another setting, for example a library version number.

**Fix:** Set `Commune-Version` explicitly to one of `allowed_values` wherever you build requests, or remove whatever sets it and let the key's pinned version apply.

## Retrying

No: send the request again with a value from `allowed_values`, or without the header.

## Headers

- `Commune-Version`: The version this error response was served under: the newest one, since the one you asked for does not exist.

## Example response

```json
{
  "error": {
    "code": "invalid_version",
    "message": "Unsupported value \"2026-09-01\" for the Commune-Version header. Supported versions: 2026-08-26. Omit the header to use the version your key was issued against.",
    "param": "Commune-Version",
    "allowed_values": [
      "2026-08-26"
    ],
    "request_id": "req_01j9c8h1q7m3n4p5r6s7t8u9v0",
    "docs_url": "https://usecommune.dev/errors/invalid_version"
  }
}
```

Often confused with: [`bad_request`](https://usecommune.dev/errors/bad_request.md).
