{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/h2o-ai/main/json-schema/h2o-ai-scheduled-task-create-request-schema.json",
  "title": "ScheduledTaskCreateRequest",
  "x-generated": "2026-10-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/h2o-ai-scheduled-tasks-api-openapi.yml#/components/schemas/ScheduledTaskCreateRequest",
  "type": "object",
  "required": [
    "name",
    "schedule_type",
    "schedule_expression",
    "task_type",
    "task_config"
  ],
  "properties": {
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "schedule_type": {
      "type": "string",
      "enum": [
        "once",
        "recurring",
        "interval"
      ]
    },
    "schedule_expression": {
      "type": "string",
      "description": "ISO-8601 datetime for once, 5-field cron for recurring, \"N minutes\"/\"N hours\" for interval."
    },
    "task_type": {
      "type": "string",
      "enum": [
        "chat_completion",
        "agent_task"
      ]
    },
    "task_config": {
      "type": "object",
      "additionalProperties": true,
      "description": "Must contain a non-empty \"message\" key (the question/prompt). May include \"timezone\", \"collection_id\", \"llm_args\"."
    },
    "max_executions": {
      "type": [
        "integer",
        "null"
      ]
    },
    "expires_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "notification_email": {
      "type": "string"
    }
  }
}