{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cekura-ai/json-schema/cekura-ai-cron-job-schema.json",
  "title": "CronJob",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cekura-ai-schedules-api-openapi.yml#/components/schemas/CronJob",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "readOnly": true
    },
    "agent": {
      "type": "integer",
      "description": "\nAgent ID for the cron job\nExample: `123`\n"
    },
    "name": {
      "type": "string",
      "description": "Name for the cronjob",
      "maxLength": 255
    },
    "crontab_expression": {
      "type": "string",
      "description": "\nCrontab expression for the cron job\nExample: \n- `\"0 9 * * 1-5\"`\n- `\"0 0 * * 0\"`\n",
      "maxLength": 255
    },
    "timezone": {
      "type": "string",
      "description": "\nTimezone for the cron job\nExample: `\"America/Los_Angeles\"`\n"
    },
    "scenarios": {
      "writeOnly": true,
      "description": "\nList of scenario IDs for the cron job\nExample: `[123, 456, 789]`\n"
    },
    "scenario_ids": {
      "type": "array",
      "items": {
        "type": "integer"
      },
      "readOnly": true,
      "description": "\nList of scenario IDs for the cron job\nExample: `[123, 456, 789]`\n"
    },
    "scenarios_data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ScenarioInline"
      },
      "readOnly": true
    },
    "personality": {
      "type": [
        "integer",
        "null"
      ],
      "description": "\n(Deprecated) Use personalities field instead.\nExample: `1` (personality ID)\n"
    },
    "personalities": {
      "type": "array",
      "items": {
        "type": "integer"
      },
      "description": "\nList of personalities to use for test execution. Multiple personalities can be assigned to run tests with different configurations.\nExample: `[1, 2, 3]` (personality IDs)\n"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "\nList of tags for the cron job\nExample: `[\"tag1\", \"tag2\", \"tag3\"]`\n"
    },
    "frequency": {
      "type": "integer",
      "maximum": 100,
      "minimum": 1,
      "description": "\nFrequency for the cron job\nExample: `1`\n"
    },
    "concurrency_limit": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1,
      "writeOnly": true,
      "description": "\nMax number of parallel conversations to run per execution.\nLeave unset for no cap (uses default capacity).\nExample: `3`\n"
    },
    "run_settings": {
      "oneOf": [
        {},
        {
          "type": "null"
        }
      ],
      "description": "\nConnection overrides applied on every scheduled run. Keys must match what the\nmatching run endpoint accepts, and depend on execution_mode:\n- voice: `mode`, `outbound_phone_number`, `agent_number`\n- text: `websocket_url`, `outbound_phone_number`, `agent_number`\n- sip: `sip_endpoint`\n- vapi_webrtc: `vapi_assistant_id`\n- retell_webrtc: `retell_agent_id`\n- elevenlabs: `elevenlabs_agent_id`, `elevenlabs_data`\n- livekit_v2: `livekit_data`\n- pipecat_v2: `pipecat_data`\n- every mode: `calls_per_second` (most calls started per second, a number from 0.1 to 4, e.g. 0.5 for one call every 2 seconds; unset means no limit)\nExample: `{\"livekit_data\": {\"agent_name\": \"support-agent\", \"config\": {\"greeting\": \"hi\"}}}`\n"
    },
    "run_as_text": {
      "type": "boolean",
      "description": "\nDEPRECATED: Use execution_mode instead. Kept for backward compatibility.\nRun the cron job as text\nExample: `true` or `false`\n"
    },
    "execution_mode": {
      "enum": [
        "voice",
        "text",
        "sip",
        "vapi_webrtc",
        "retell_webrtc",
        "elevenlabs",
        "ello",
        "livekit_v2",
        "pipecat_v2",
        "agora"
      ],
      "type": "string",
      "x-spec-enum-id": "aef421315acd0ca3",
      "description": "\nExecution mode for the cron job\nChoices: voice, text, sip, vapi_webrtc, elevenlabs, pipecat_v2, livekit_v2, retell_webrtc, ello, agora\nExample: `\"voice\"`, `\"text\"`, `\"sip\"`, `\"pipecat_v2\"`, `\"elevenlabs\"`, or `\"livekit_v2\"`\n\n\n* `voice` - Voice\n* `text` - Text\n* `sip` - SIP\n* `vapi_webrtc` - VAPI WebRTC\n* `retell_webrtc` - Retell WebRTC\n* `elevenlabs` - ElevenLabs\n* `ello` - Ello\n* `livekit_v2` - LiveKit\n* `pipecat_v2` - Pipecat\n* `agora` - Agora"
    },
    "notify_on": {
      "enum": [
        "never",
        "success",
        "failure",
        "both"
      ],
      "type": "string",
      "x-spec-enum-id": "d06ae6855e4121c0",
      "description": "\nSelect when to notify \n\n\n* `never` - Never\n* `success` - Success\n* `failure` - Failure\n* `both` - Both"
    },
    "is_active": {
      "type": "boolean"
    },
    "created_by": {
      "type": [
        "integer",
        "null"
      ],
      "readOnly": true
    },
    "created_via": {
      "enum": [
        "user",
        "api",
        "mcp",
        "cli",
        "sdk",
        null
      ],
      "type": [
        "string",
        "null"
      ],
      "x-spec-enum-id": "360ac7f2b69a95cc",
      "readOnly": true,
      "description": "How the cron job was created: user (UI), api (API key), or mcp (MCP client)\n\n* `user` - User\n* `api` - API\n* `mcp` - MCP\n* `cli` - CLI\n* `sdk` - SDK"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true,
      "description": "\nTimestamp when the cron job was created\nExample: `2021-01-01 00:00:00`\n"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true,
      "description": "\nTimestamp when the cron job was last updated\nExample: `2021-01-01 00:00:00`\n"
    }
  },
  "required": [
    "crontab_expression"
  ],
  "$defs": {
    "ScenarioInline": {
      "type": "object",
      "description": "",
      "properties": {
        "id": {
          "type": "integer",
          "readOnly": true
        },
        "agent": {
          "type": [
            "integer",
            "null"
          ]
        },
        "name": {
          "type": "string",
          "description": "Name of the scenario",
          "maxLength": 80
        },
        "personality": {
          "type": [
            "integer",
            "null"
          ]
        },
        "personality_name": {
          "type": "string",
          "readOnly": true
        }
      }
    }
  }
}