# Versioning

Each account is pinned to a dated API version at its first key; a Provenance-Version request header overrides it, every response names the version used, and each webhook endpoint keeps its own.

An API version is a date, such as `2026-11-30`, sent in the `Provenance-Version` header. Your account is pinned to the version current when you create its first API key, so a later release never changes the responses your integration reads until you choose it.

## When to use it

- Know which changes can reach your integration without warning, and which can't.
- Try a newer version on one request before you move your integration to it.
- Tell which version served a response when you report a problem.

## How it works

1. **Your account is pinned at its first key.** Requests with an API key and no `Provenance-Version` header use that version.
2. **The request header overrides the pin.** Send `Provenance-Version: <date>` on any request to use that version for it. The SDKs send the version they were built against. An unknown date returns `400` [`api_version_unknown`](https://provenanceauth.com/docs/platform/errors.md#api_version_unknown).
3. **Every response names its version.** The `Provenance-Version` response header is the version the request used, on errors too.
4. **Each webhook endpoint has its own version.** Set `api_version` when you create or update an endpoint; it defaults to the version of the request that created it. Each delivery is rendered at that version and carries it in the envelope's `api_version` and the `Provenance-Version` header.
5. **Within a version, changes only add.** New optional request fields, response fields, endpoints, enum values, event types and error codes can appear at any time. A change that removes or renames a field, changes a field's type or changes what a value means ships as a new version.

The `/v1/` path prefix stays the same across versions. Write clients that ignore fields and enum values they don't know.

## Upgrade your account

**Developers → API keys** in the console shows the version your keys use and, when a newer one exists, an **Upgrade** button for owners and admins. The console lists what changed and asks for your passkey or second factor when you have one.

An upgrade moves your account to the current version and can't be undone; an older version is never offered ([`api_version_not_newer`](https://provenanceauth.com/docs/platform/errors.md#api_version_not_newer)). Webhook endpoints keep their own versions, so update each one on its own. Before you upgrade, try the new version by sending its date in `Provenance-Version` on a few requests. Each upgrade appears in the audit log.

## Versions

| Version | What changed |
| --- | --- |
| `2026-11-30` | The current version, and the only one. |

## See the version

**curl**

```bash
export PROVENANCE_API=https://sandbox-api.provenanceauth.com
export PROVENANCE_KEY=prv_test_full_K7mN3xQp9RbT2vWm8sYd4cFjLhXn6gAe

curl -s -o /dev/null -D - $PROVENANCE_API/v1/attest/claims \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Provenance-Version: 2026-11-30" | grep -i provenance-version
```

**Node**

```ts
const res = await fetch(`${process.env.PROVENANCE_API}/v1/attest/claims`, {
  headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}`, "Provenance-Version": "2026-11-30" },
});
console.log(res.headers.get("provenance-version"));
```

**Python**

```python
import os
import httpx

res = httpx.get(
    f"{os.environ['PROVENANCE_API']}/v1/attest/claims",
    headers={"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}", "Provenance-Version": "2026-11-30"},
)
print(res.headers["provenance-version"])
```

```text
provenance-version: 2026-11-30
```

The [OpenAPI document](https://provenanceauth.com/docs/api.md) is the contract of record: the SDKs and the API reference are built to match it.

## Related

- [API reference](https://provenanceauth.com/docs/api.md)
- [Conventions](https://provenanceauth.com/docs/api/conventions.md)
- [Webhooks](https://provenanceauth.com/docs/integrate/webhooks.md)
- [SDKs](https://provenanceauth.com/docs/get-started/sdks.md)
