{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cm-com/json-schema/cm-com-create-analytics-report-subscription-dto-schema.json",
  "title": "CreateAnalyticsReportSubscriptionDto",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cm-com-analytics-report-subscriptions-api-openapi.yml#/components/schemas/CreateAnalyticsReportSubscriptionDto",
  "type": "object",
  "properties": {
    "channel": {
      "type": "string",
      "enum": [
        "EMAIL",
        "WHATSAPP",
        "SMS"
      ],
      "default": "EMAIL",
      "description": "Delivery channel. Defaults to EMAIL."
    },
    "emails": {
      "minItems": 1,
      "maxItems": 20,
      "description": "Recipient email addresses. Required for the EMAIL channel.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "phoneNumbers": {
      "minItems": 1,
      "maxItems": 20,
      "description": "Recipient phone numbers (E.164) for the phone channels. Required for the WHATSAPP and SMS channels.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "filterPresetUuids": {
      "minItems": 1,
      "maxItems": 10,
      "description": "UUIDs of the filter presets whose analytics should be sent.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "dateRangeOption": {
      "type": "string",
      "enum": [
        "TODAY",
        "WEEK",
        "MONTH",
        "ABSOLUTE"
      ],
      "default": "TODAY",
      "description": "How the report window is resolved on each run. Defaults to TODAY."
    },
    "intervalMinutes": {
      "type": "number",
      "enum": [
        15,
        30,
        60
      ],
      "description": "How often to send the report, in minutes."
    },
    "expiresAt": {
      "type": "string",
      "description": "When sending stops. Must be in the future and at most 7 days out. Defaults to the 7-day cap when omitted."
    }
  },
  "required": [
    "filterPresetUuids",
    "intervalMinutes"
  ]
}