{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://objectsgrid.com/.well-known/objects-catalog/ErrorDetail/v1/schema.json",
  "title": "ErrorDetail",
  "description": "One error, with what went wrong inside and the request's metadata, never its body: an error ObjectsGrid answered (the error response's instance is its URL), or one a customer's API stored. Read by administrators and the accounts the access policy allows (action read); never anonymously. Kept 90 days, then deleted; never updated.",
  "x-objectsgrid-jsonLd": false,
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Its id, a ULID: sortable by creation time. Set by ObjectsGrid",
      "readOnly": true
    },
    "code": {
      "type": "string",
      "description": "The error's code: an ObjectsGrid code, or, for a customer's own error, a code of its DefinedTermSet"
    },
    "domain": {
      "type": "string",
      "description": "Who defines the code: objectsgrid.com, or the customer's DefinedTermSet's domain. A customer's own errors can't use objectsgrid.com"
    },
    "status": {
      "type": "integer",
      "minimum": 400,
      "maximum": 599,
      "description": "The HTTP status answered"
    },
    "title": {
      "type": "string",
      "description": "The code's summary"
    },
    "detail": {
      "type": "string",
      "description": "What the caller was told",
      "maxLength": 10000
    },
    "reasons": {
      "type": "array",
      "maxItems": 100,
      "items": {
        "type": "string",
        "maxLength": 1000
      },
      "description": "The reasons the caller was told"
    },
    "cause": {
      "type": "string",
      "description": "What went wrong inside, for the Organization Account's engineers: the policy rule that denied, the upstream service and the status it answered, the schema path that failed. Never personal data",
      "maxLength": 10000
    },
    "traceId": {
      "type": "string",
      "description": "The request's trace id: GET /errordetails?traceId= finds its errors"
    },
    "organizationAccountID": {
      "type": "string",
      "description": "The Organization Account it belongs to. Set by ObjectsGrid",
      "readOnly": true
    },
    "request": {
      "type": "object",
      "additionalProperties": false,
      "description": "The request's metadata: never its body or header values",
      "properties": {
        "method": {
          "type": "string",
          "description": "The HTTP method"
        },
        "path": {
          "type": "string",
          "description": "The path"
        },
        "query": {
          "type": "string",
          "description": "The query string, with the values of personal fields (email, telephone) removed",
          "maxLength": 4000
        },
        "accessPoint": {
          "type": "string",
          "description": "EU or US"
        },
        "service": {
          "type": "string",
          "description": "The service that answered"
        }
      }
    },
    "caller": {
      "type": "object",
      "additionalProperties": false,
      "description": "Who sent the request",
      "properties": {
        "subjectKind": {
          "type": "string",
          "description": "UserAccount, ServiceAccount or Anonymous"
        },
        "accountId": {
          "type": "string",
          "description": "The account's id"
        },
        "apiKeyId": {
          "type": "string",
          "description": "The public service account of an anonymous request"
        },
        "origin": {
          "type": "string",
          "description": "The browser origin"
        },
        "userAgent": {
          "type": "string",
          "description": "The User-Agent"
        }
      }
    },
    "dateCreated": {
      "type": "string",
      "description": "When it happened. Set by ObjectsGrid",
      "format": "date-time",
      "readOnly": true
    },
    "expires": {
      "type": "string",
      "description": "When it is deleted: 90 days after dateCreated. Set by ObjectsGrid",
      "format": "date-time",
      "readOnly": true
    }
  },
  "required": [
    "code",
    "domain",
    "status"
  ],
  "additionalProperties": false
}
