Skip to main content
POST
/
api
/
v1
/
jobs
Create Job
curl --request POST \
  --url https://control-plane.kubiya.ai/api/v1/jobs \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "trigger_type": "<string>",
  "prompt_template": "<string>",
  "description": "<string>",
  "enabled": true,
  "cron_schedule": "<string>",
  "cron_timezone": "UTC",
  "planning_mode": "predefined_agent",
  "entity_type": "<string>",
  "entity_id": "<string>",
  "system_prompt": "<string>",
  "executor_type": "auto",
  "worker_queue_name": "<string>",
  "environment_name": "<string>",
  "config": {},
  "execution_environment": {
    "env_vars": {},
    "secrets": [
      "<string>"
    ],
    "integration_ids": [
      "<string>"
    ],
    "mcp_servers": {}
  }
}
'
import requests

url = "https://control-plane.kubiya.ai/api/v1/jobs"

payload = {
"name": "<string>",
"trigger_type": "<string>",
"prompt_template": "<string>",
"description": "<string>",
"enabled": True,
"cron_schedule": "<string>",
"cron_timezone": "UTC",
"planning_mode": "predefined_agent",
"entity_type": "<string>",
"entity_id": "<string>",
"system_prompt": "<string>",
"executor_type": "auto",
"worker_queue_name": "<string>",
"environment_name": "<string>",
"config": {},
"execution_environment": {
"env_vars": {},
"secrets": ["<string>"],
"integration_ids": ["<string>"],
"mcp_servers": {}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
trigger_type: '<string>',
prompt_template: '<string>',
description: '<string>',
enabled: true,
cron_schedule: '<string>',
cron_timezone: 'UTC',
planning_mode: 'predefined_agent',
entity_type: '<string>',
entity_id: '<string>',
system_prompt: '<string>',
executor_type: 'auto',
worker_queue_name: '<string>',
environment_name: '<string>',
config: {},
execution_environment: {
env_vars: {},
secrets: ['<string>'],
integration_ids: ['<string>'],
mcp_servers: {}
}
})
};

fetch('https://control-plane.kubiya.ai/api/v1/jobs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://control-plane.kubiya.ai/api/v1/jobs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'trigger_type' => '<string>',
'prompt_template' => '<string>',
'description' => '<string>',
'enabled' => true,
'cron_schedule' => '<string>',
'cron_timezone' => 'UTC',
'planning_mode' => 'predefined_agent',
'entity_type' => '<string>',
'entity_id' => '<string>',
'system_prompt' => '<string>',
'executor_type' => 'auto',
'worker_queue_name' => '<string>',
'environment_name' => '<string>',
'config' => [

],
'execution_environment' => [
'env_vars' => [

],
'secrets' => [
'<string>'
],
'integration_ids' => [
'<string>'
],
'mcp_servers' => [

]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://control-plane.kubiya.ai/api/v1/jobs"

payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"trigger_type\": \"<string>\",\n \"prompt_template\": \"<string>\",\n \"description\": \"<string>\",\n \"enabled\": true,\n \"cron_schedule\": \"<string>\",\n \"cron_timezone\": \"UTC\",\n \"planning_mode\": \"predefined_agent\",\n \"entity_type\": \"<string>\",\n \"entity_id\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"executor_type\": \"auto\",\n \"worker_queue_name\": \"<string>\",\n \"environment_name\": \"<string>\",\n \"config\": {},\n \"execution_environment\": {\n \"env_vars\": {},\n \"secrets\": [\n \"<string>\"\n ],\n \"integration_ids\": [\n \"<string>\"\n ],\n \"mcp_servers\": {}\n }\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://control-plane.kubiya.ai/api/v1/jobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"trigger_type\": \"<string>\",\n \"prompt_template\": \"<string>\",\n \"description\": \"<string>\",\n \"enabled\": true,\n \"cron_schedule\": \"<string>\",\n \"cron_timezone\": \"UTC\",\n \"planning_mode\": \"predefined_agent\",\n \"entity_type\": \"<string>\",\n \"entity_id\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"executor_type\": \"auto\",\n \"worker_queue_name\": \"<string>\",\n \"environment_name\": \"<string>\",\n \"config\": {},\n \"execution_environment\": {\n \"env_vars\": {},\n \"secrets\": [\n \"<string>\"\n ],\n \"integration_ids\": [\n \"<string>\"\n ],\n \"mcp_servers\": {}\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://control-plane.kubiya.ai/api/v1/jobs")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"trigger_type\": \"<string>\",\n \"prompt_template\": \"<string>\",\n \"description\": \"<string>\",\n \"enabled\": true,\n \"cron_schedule\": \"<string>\",\n \"cron_timezone\": \"UTC\",\n \"planning_mode\": \"predefined_agent\",\n \"entity_type\": \"<string>\",\n \"entity_id\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"executor_type\": \"auto\",\n \"worker_queue_name\": \"<string>\",\n \"environment_name\": \"<string>\",\n \"config\": {},\n \"execution_environment\": {\n \"env_vars\": {},\n \"secrets\": [\n \"<string>\"\n ],\n \"integration_ids\": [\n \"<string>\"\n ],\n \"mcp_servers\": {}\n }\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "organization_id": "<string>",
  "name": "<string>",
  "description": "<string>",
  "enabled": true,
  "status": "<string>",
  "trigger_type": "<string>",
  "cron_schedule": "<string>",
  "cron_timezone": "<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>"
    ],
    "mcp_servers": {}
  },
  "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",
  "webhook_url": "<string>",
  "webhook_secret": "<string>",
  "created_by_email": "<string>",
  "updated_by_email": "<string>"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

Authorization
string
header
required

Enter your Kubiya API token (format: Bearer )

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
Config · object

Additional execution config (timeout, retry, etc.)

execution_environment
ExecutionEnvironment · object | null

Execution environment: env vars, secrets, integrations

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
Config · object
required
execution_environment
ExecutionEnvironment · 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

created_by_email
string | null

Email of the user who created the job (enriched)

updated_by_email
string | null

Email of the user who last updated the job (enriched)