# 406 Not Acceptable: API version specified in Accept header is not supported

- **ID:** `api/rest-api-version-header-missing-accept`
- **Domain:** api
- **Category:** version_error
- **Error Code:** `406`
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

Client sent an Accept header with a media type that includes an API version (e.g., application/vnd.myapp.v2+json) that the server does not recognize or does not serve.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| REST API versioning via Accept header | active | — | — |
| ASP.NET Core 8.0 | active | — | — |
| Spring MVC 6.1 | active | — | — |
| Express.js 4.18 | active | — | — |

## Workarounds

1. **Verify the exact version string the server supports by checking the API documentation or querying a version discovery endpoint. Use the correct media type, e.g., application/vnd.myapp.v1+json for version 1.** (95% success)
   ```
   Verify the exact version string the server supports by checking the API documentation or querying a version discovery endpoint. Use the correct media type, e.g., application/vnd.myapp.v1+json for version 1.
   ```
2. **If the API uses a URL-based versioning scheme (e.g., /api/v1/), switch to that instead of Accept header versioning. Many APIs support both methods.** (85% success)
   ```
   If the API uses a URL-based versioning scheme (e.g., /api/v1/), switch to that instead of Accept header versioning. Many APIs support both methods.
   ```

## Dead Ends

- **** — Without the Accept header, the server may default to the latest version or return a generic response, but this defeats version negotiation and may cause unexpected behavior. (70% fail)
- **** — The server may interpret application/json as the latest version, but if the client specifically needs an older version, this will not work and may break backward compatibility. (80% fail)
