APIs & errors · Fictional sample data
API error response bodies JSON Sample
Example JSON bodies labeled with 400, 401, 404, 422, and 500 status codes for client-side testing.
Use this dataset for error-state interfaces, response parsing tests, validation message examples.
JSON preview
api-error-responses.json · 1.6 KB · formatted JSON
{
"note": "These are example response bodies for documentation and testing. They are not responses generated by a live server.",
"examples": [
{
"status": 400,
"body": {
"error": {
"code": "invalid_request",
"message": "The request format is not valid.",
"field": "page"
},
"requestId": "req_demo_400"
}
},
{
"status": 401,
"body": {
"error": {
"code": "authentication_required",
"message": "A valid sign-in is required."
},
"requestId": "req_demo_401"
}
},
{
"status": 404,
"body": {
"error": {
"code": "record_not_found",
"message": "No record exists for the supplied identifier.",
"resource": "task-999"
},
"requestId": "req_demo_404"
}
},
{
"status": 422,
"body": {
"error": {
"code": "validation_failed",
"message": "One or more fields need attention.",
"details": [
{
"field": "email",
"issue": "Enter a valid example address."
},
{
"field": "quantity",
"issue": "Must be greater than zero."
}
]
},
"requestId": "req_demo_422"
}
},
{
"status": 500,
"body": {
"error": {
"code": "internal_error",
"message": "The example service could not complete the request."
},
"requestId": "req_demo_500",
"retryable": true
}
}
]
}Notable fields
examples[].status- An illustrative status code label, not an HTTP response from a server.
examples[].body.error- A sample error object; shape varies by error type.
This is fictional sample data created for development and testing. Names, addresses, identifiers, and example-domain URLs are illustrative. It is not sourced from real people or a live API.
If an in-page download is unavailable, download the static JSON file directly.
Try these related samples
- Paginated API responseA task-list response with three items and internally consistent page, total, and navigation metadata.
- Nested JSON fixtureA deeply nested workspace fixture with arrays, empty collections, nulls, optional properties, and warning paths.