HTTP 511 — Network Authentication Required

The client needs to authenticate to gain network access

When to use it

Use status 511 when this is the correct HTTP response semantic: The client needs to authenticate to gain network access

Request and response example

GET /service HTTP/1.1
Host: api.example.com

HTTP/1.1 511 Network Authentication Required
Content-Type: application/json

{"error":"Service failed to process the request"}

Related status codes

500, 501, 502, 503

References

MDN · RFC 9110