# API Error: Invalid or unsupported API version

**Code:** `api_version_invalid` · **Category:** API · **Seen on:** REST API

The API version you requested — in the URL, a header or the SDK config — doesn’t exist or has been retired.

## Meaning

Versioned APIs pick behaviour from a path prefix (/v1, /v2), a header (Stripe-Version, X-GitHub-Api-Version, api-version query on Azure) or a dated version string. Old versions are eventually sunset, and a typo or future date is rejected outright.

SDKs pin a version too, so upgrading the SDK can change the version you send.

## Common causes

- Typo or invalid date in the version header/parameter
- Version retired (sunset) by the provider
- Mixed: path version and header version disagree
- Old SDK pinned to a removed version

## Quick fix

1. Use a currently supported version from the provider’s changelog
2. Set the version in one place (SDK config or header)
3. Upgrade the SDK if it targets a retired version

## Detailed fix by platform

### REST API

1. 

```bash
curl https://api.github.com/repos/o/r -H 'X-GitHub-Api-Version: 2022-11-28'
curl https://api.stripe.com/v1/charges -u "$KEY:" -H 'Stripe-Version: 2024-06-20'
```


## How to diagnose

1. **Sent version** — Which header/path/param is actually sent?
2. **Supported** — Provider’s list of active versions
3. **SDK** — Version pinned by the SDK

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/api/invalid-api-version)
