API Design
Error Response JSON Example
A standardized JSON example for API error responses — includes HTTP status code, error code, human-readable message, and field-level validation errors. Copy-ready for REST APIs.
Field Reference
successrequiredbooleanAlways false for error responsesstatusrequiredintegerHTTP status code (e.g. 400, 401, 403, 404, 422, 429, 500)error.coderequiredstringMachine-readable error identifier in SCREAMING_SNAKE_CASEerror.messagerequiredstringHuman-readable explanation of what went wrongerror.detailsoptionalarray<object>Per-field validation errors with field name, rule, and messagerequestIdoptionalstringUnique request ID to include when reporting the issue to supportdocsUrloptionalstringLink to error-specific documentation pagetimestamprequiredstring (ISO 8601)Server time when the error was generatedVariants
MinimalSimple 404 not-found error with just code and message.
ExtendedRate-limit exceeded error with retry-after, quota details, and support link.
Common Use Cases
- →Standardizing error response shapes across all API endpoints for consistent client-side handling
- →Surfacing field-level validation errors in form UIs without custom parsing logic
- →Enabling automated error monitoring by matching on the machine-readable error.code
errorvalidationREST API4xx5xxHTTP
Validate or format this JSON
One click loads this exact example into the tool — no copy-paste needed. Format it, validate it, explore the tree, or generate TypeScript types instantly.
Frequently Asked Questions
Related JSON Examples
API DesignREST API ResponseGeneric REST API response wrapper with data payload, status, and pagination meta.API DesignPagination ResponsePaginated list response JSON with offset, cursor, total, and navigation links.AuthenticationJWT PayloadJWT payload JSON with standard RFC 7519 claims and custom role/permission fields.