API Error: Invalid or unsupported API version
The API version you requested — in the URL, a header or the SDK config — doesn’t exist or has been retired.
Seen on:
REST API
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
- Use a currently supported version from the provider’s changelog
- Set the version in one place (SDK config or header)
- Upgrade the SDK if it targets a retired version
Detailed fix by platform
REST API
- 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
- Sent version — Which header/path/param is actually sent?
- Supported — Provider’s list of active versions
- SDK — Version pinned by the SDK
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026