{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schemas.api-evangelist.com/schemas/iterable/event.json",
  "title": "Iterable Event",
  "description": "A tracked event in Iterable representing a user action or system activity. Events are used to trigger campaigns, segment users, and track engagement metrics across the marketing automation platform.",
  "type": "object",
  "required": ["eventName"],
  "properties": {
    "email": {
      "type": "string",
      "format": "email",
      "description": "Email address of the user associated with the event"
    },
    "userId": {
      "type": "string",
      "description": "Alternative user identifier for the event"
    },
    "eventName": {
      "type": "string",
      "minLength": 1,
      "description": "Name of the event, used to identify the event type in campaign triggers and segmentation"
    },
    "createdAt": {
      "type": "integer",
      "description": "Unix timestamp in milliseconds of when the event occurred"
    },
    "dataFields": {
      "type": "object",
      "description": "Custom data fields containing event-specific details for personalization and filtering",
      "additionalProperties": true
    },
    "campaignId": {
      "type": "integer",
      "description": "Campaign ID to attribute this event to"
    },
    "templateId": {
      "type": "integer",
      "description": "Template ID to attribute this event to"
    }
  },
  "anyOf": [
    {"required": ["email"]},
    {"required": ["userId"]}
  ]
}