{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/scale-ai/json-schema/scale-ai-create-agent-run-schedule-request-schema.json",
  "title": "CreateAgentRunScheduleRequest",
  "description": "Request body for creating a scheduled agent run.",
  "x-generated": "2026-10-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/scale-ai-agentex-openapi.yml#/components/schemas/CreateAgentRunScheduleRequest",
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 64,
      "minLength": 1,
      "pattern": "^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$",
      "title": "Schedule Name",
      "description": "Human-readable name, unique among active schedules for the agent."
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Description",
      "description": "Optional description of what this schedule does."
    },
    "cron_expression": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Cron Expression",
      "description": "Cron expression for the cadence (e.g. '0 17 * * MON-FRI'). Mutually exclusive with interval_seconds."
    },
    "interval_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Interval Seconds",
      "description": "Interval cadence in seconds. Mutually exclusive with cron_expression."
    },
    "timezone": {
      "type": "string",
      "title": "Timezone",
      "description": "IANA timezone the cron expression is evaluated in (e.g. 'America/New_York').",
      "default": "UTC"
    },
    "start_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Start At",
      "description": "When the schedule should start being active."
    },
    "end_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "End At",
      "description": "When the schedule should stop being active."
    },
    "paused": {
      "type": "boolean",
      "title": "Paused",
      "description": "Whether to create the schedule in a paused state.",
      "default": false
    },
    "task_params": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Task Params",
      "description": "Resolved config forwarded as task `params` at fire time."
    },
    "task_metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Task Metadata",
      "description": "Metadata copied onto each created task at fire time."
    },
    "initial_input": {
      "$ref": "#/$defs/ScheduleInitialInput",
      "description": "The first input delivered to each created task."
    }
  },
  "type": "object",
  "required": [
    "name",
    "initial_input"
  ],
  "$defs": {
    "MessageAuthor": {
      "type": "string",
      "enum": [
        "user",
        "agent"
      ],
      "title": "MessageAuthor"
    },
    "ScheduleInitialInput": {
      "properties": {
        "type": {
          "type": "string",
          "const": "text",
          "title": "Type",
          "description": "Input content type.",
          "default": "text"
        },
        "author": {
          "$ref": "#/$defs/MessageAuthor",
          "description": "The author attributed to the initial input.",
          "default": "user"
        },
        "content": {
          "type": "string",
          "title": "Content",
          "description": "The initial prompt delivered to the task."
        }
      },
      "type": "object",
      "required": [
        "content"
      ],
      "title": "ScheduleInitialInput",
      "description": "The first input delivered to each freshly created scheduled task."
    }
  }
}