Skip to main content
PATCH
/
api
/
v1
/
jobs
/
{job_id}
Update Job
curl --request PATCH \
  --url https://control-plane.kubiya.ai/api/v1/jobs/{job_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "enabled": true,
  "trigger_type": "<string>",
  "cron_schedule": "<string>",
  "cron_timezone": "<string>",
  "planning_mode": "<string>",
  "entity_type": "<string>",
  "entity_id": "<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": {}
  }
}
'
import requests

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

payload = {
    "name": "<string>",
    "description": "<string>",
    "enabled": True,
    "trigger_type": "<string>",
    "cron_schedule": "<string>",
    "cron_timezone": "<string>",
    "planning_mode": "<string>",
    "entity_type": "<string>",
    "entity_id": "<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": {}
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.text)
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    name: '<string>',
    description: '<string>',
    enabled: true,
    trigger_type: '<string>',
    cron_schedule: '<string>',
    cron_timezone: '<string>',
    planning_mode: '<string>',
    entity_type: '<string>',
    entity_id: '<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: {}
    }
  })
};

fetch('https://control-plane.kubiya.ai/api/v1/jobs/{job_id}', 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/{job_id}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PATCH",
  CURLOPT_POSTFIELDS => json_encode([
    'name' => '<string>',
    'description' => '<string>',
    'enabled' => true,
    'trigger_type' => '<string>',
    'cron_schedule' => '<string>',
    'cron_timezone' => '<string>',
    'planning_mode' => '<string>',
    'entity_type' => '<string>',
    'entity_id' => '<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' => [
                
        ]
    ]
  ]),
  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/{job_id}"

	payload := strings.NewReader("{\n  \"name\": \"<string>\",\n  \"description\": \"<string>\",\n  \"enabled\": true,\n  \"trigger_type\": \"<string>\",\n  \"cron_schedule\": \"<string>\",\n  \"cron_timezone\": \"<string>\",\n  \"planning_mode\": \"<string>\",\n  \"entity_type\": \"<string>\",\n  \"entity_id\": \"<string>\",\n  \"prompt_template\": \"<string>\",\n  \"system_prompt\": \"<string>\",\n  \"executor_type\": \"<string>\",\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("PATCH", 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.patch("https://control-plane.kubiya.ai/api/v1/jobs/{job_id}")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"<string>\",\n  \"description\": \"<string>\",\n  \"enabled\": true,\n  \"trigger_type\": \"<string>\",\n  \"cron_schedule\": \"<string>\",\n  \"cron_timezone\": \"<string>\",\n  \"planning_mode\": \"<string>\",\n  \"entity_type\": \"<string>\",\n  \"entity_id\": \"<string>\",\n  \"prompt_template\": \"<string>\",\n  \"system_prompt\": \"<string>\",\n  \"executor_type\": \"<string>\",\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/{job_id}")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"<string>\",\n  \"description\": \"<string>\",\n  \"enabled\": true,\n  \"trigger_type\": \"<string>\",\n  \"cron_schedule\": \"<string>\",\n  \"cron_timezone\": \"<string>\",\n  \"planning_mode\": \"<string>\",\n  \"entity_type\": \"<string>\",\n  \"entity_id\": \"<string>\",\n  \"prompt_template\": \"<string>\",\n  \"system_prompt\": \"<string>\",\n  \"executor_type\": \"<string>\",\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 )

Path Parameters

job_id
string
required

Body

application/json

Schema for updating an existing job

name
string | null
Required string length: 1 - 255
description
string | null
enabled
boolean | null
trigger_type
string | null
cron_schedule
string | null
cron_timezone
string | null
planning_mode
string | null
entity_type
string | null
entity_id
string | null
prompt_template
string | null
system_prompt
string | null
executor_type
string | null
worker_queue_name
string | null
environment_name
string | null
config
Config · object | null
execution_environment
ExecutionEnvironment · object | null

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
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)