> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sontairo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Cron Job

> Schedule an agent to run on a recurring basis.



## OpenAPI

````yaml POST /api/cron-jobs
openapi: 3.0.3
info:
  title: Sontairo API
  description: REST API for the Sontairo AI agent orchestration platform
  version: 1.0.0
servers:
  - url: https://www.sontairo.com
security:
  - bearerAuth: []
  - cookieAuth: []
paths:
  /api/cron-jobs:
    post:
      tags:
        - Cron Jobs
      summary: Create cron job
      description: Schedule an agent to run on a recurring basis.
      operationId: createCronJob
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - workspaceId
                - name
                - schedule
                - prompt
              properties:
                workspaceId:
                  type: string
                projectId:
                  type: string
                  nullable: true
                agentId:
                  type: string
                  description: Agent to run
                name:
                  type: string
                  minLength: 1
                  maxLength: 100
                description:
                  type: string
                  maxLength: 500
                schedule:
                  type: string
                  minLength: 1
                  maxLength: 100
                  description: Cron expression (e.g. 0 9 * * *)
                prompt:
                  type: string
                  minLength: 1
                  maxLength: 10000
                  description: Task instruction for each run
                timezone:
                  type: string
                  maxLength: 50
                  default: UTC
      responses:
        '201':
          description: Cron job created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/CronJob'
components:
  schemas:
    CronJob:
      type: object
      properties:
        id:
          type: string
        workspaceId:
          type: string
        projectId:
          type: string
          nullable: true
        name:
          type: string
        description:
          type: string
          nullable: true
        schedule:
          type: string
        prompt:
          type: string
        timezone:
          type: string
        isActive:
          type: boolean
        agentId:
          type: string
          nullable: true
        agent:
          type: object
          nullable: true
          properties:
            id:
              type: string
            name:
              type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Session token issued by the desktop/native auth exchange, sent as
        Authorization: Bearer <token>.
    cookieAuth:
      type: apiKey
      in: cookie
      name: session
      description: Browser session cookie set by the web sign-in flow.

````