| Status code | 500 |
|---|---|
| Status text | Internal Server Error |
| Category | 5xx Server Error |
| Response has body | Usually |
| Specification | RFC 9110 |
What does 500 Internal Server Error mean?
The server hit an unexpected condition and could not complete the request. It belongs to the 5xx Server Error class, which means the server failed to fulfil an apparently valid request. The problem is on the server side.
When do APIs return 500?
An unhandled exception in the API — a null dereference, a failed database query, a bad deploy.
How to fix a 500 Internal Server Error
This is the server's fault, not your request's, so retrying the same call usually will not help. If you own the API, the real detail is in the server logs, not the response. If you do not, capture the exact request that triggers it — copy it as a cURL command — and send it to the provider. Sometimes a malformed edge-case input triggers a 500 that should have been a 400, so it is worth testing a simpler payload.
Reproduce a 500 response
The fastest way to understand a status code is to trigger one and read the full response. Open the
API tester and send a request to https://httpbin.org/status/500 — you will
see the 500 status along with every response header the server sent. Comparing those headers against
a working request is often what reveals the cause.
When you are debugging a real endpoint, check the response headers as carefully as the body, and confirm you are using the right HTTP method for the operation.
Related 5xx status codes
501 Not Implemented
The server does not support the functionality required to fulfil the request.
502 Bad Gateway
A server acting as a gateway or proxy received an invalid response from the upstream server.
503 Service Unavailable
The server is temporarily unable to handle the request.
504 Gateway Timeout
A gateway or proxy did not receive a timely response from the upstream server.
505 HTTP Version Not Supported
The server does not support the major HTTP version named in the request.
507 Insufficient Storage
The server cannot store the representation needed to complete the request.
500 Internal Server Error FAQ
Is a 500 error my fault or the server's?
The server's. It hit a condition it did not handle. Your request may have triggered it, with unusual input for instance, but a correct server would have answered with a 4xx instead of failing.
Is it safe to retry a request after a 500?
For GET and other idempotent methods, yes, after a short delay. For a POST, the operation may have partly completed before the failure, so retry only if the API supports idempotency keys or you can check the outcome first.
What is the difference between 500 and 502?
500 comes from the application itself failing. 502 Bad Gateway comes from a proxy or load balancer that could not get a valid response from the application behind it.
See also
- 502 Bad Gateway — A server acting as a gateway or proxy received an invalid response from the upstream server.
- 503 Service Unavailable — The server is temporarily unable to handle the request.
References
- RFC 9110, 500 Internal Server Error — The specification that defines this status code.
- MDN: 500 Internal Server Error — MDN's reference page for this status code.