{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/raygun/json-schema/raygun-error-instance-schema.json",
  "title": "error-instance",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/raygun-errors-api-openapi.yml#/components/schemas/error-instance",
  "type": "object",
  "properties": {
    "identifier": {
      "type": "string",
      "description": "Identifier of the error instance"
    },
    "applicationIdentifier": {
      "type": "string",
      "description": "Identifier of the application the error instance belongs to"
    },
    "errorGroupIdentifier": {
      "type": "string",
      "description": "Identifier of the error group this instance belongs to"
    },
    "occurredOn": {
      "type": "string",
      "format": "date-time",
      "description": "When this error instance occurred"
    },
    "error": {
      "$ref": "#/$defs/error-detail",
      "description": "The error details including stack trace and exception information"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Tags associated with this error instance"
    },
    "userCustomData": {
      "type": "object",
      "additionalProperties": true,
      "description": "Custom data provided by the user/application"
    },
    "client": {
      "$ref": "#/$defs/client-detail",
      "description": "Client information (library/SDK details)"
    },
    "request": {
      "$ref": "#/$defs/request-detail",
      "description": "Request information if this error occurred during an HTTP request"
    },
    "user": {
      "$ref": "#/$defs/user-detail",
      "description": "User information associated with this error instance"
    },
    "breadcrumbs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/breadcrumb-detail"
      },
      "description": "Breadcrumbs leading up to the error"
    },
    "environment": {
      "$ref": "#/$defs/environment-detail",
      "description": "Environment information when the error occurred"
    },
    "version": {
      "type": "string",
      "description": "Version of the application when the error occurred"
    },
    "machineName": {
      "type": "string",
      "description": "Name of the machine where the error occurred"
    },
    "applicationUrl": {
      "type": "string",
      "format": "uri",
      "description": "URL to view this error instance in the Raygun application"
    }
  },
  "required": [
    "identifier",
    "applicationIdentifier",
    "errorGroupIdentifier",
    "occurredOn",
    "error",
    "applicationUrl"
  ],
  "$defs": {
    "breadcrumb-detail": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Message describing the breadcrumb"
        },
        "category": {
          "type": "string",
          "description": "Category of the breadcrumb"
        },
        "level": {
          "type": "string",
          "description": "Level of the breadcrumb (info, warning, error, etc.)"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "When this breadcrumb was recorded"
        },
        "type": {
          "type": "string",
          "description": "Type of breadcrumb"
        },
        "customData": {
          "type": "object",
          "additionalProperties": true,
          "description": "Custom data associated with the breadcrumb"
        }
      }
    },
    "client-detail": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the client SDK"
        },
        "version": {
          "type": "string",
          "description": "Version of the client SDK"
        },
        "clientUrl": {
          "type": "string",
          "format": "uri",
          "description": "URL of the client SDK"
        }
      }
    },
    "environment-detail": {
      "type": "object",
      "properties": {
        "processorCount": {
          "type": "integer",
          "description": "Processor count"
        },
        "osVersion": {
          "type": "string",
          "description": "Operating system version"
        },
        "windowBoundsWidth": {
          "type": "string",
          "description": "Window bounds width if applicable"
        },
        "windowBoundsHeight": {
          "type": "string",
          "description": "Window bounds height if applicable"
        },
        "browser": {
          "type": "string",
          "description": "Browser name if this is a web application"
        },
        "browserVersion": {
          "type": "string",
          "description": "Browser version"
        },
        "colorDepth": {
          "type": "integer",
          "description": "Color depth of the display"
        },
        "resolutionWidth": {
          "type": "integer",
          "description": "Screen resolution width"
        },
        "resolutionHeight": {
          "type": "integer",
          "description": "Screen resolution height"
        },
        "currentCulture": {
          "type": "string",
          "description": "Current culture"
        },
        "totalPhysicalMemory": {
          "type": "integer",
          "format": "int64",
          "description": "Total physical memory"
        },
        "availablePhysicalMemory": {
          "type": "integer",
          "format": "int64",
          "description": "Available physical memory"
        },
        "totalVirtualMemory": {
          "type": "integer",
          "format": "int64",
          "description": "Total virtual memory"
        },
        "availableVirtualMemory": {
          "type": "integer",
          "format": "int64",
          "description": "Available virtual memory"
        },
        "diskSpaceFree": {
          "type": "string",
          "description": "Disk space information"
        },
        "architecture": {
          "type": "string",
          "description": "Architecture (x86, x64, etc.)"
        }
      }
    },
    "error-detail": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "The error message"
        },
        "className": {
          "type": "string",
          "description": "The exception class name"
        },
        "innerError": {
          "$ref": "#/$defs/error-detail",
          "description": "Inner exception details"
        },
        "innerErrors": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/error-detail"
          },
          "description": "Multiple inner exceptions (for AggregateException scenarios)"
        },
        "stackTrace": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/stack-frame-detail"
          },
          "description": "Stack trace frames"
        }
      }
    },
    "request-detail": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "description": "HTTP URL that was being requested"
        },
        "httpMethod": {
          "type": "string",
          "description": "HTTP method (GET, POST, etc.)"
        },
        "headers": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Request headers"
        },
        "queryString": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Query string parameters"
        },
        "form": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Form data if applicable"
        },
        "rawData": {
          "type": "string",
          "description": "Raw request data"
        },
        "ipAddress": {
          "type": "string",
          "description": "IP address of the client"
        },
        "hostName": {
          "type": "string",
          "description": "Host header value"
        }
      }
    },
    "stack-frame-detail": {
      "type": "object",
      "properties": {
        "lineNumber": {
          "type": "integer",
          "description": "Line number in the source file"
        },
        "columnNumber": {
          "type": "integer",
          "description": "Column number in the source file"
        },
        "className": {
          "type": "string",
          "description": "Class name containing the method"
        },
        "fileName": {
          "type": "string",
          "description": "File name of the source code"
        },
        "methodName": {
          "type": "string",
          "description": "Method name"
        },
        "raw": {
          "type": "string",
          "description": "Raw stack frame string"
        }
      }
    },
    "user-detail": {
      "type": "object",
      "properties": {
        "identifier": {
          "type": "string",
          "description": "User identifier"
        },
        "isAnonymous": {
          "type": "boolean",
          "description": "Whether the user is anonymous"
        },
        "email": {
          "type": "string",
          "format": "email",
          "description": "User's email address"
        },
        "fullName": {
          "type": "string",
          "description": "User's full name"
        },
        "firstName": {
          "type": "string",
          "description": "User's first name"
        },
        "uuid": {
          "type": "string",
          "format": "uuid",
          "description": "UUID for this user"
        }
      }
    }
  }
}