HTTP 406 — Not Acceptable
The requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request
When to use it
Use status 406 when this is the correct HTTP response semantic: The requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request
Request and response example
GET /protected-resource HTTP/1.1
Host: api.example.com
HTTP/1.1 406 Not Acceptable
Content-Type: application/json
{"error":"Request cannot be completed"}