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
successbooleanrequiredAlways false for error responsesstatusintegerrequiredHTTP status code (e.g. 400, 401, 403, 404, 422, 429, 500)error.codestringrequiredMachine-readable error identifier in SCREAMING_SNAKE_CASEerror.messagestringrequiredHuman-readable explanation of what went wrongerror.detailsarray<object>optionalPer-field validation errors with field name, rule, and messagerequestIdstringoptionalUnique request ID to include when reporting the issue to supportdocsUrlstringoptionalLink to error-specific documentation pagetimestampstring (ISO 8601)requiredServer 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
Paste the example above into JSONKit's tools to validate, minify, or explore the structure interactively.
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.