500 Internal Server Error JSON response example
Last updated 2026-05-20
When to use this
Use this when something blew up server-side. Include a traceId your support team can correlate with logs, and never leak internals (no stack trace).
Example JSON
Generic "something went wrong" payload with a correlation id.
{
"status": 500,
"error": "Internal Server Error",
"message": "Something went wrong on our end. Please try again shortly.",
"code": "internal_error",
"traceId": "8f0e3b5a-2d61-4f3a-9c0e-7d2e1d5b4a91",
"timestamp": "2026-05-20T18:42:10.302Z"
}
Request examples
const res = await fetch('https://jsonexamples.com/http/500/Internal+server+error');
if (!res.ok) {
const err = await res.json();
console.error(res.status, err.message);
}
curl -i https://jsonexamples.com/http/500/Internal+server+error
import requests
r = requests.get('https://jsonexamples.com/http/500/Internal+server+error')
if r.status_code >= 400:
print(r.status_code, r.json())
Try the live endpoint
Click below to call /http/500/Internal+server+error from your browser.
// click the button to populate this block
Common variations
Upstream-dependency error
{
"status": 502,
"error": "Bad Gateway",
"message": "Upstream search service did not respond",
"code": "upstream_unavailable",
"upstream": "meilisearch"
}
Convert this JSON
Generated starting points for TypeScript, JSON Schema, and Zod. Refine before shipping to production.
export interface 500ServerError {
"status": number;
"error": string;
"message": string;
"code": string;
"traceId": string;
"timestamp": string;
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "500ServerError",
"type": "object",
"properties": {
"status": {
"type": "integer"
},
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"code": {
"type": "string"
},
"traceId": {
"type": "string"
},
"timestamp": {
"type": "string"
}
},
"required": [
"status",
"error",
"message",
"code",
"traceId",
"timestamp"
],
"additionalProperties": false
}
import { z } from 'zod';
export const 500ServerErrorSchema = z.object({
status: z.number(),
error: z.string(),
message: z.string(),
code: z.string(),
traceId: z.string(),
timestamp: z.string()
});
export type 500ServerError = z.infer<typeof 500ServerErrorSchema>;
https://jsonexamples.com/api-response-examples/500-server-error