{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://api-docs.cognite.com/schemas/event",
  "title": "Event",
  "description": "An event represents something that happened at a given time interval. Events could be related to multiple assets.",
  "type": "object",
  "required": ["id", "createdTime", "lastUpdatedTime"],
  "properties": {
    "id": {
      "type": "integer",
      "format": "int64",
      "description": "A server-generated ID for the object."
    },
    "externalId": {
      "type": "string",
      "maxLength": 255,
      "description": "The external ID provided by the client."
    },
    "dataSetId": {
      "type": "integer",
      "format": "int64",
      "description": "The ID of the dataset this event belongs to."
    },
    "startTime": {
      "type": "integer",
      "format": "int64",
      "description": "The number of milliseconds since epoch (start of the event)."
    },
    "endTime": {
      "type": "integer",
      "format": "int64",
      "description": "The number of milliseconds since epoch (end of the event)."
    },
    "type": {
      "type": "string",
      "maxLength": 64,
      "description": "Type of the event, for example 'work_order' or 'alert'."
    },
    "subtype": {
      "type": "string",
      "maxLength": 64,
      "description": "Subtype of the event, for example 'planned' or 'abnormal'."
    },
    "description": {
      "type": "string",
      "maxLength": 500,
      "description": "Textual description of the event."
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Custom, application specific metadata. String key -> String value."
    },
    "assetIds": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "integer",
        "format": "int64"
      },
      "description": "Asset IDs of equipment that this event relates to."
    },
    "source": {
      "type": "string",
      "maxLength": 128,
      "description": "The source of this event."
    },
    "createdTime": {
      "type": "integer",
      "format": "int64",
      "description": "The number of milliseconds since epoch."
    },
    "lastUpdatedTime": {
      "type": "integer",
      "format": "int64",
      "description": "The number of milliseconds since epoch."
    }
  }
}
