{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json",
  "title": "ErrorResponse",
  "description": "The body of every REST API error: RFC 9457 (Problem Details for HTTP APIs) with ObjectsGrid's code, domain, trace id and Organization Account. Its instance is the URL of the error's ErrorDetail, which the accounts the access policy allows read.",
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "description": "The error's code, such as CART_CHECKED_OUT: stable, never changing meaning. The codes are listed at https://objectsgrid.com/.well-known/error-details/index.json"
    },
    "domain": {
      "type": "string",
      "description": "Who defines the code: objectsgrid.com. A code is unique within its domain"
    },
    "type": {
      "type": "string",
      "format": "uri",
      "description": "The page that explains the error's code: https://objectsgrid.com/docs/error-details/<code>/ (RFC 9457 type)"
    },
    "title": {
      "type": "string",
      "description": "The code's fixed, short summary (RFC 9457 title)"
    },
    "status": {
      "type": "integer",
      "description": "The HTTP status (RFC 9457 status)"
    },
    "detail": {
      "type": "string",
      "description": "What went wrong this time, for a person to read (RFC 9457 detail)"
    },
    "reasons": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The details, such as each field in error"
    },
    "instance": {
      "type": "string",
      "format": "uri",
      "description": "This error's ErrorDetail: https://apis.objectsgrid.com/errordetails/<id> (RFC 9457 instance). Absent when the request named no Organization Account, such as one without a token"
    },
    "traceId": {
      "type": "string",
      "description": "The request's OpenTelemetry trace id, the same as the X-ObjectsGrid-Trace-Id header. Give it to support"
    },
    "organizationAccountID": {
      "type": "string",
      "description": "The Organization Account the request was answered for. Absent when the request named none"
    },
    "timestamp": {
      "type": "number",
      "description": "When the error happened, in seconds since 1970"
    }
  },
  "required": [
    "code",
    "domain",
    "type",
    "title",
    "status"
  ]
}
