api_version_invalid 🔌 API

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

  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

🧠 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.