{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mammoth-io/json-schema/mammoth-io-email-update-settings-body-schema.json",
  "title": "EmailUpdateSettingsBody",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mammoth-io-collections-api-openapi.yml#/components/schemas/EmailUpdateSettingsBody",
  "properties": {
    "enabled": {
      "type": "boolean"
    },
    "trigger": {
      "$ref": "#/$defs/Trigger"
    },
    "timezone": {
      "type": "string",
      "maxLength": 64,
      "minLength": 1
    },
    "frequency": {
      "$ref": "#/$defs/Frequency"
    },
    "weekday": {
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "maximum": 6
    },
    "monthday": {
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "maximum": 28,
      "minimum": 1
    },
    "time_of_day": {
      "type": "string",
      "default": "09:00"
    },
    "numbers": {
      "additionalProperties": {
        "items": {
          "type": "string"
        },
        "type": "array"
      },
      "type": "object",
      "description": "{dashboard_id: [KPI keys]} — at most 3 per dashboard"
    }
  },
  "type": "object",
  "required": [
    "enabled",
    "timezone"
  ],
  "$defs": {
    "Frequency": {
      "type": "string",
      "enum": [
        "daily",
        "weekdays",
        "weekly",
        "monthly"
      ],
      "title": "Frequency",
      "description": "How often an update repeats (a new-data update is checked daily).",
      "default": "weekly"
    },
    "Trigger": {
      "type": "string",
      "enum": [
        "new_data",
        "schedule"
      ],
      "title": "Trigger",
      "description": "What decides that an email update goes out.",
      "default": "new_data"
    }
  }
}