{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/gen-pro/json-schema/gen-pro-recurring-job-create-schema.json",
  "title": "RecurringJobCreate",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/gen-pro-recurring-jobs-api-openapi.yml#/components/schemas/RecurringJobCreate",
  "type": "object",
  "required": [
    "job_type",
    "prompt",
    "schedule",
    "delivery"
  ],
  "properties": {
    "name": {
      "type": "string",
      "description": "Optional. Defaults to first 80 chars of prompt."
    },
    "job_type": {
      "type": "string"
    },
    "prompt": {
      "type": "string"
    },
    "schedule": {
      "$ref": "#/$defs/RecurringJobSchedule"
    },
    "delivery": {
      "$ref": "#/$defs/RecurringJobDelivery"
    },
    "next_run_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "RecurringJobDelivery": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "chat_only",
            "email"
          ]
        },
        "email": {
          "type": "string",
          "description": "Recipient email. REQUIRED when type=\"email\"; must be omitted when type=\"chat_only\"."
        }
      }
    },
    "RecurringJobSchedule": {
      "type": "object",
      "required": [
        "cadence",
        "timezone"
      ],
      "properties": {
        "cadence": {
          "type": "string",
          "enum": [
            "daily",
            "weekly"
          ]
        },
        "timezone": {
          "type": "string",
          "description": "IANA timezone (e.g. \"UTC\", \"America/Los_Angeles\")"
        },
        "time_of_day": {
          "type": "string",
          "description": "Local clock time \"HH:MM\" (24h). Required for daily/weekly cadences."
        },
        "days_of_week": {
          "type": "array",
          "items": {
            "type": "integer",
            "minimum": 0,
            "maximum": 6
          },
          "description": "Days to run (0=Mon … 6=Sun). REQUIRED when cadence=\"weekly\"; must be omitted when cadence=\"daily\". No duplicates."
        }
      }
    }
  }
}