api config_error ai_generated true

400 Bad Request: API version header required

ID: api/rest-api-version-header-required

Also available as: JSON · Markdown · 中文
92%Fix Rate
86%Confidence
1Evidence
2023-08-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
REST API v1.0 active
Stripe API v2023-10 active
GitHub API v3 active

Root Cause

The API endpoint requires a specific version header (e.g., Accept-Version or X-API-Version) that was not included in the request.

generic

中文

API 端点需要特定的版本头部(例如 Accept-Version 或 X-API-Version),但请求中未包含。

Official Documentation

https://stripe.com/docs/api/versioning

Workarounds

  1. 95% success Add the required version header to every request.
    Add the required version header to every request.
  2. 90% success Use an API client configuration that automatically includes the version header.
    Use an API client configuration that automatically includes the version header.

中文步骤

  1. Add the required version header to every request.
  2. Use an API client configuration that automatically includes the version header.

Dead Ends

Common approaches that don't work:

  1. 80% fail

    The API specifically checks the header; query parameters are ignored for versioning.

  2. 90% fail

    Some APIs require explicit versioning; no default is assumed.

  3. 95% fail

    The version check is often middleware-level and applies to all methods.