# 500 Internal Server Error

> The server encountered an unexpected condition that prevented it from fulfilling the request.

Source: https://apiguide.dev/status-codes/500
Class: server-error
Defined in: RFC 9110, Section 15.6.1 <https://www.rfc-editor.org/rfc/rfc9110.html#section-15.6.1>
Updated: 2026-07-09

## What does HTTP status code 500 mean?

The 500 Internal Server Error status code is the generic fallback error returned when the server encounters an unhandled exception or system failure.

## When to use it in APIs

Returned automatically by application frameworks when code bugs, database server outages, or unhandled exceptions occur. Sanitized details should be logged, and a clean response returned.

## How it compares to other codes

* **502 Bad Gateway**: Implies a proxy gateway received an invalid response from an upstream application node. 500 represents a direct application crash.
