Skip to main content
POST
/
api
/
v1
/
jobs
Create Job
curl --request POST \
  --url https://control-plane.kubiya.ai/api/v1/jobs \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "description": "<string>",
  "enabled": true,
  "trigger_type": "<string>",
  "cron_schedule": "<string>",
  "cron_timezone": "<string>",
  "planning_mode": "predefined_agent",
  "entity_type": "<string>",
  "entity_id": "<string>",
  "prompt_template": "<string>",
  "system_prompt": "<string>",
  "executor_type": "auto",
  "worker_queue_name": "<string>",
  "environment_name": "<string>",
  "config": {},
  "execution_environment": {
    "env_vars": {},
    "secrets": [
      "<string>"
    ],
    "integration_ids": [
      "<string>"
    ]
  }
}'
{
  "id": "<string>",
  "organization_id": "<string>",
  "name": "<string>",
  "description": "<string>",
  "enabled": true,
  "status": "<string>",
  "trigger_type": "<string>",
  "cron_schedule": "<string>",
  "cron_timezone": "<string>",
  "webhook_url": "<string>",
  "webhook_secret": "<string>",
  "temporal_schedule_id": "<string>",
  "planning_mode": "<string>",
  "entity_type": "<string>",
  "entity_id": "<string>",
  "entity_name": "<string>",
  "prompt_template": "<string>",
  "system_prompt": "<string>",
  "executor_type": "<string>",
  "worker_queue_name": "<string>",
  "environment_name": "<string>",
  "config": {},
  "execution_environment": {
    "env_vars": {},
    "secrets": [
      "<string>"
    ],
    "integration_ids": [
      "<string>"
    ]
  },
  "last_execution_id": "<string>",
  "last_execution_at": "2023-11-07T05:31:56Z",
  "next_execution_at": "2023-11-07T05:31:56Z",
  "total_executions": 123,
  "successful_executions": 123,
  "failed_executions": 123,
  "execution_history": [
    {}
  ],
  "created_by": "<string>",
  "updated_by": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "last_triggered_at": "2023-11-07T05:31:56Z"
}

Body

application/json

Schema for creating a new job

name
string
required

Job name

Required string length: 1 - 255
trigger_type
string
required

Trigger type: 'cron', 'webhook', or 'manual'

prompt_template
string
required

Prompt template (can include {{variables}} for dynamic params)

description
string | null

Job description

enabled
boolean
default:true

Whether the job is enabled

cron_schedule
string | null

Cron expression (e.g., '0 17 * * *' for daily at 5pm)

cron_timezone
string | null
default:UTC

Timezone for cron schedule (e.g., 'America/New_York')

planning_mode
string
default:predefined_agent

Planning mode: 'on_the_fly', 'predefined_agent', 'predefined_team', or 'predefined_workflow'

entity_type
string | null

Entity type: 'agent', 'team', or 'workflow'

entity_id
string | null

Entity ID (agent_id, team_id, or workflow_id)

system_prompt
string | null

Optional system prompt

executor_type
string
default:auto

Executor routing: 'auto', 'specific_queue', or 'environment'

worker_queue_name
string | null

Worker queue name for 'specific_queue' executor type

environment_name
string | null

Environment name for 'environment' executor type

config
object

Additional execution config (timeout, retry, etc.)

execution_environment
object | null

Execution environment: env vars, secrets, integrations Execution environment configuration for jobs

Response

Successful Response

Schema for job response

id
string
required
organization_id
string
required
name
string
required
description
string | null
required
enabled
boolean
required
status
string
required
trigger_type
string
required
cron_schedule
string | null
required
cron_timezone
string | null
required
temporal_schedule_id
string | null
required
planning_mode
string
required
entity_type
string | null
required
entity_id
string | null
required
entity_name
string | null
required
prompt_template
string
required
system_prompt
string | null
required
executor_type
string
required
worker_queue_name
string | null
required
environment_name
string | null
required
config
object
required
execution_environment
object | null
required

Execution environment configuration for jobs

last_execution_id
string | null
required
last_execution_at
string<date-time> | null
required
next_execution_at
string<date-time> | null
required
total_executions
integer
required
successful_executions
integer
required
failed_executions
integer
required
execution_history
Execution History · object[]
required
created_by
string | null
required
updated_by
string | null
required
created_at
string<date-time>
required
updated_at
string<date-time>
required
last_triggered_at
string<date-time> | null
required
webhook_url
string | null

Full webhook URL (generated from webhook_url_path)

webhook_secret
string | null

Webhook HMAC secret for signature verification