RESTful APIs · Schema

RESTful API Error

Standard error response format for RESTful APIs, following RFC 7807 Problem Details for HTTP APIs.

ArchitectureHTTPRESTWeb ServicesOpenAPIStandardsDesign

Properties

Name Type Description
type string A URI reference that identifies the problem type.
title string A short, human-readable summary of the problem type.
status integer The HTTP status code for this occurrence of the problem.
detail string A human-readable explanation specific to this occurrence.
instance string A URI reference that identifies the specific occurrence of the problem.
code string Application-specific error code.
errors array Field-level validation errors.
View JSON Schema on GitHub

JSON Schema

restful-apis-error-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/restful-apis/refs/heads/main/json-schema/restful-apis-error-schema.json",
  "title": "RESTful API Error",
  "description": "Standard error response format for RESTful APIs, following RFC 7807 Problem Details for HTTP APIs.",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "format": "uri",
      "description": "A URI reference that identifies the problem type."
    },
    "title": {
      "type": "string",
      "description": "A short, human-readable summary of the problem type."
    },
    "status": {
      "type": "integer",
      "description": "The HTTP status code for this occurrence of the problem.",
      "minimum": 100,
      "maximum": 599
    },
    "detail": {
      "type": "string",
      "description": "A human-readable explanation specific to this occurrence."
    },
    "instance": {
      "type": "string",
      "format": "uri",
      "description": "A URI reference that identifies the specific occurrence of the problem."
    },
    "code": {
      "type": "string",
      "description": "Application-specific error code."
    },
    "errors": {
      "type": "array",
      "description": "Field-level validation errors.",
      "items": {
        "type": "object",
        "properties": {
          "field": {"type": "string"},
          "message": {"type": "string"},
          "code": {"type": "string"}
        },
        "required": ["field", "message"]
      }
    }
  },
  "required": ["title", "status"]
}