{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/financegenius-ai/json-schema/financegenius-ai-campaign-in-schema.json",
  "title": "CampaignIn",
  "x-generated": "2026-11-07",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/financegenius-ai-openapi.json#/components/schemas/CampaignIn",
  "properties": {
    "label": {
      "type": "string",
      "maxLength": 80,
      "minLength": 3,
      "title": "Label"
    },
    "purpose": {
      "type": "string",
      "enum": [
        "service_nudge",
        "education_promotional",
        "promotional",
        "win_back"
      ],
      "title": "Purpose"
    },
    "template": {
      "type": "string",
      "maxLength": 64,
      "minLength": 2,
      "pattern": "^[a-z][a-z0-9_]*$",
      "title": "Template"
    },
    "channels": {
      "items": {
        "type": "string",
        "enum": [
          "push",
          "whatsapp",
          "email",
          "sms",
          "voice"
        ]
      },
      "type": "array",
      "maxItems": 4,
      "minItems": 1,
      "title": "Channels"
    },
    "audience": {
      "additionalProperties": true,
      "type": "object",
      "title": "Audience"
    },
    "trigger": {
      "type": "string",
      "enum": [
        "manual",
        "scheduled"
      ],
      "title": "Trigger",
      "default": "manual"
    },
    "send_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Send At"
    },
    "cap_per_day": {
      "type": "integer",
      "maximum": 1.0,
      "minimum": 0.0,
      "title": "Cap Per Day",
      "default": 1
    },
    "cap_per_week": {
      "type": "integer",
      "maximum": 3.0,
      "minimum": 0.0,
      "title": "Cap Per Week",
      "default": 3
    },
    "quiet_start": {
      "type": "string",
      "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
      "title": "Quiet Start",
      "default": "21:00"
    },
    "quiet_end": {
      "type": "string",
      "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
      "title": "Quiet End",
      "default": "09:00"
    },
    "goal": {
      "type": "string",
      "enum": [
        "application_started",
        "application_ready",
        "options_viewed",
        "profile_completed",
        "returned",
        "link_clicked"
      ],
      "title": "Goal",
      "default": "returned"
    },
    "bureau_end_use": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "my_credit_plan",
            "rematch",
            "other_loan_type"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Bureau End Use"
    },
    "journey": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 40,
          "pattern": "^[a-z][a-z0-9_]*$"
        },
        {
          "type": "null"
        }
      ],
      "title": "Journey"
    },
    "baseline_pct": {
      "anyOf": [
        {
          "type": "number",
          "exclusiveMaximum": 100.0,
          "exclusiveMinimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Baseline Pct"
    },
    "link_target": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "profile",
            "form",
            "voice",
            "options",
            "my_credit",
            "explainer"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Link Target"
    }
  },
  "type": "object",
  "required": [
    "label",
    "purpose",
    "template",
    "channels"
  ]
}