HTTP 500 — Internal Server Error

A generic error message when the server encounters an unexpected condition

When to use it

Use status 500 when this is the correct HTTP response semantic: A generic error message when the server encounters an unexpected condition

Request and response example

GET /reports/monthly HTTP/1.1
Host: api.example.com

HTTP/1.1 500 Internal Server Error
Content-Type: application/json

{"error":"Unexpected server error"}

Related status codes

501, 502, 503, 504

References

MDN · RFC 9110