{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/thousandeyes/json-schema/thousandeyes-event-detection-api-events-schema.json",
  "title": "Event_Detection_API_Events",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/thousandeyes-events-api-openapi.yml#/components/schemas/Event_Detection_API_Events",
  "type": "object",
  "properties": {
    "aid": {
      "$ref": "#/$defs/Event_Detection_API_AccountGroupId"
    },
    "startDate": {
      "$ref": "#/$defs/Event_Detection_API_StartDate"
    },
    "endDate": {
      "$ref": "#/$defs/Event_Detection_API_EndDate"
    },
    "events": {
      "x-paginated-items": true,
      "type": "array",
      "items": {
        "$ref": "#/$defs/Event_Detection_API_Event"
      }
    },
    "_links": {
      "$ref": "#/$defs/Event_Detection_API_PaginationNextAndSelfLinks"
    }
  },
  "$defs": {
    "Event_Detection_API_AccountGroupId": {
      "type": "string",
      "description": "A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint."
    },
    "Event_Detection_API_AffectedCount": {
      "type": "object",
      "properties": {
        "total": {
          "type": "integer",
          "description": "The total number affected.",
          "readOnly": true
        },
        "inAccountGroup": {
          "type": "integer",
          "description": "Indicates if in the affected account group.",
          "readOnly": true
        }
      }
    },
    "Event_Detection_API_EndDate": {
      "type": "string",
      "format": "date-time",
      "description": "(Optional) When passing `window` or `endDate` parameter,  the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved  (ISO date-time format).",
      "readOnly": true
    },
    "Event_Detection_API_Event": {
      "allOf": [
        {
          "$ref": "#/$defs/Event_Detection_API_SimpleEventDetail"
        },
        {
          "type": "object",
          "properties": {
            "title": {
              "type": "string",
              "description": "Event title",
              "readOnly": true
            },
            "type": {
              "$ref": "#/$defs/Event_Detection_API_EventType"
            },
            "agentType": {
              "$ref": "#/$defs/Event_Detection_API_EventAgentType"
            },
            "affectedTests": {
              "$ref": "#/$defs/Event_Detection_API_AffectedCount"
            },
            "affectedTargets": {
              "$ref": "#/$defs/Event_Detection_API_AffectedCount"
            },
            "affectedAgents": {
              "$ref": "#/$defs/Event_Detection_API_AffectedCount"
            },
            "_links": {
              "$ref": "#/$defs/Event_Detection_API_SelfLinks"
            }
          }
        }
      ]
    },
    "Event_Detection_API_EventAgentType": {
      "type": "string",
      "description": "Specifies the agent type associated with the event. Allowed values are `cloud-enterprise-agent` and `endpoint-agent`.",
      "enum": [
        "cloud-enterprise-agent",
        "endpoint-agent"
      ],
      "readOnly": true
    },
    "Event_Detection_API_EventAlertSeverity": {
      "type": "string",
      "description": "The severity of the alert.",
      "enum": [
        "high",
        "medium",
        "low",
        "unknown"
      ]
    },
    "Event_Detection_API_EventEndDate": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is null for \"ongoing\" (active) events and is populated once the event is resolved.",
      "readOnly": true
    },
    "Event_Detection_API_EventStartDate": {
      "type": "string",
      "format": "date-time",
      "description": "The start date and time (in UTC, ISO 8601 format) when the event was first detected.",
      "readOnly": true
    },
    "Event_Detection_API_EventState": {
      "type": "string",
      "description": "Indicates the state of the event, whether it is ongoing (active) or has been resolved.",
      "enum": [
        "active",
        "resolved"
      ],
      "readOnly": true
    },
    "Event_Detection_API_EventType": {
      "type": "string",
      "description": "Specifies the event type in a machine-readable and backwards-compatible format, such as `agent` or `target`.",
      "enum": [
        "agent-local",
        "network-pop",
        "network",
        "dns",
        "target",
        "target-network",
        "proxy",
        "agent",
        "application",
        "wireless",
        "gateway",
        "dns-server",
        "dns-name",
        "vpn",
        "agent-branch",
        "domain",
        "name-server"
      ],
      "readOnly": true
    },
    "Event_Detection_API_Link": {
      "type": "object",
      "description": "A hyperlink from the containing resource to a URI.",
      "required": [
        "href"
      ],
      "properties": {
        "href": {
          "type": "string",
          "description": "Its value is either a URI [RFC3986] or a URI template [RFC6570]."
        },
        "templated": {
          "type": "boolean",
          "description": "Should be true when the link object's \"href\" property is a URI template."
        },
        "type": {
          "type": "string",
          "description": "Used as a hint to indicate the media type expected when dereferencing the target resource."
        },
        "deprecation": {
          "type": "string",
          "description": "Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation."
        },
        "name": {
          "type": "string",
          "description": "Its value may be used as a secondary key for selecting link objects that share the same relation type."
        },
        "profile": {
          "type": "string",
          "description": "A URI that hints about the profile of the target resource."
        },
        "title": {
          "type": "string",
          "description": "Intended for labelling the link with a human-readable identifier"
        },
        "hreflang": {
          "type": "string",
          "description": "Indicates the language of the target resource"
        }
      }
    },
    "Event_Detection_API_PaginationNextAndSelfLinks": {
      "type": "object",
      "description": "A links object containing pagination-related links, including only next and self.",
      "properties": {
        "next": {
          "$ref": "#/$defs/Event_Detection_API_Link"
        },
        "self": {
          "$ref": "#/$defs/Event_Detection_API_Link"
        }
      }
    },
    "Event_Detection_API_SelfLinks": {
      "type": "object",
      "description": "A links object containing the self link.",
      "readOnly": true,
      "properties": {
        "self": {
          "$ref": "#/$defs/Event_Detection_API_Link"
        }
      }
    },
    "Event_Detection_API_SimpleEventDetail": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "A unique ID for each event.",
          "readOnly": true
        },
        "typeName": {
          "type": "string",
          "description": "Event type name. Examples include, Local Agent Issue, Network Path Issue, Network Outage, DNS Issue, Server Issue, and Proxy Issue.",
          "readOnly": true
        },
        "state": {
          "$ref": "#/$defs/Event_Detection_API_EventState"
        },
        "startDate": {
          "$ref": "#/$defs/Event_Detection_API_EventStartDate"
        },
        "endDate": {
          "$ref": "#/$defs/Event_Detection_API_EventEndDate"
        },
        "severity": {
          "$ref": "#/$defs/Event_Detection_API_EventAlertSeverity"
        }
      }
    },
    "Event_Detection_API_StartDate": {
      "type": "string",
      "format": "date-time",
      "description": "(Optional) When passing `window` or `startDate` parameter,  the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved  (ISO date-time format).",
      "readOnly": true
    }
  }
}