{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/codai-ro/json-schema/codai-ro-schedule-input-schema.json",
  "title": "ScheduleInput",
  "description": "Schedule fields. `kind` selects the shape of `spec`: agent `{prompt, skill?, permissions?}`, shell `{command, cwd?, env_names?, shell?}`, http `{method?, url, headers?, body?, expect_status?}`, chain `{steps, stop_on_failure?}`, phone_action `{action, params?}`.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/codai-ro-schedules-api-openapi.yml#/components/schemas/ScheduleInput",
  "type": "object",
  "required": [
    "name",
    "kind",
    "spec",
    "trigger"
  ],
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 120
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "enabled": {
      "type": "boolean"
    },
    "kind": {
      "type": "string",
      "enum": [
        "agent",
        "shell",
        "http",
        "chain",
        "phone_action"
      ]
    },
    "spec": {
      "type": "object",
      "additionalProperties": true
    },
    "trigger": {
      "type": "object",
      "description": "cron `{type, expr, tz}`, at `{type, at}`, interval `{type, every_s}`, event `{type, trigger_id}` or after `{type, schedule_id, on}`.",
      "additionalProperties": true
    },
    "target": {
      "type": "object",
      "description": "host `{type, device_id}`, tags `{type, tags}`, any, cloud or cloud_vm `{type, project_id}`.",
      "additionalProperties": true
    },
    "failover": {
      "type": "array",
      "items": {
        "type": "array",
        "items": {
          "type": "string"
        }
      }
    },
    "native": {
      "type": "boolean"
    },
    "policy": {
      "type": "object",
      "description": "Approval (never, always, outside quiet hours), quiet hours, budgets per run and per day (micro-USD) and the hourly run limit.",
      "additionalProperties": true
    },
    "misfire": {
      "type": "string",
      "enum": [
        "skip",
        "once",
        "all_within"
      ]
    },
    "misfire_window_min": {
      "type": "integer"
    },
    "overlap": {
      "type": "string",
      "enum": [
        "skip",
        "queue",
        "kill"
      ]
    },
    "timeout_s": {
      "type": "integer"
    },
    "retries": {
      "type": "integer"
    },
    "retry_backoff_s": {
      "type": "integer"
    },
    "late_after_s": {
      "type": [
        "integer",
        "null"
      ]
    },
    "alert_on_fail": {
      "type": "boolean"
    },
    "template": {
      "type": [
        "string",
        "null"
      ]
    }
  }
}