{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/scale-ai/json-schema/scale-ai-agent-run-schedule-response-schema.json",
  "title": "AgentRunScheduleResponse",
  "description": "Response model describing 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/AgentRunScheduleResponse",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id",
      "description": "The unique identifier of the run schedule."
    },
    "agent_id": {
      "type": "string",
      "title": "Agent Id",
      "description": "The agent this schedule belongs to."
    },
    "name": {
      "type": "string",
      "title": "Name",
      "description": "Human-readable schedule name."
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Description",
      "description": "Optional description."
    },
    "cron_expression": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Cron Expression",
      "description": "Cron cadence, if cron-based."
    },
    "interval_seconds": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Interval Seconds",
      "description": "Interval cadence in seconds, if interval-based."
    },
    "timezone": {
      "type": "string",
      "title": "Timezone",
      "description": "Timezone the cron expression is evaluated in.",
      "default": "UTC"
    },
    "start_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Start At",
      "description": "Schedule activation time."
    },
    "end_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "End At",
      "description": "Schedule deactivation time."
    },
    "paused": {
      "type": "boolean",
      "title": "Paused",
      "description": "Whether the schedule is paused.",
      "default": false
    },
    "task_params": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Task Params",
      "description": "Task params at fire time."
    },
    "task_metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Task Metadata",
      "description": "Task metadata at fire time."
    },
    "initial_input": {
      "$ref": "#/$defs/ScheduleInitialInput",
      "description": "The initial input."
    },
    "initial_input_method": {
      "type": "string",
      "title": "Initial Input Method",
      "description": "Delivery method, inferred from the agent's ACP type."
    },
    "creator_principal": {
      "anyOf": [
        {
          "$ref": "#/$defs/ScheduleCreatorPrincipal"
        },
        {
          "type": "null"
        }
      ],
      "description": "Credential-free creator identity."
    },
    "created_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Created At",
      "description": "When the schedule was created."
    },
    "updated_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Updated At",
      "description": "When the schedule was updated."
    },
    "state": {
      "$ref": "#/$defs/RunScheduleState",
      "description": "Live schedule state from Temporal.",
      "default": "ACTIVE"
    },
    "next_action_times": {
      "items": {
        "type": "string",
        "format": "date-time"
      },
      "type": "array",
      "title": "Next Action Times",
      "description": "Upcoming scheduled fire times."
    },
    "live_data_available": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Live Data Available",
      "description": "Whether requested live Temporal fields were retrieved successfully. Null when live enrichment was not requested."
    },
    "skipped_action_times": {
      "items": {
        "type": "string",
        "format": "date-time"
      },
      "type": "array",
      "title": "Skipped Action Times",
      "description": "Skipped one-off scheduled fire times."
    },
    "last_action_time": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Action Time",
      "description": "When the schedule last fired."
    },
    "num_actions_taken": {
      "type": "integer",
      "title": "Num Actions Taken",
      "description": "Number of times the schedule has fired.",
      "default": 0
    }
  },
  "type": "object",
  "required": [
    "id",
    "agent_id",
    "name",
    "initial_input",
    "initial_input_method"
  ],
  "$defs": {
    "MessageAuthor": {
      "type": "string",
      "enum": [
        "user",
        "agent"
      ],
      "title": "MessageAuthor"
    },
    "RunScheduleState": {
      "type": "string",
      "enum": [
        "ACTIVE",
        "PAUSED"
      ],
      "title": "RunScheduleState",
      "description": "Live state of a run schedule, derived from Temporal."
    },
    "ScheduleCreatorPrincipal": {
      "properties": {
        "principal_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Principal Type",
          "description": "e.g. 'user' or 'service_account'."
        },
        "user_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "User Id",
          "description": "Creator user id, if a user principal."
        },
        "service_account_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Service Account Id",
          "description": "Creator service-account id, if a service principal."
        },
        "account_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Account Id",
          "description": "Account/workspace id of the creator."
        }
      },
      "type": "object",
      "title": "ScheduleCreatorPrincipal",
      "description": "Credential-free creator identity stored with the schedule.\n\nNever carries cookies, JWTs, API keys, OAuth tokens, or request headers — it\nis creator *context* used only for AuthZ and ownership at fire time."
    },
    "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."
    }
  }
}