Update Cron
curl --request PATCH \
--url https://api.example.com/runs/crons/{cron_id} \
--header 'Content-Type: application/json' \
--data '
{
"schedule": "<string>",
"end_time": "2023-11-07T05:31:56Z",
"input": {},
"metadata": {},
"config": {},
"context": {},
"webhook": "<string>",
"interrupt_before": "<string>",
"interrupt_after": "<string>",
"multitask_strategy": "<string>",
"enabled": true,
"stream_mode": "<string>",
"stream_subgraphs": true,
"timezone": "<string>"
}
'import requests
url = "https://api.example.com/runs/crons/{cron_id}"
payload = {
"schedule": "<string>",
"end_time": "2023-11-07T05:31:56Z",
"input": {},
"metadata": {},
"config": {},
"context": {},
"webhook": "<string>",
"interrupt_before": "<string>",
"interrupt_after": "<string>",
"multitask_strategy": "<string>",
"enabled": True,
"stream_mode": "<string>",
"stream_subgraphs": True,
"timezone": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
schedule: '<string>',
end_time: '2023-11-07T05:31:56Z',
input: {},
metadata: {},
config: {},
context: {},
webhook: '<string>',
interrupt_before: '<string>',
interrupt_after: '<string>',
multitask_strategy: '<string>',
enabled: true,
stream_mode: '<string>',
stream_subgraphs: true,
timezone: '<string>'
})
};
fetch('https://api.example.com/runs/crons/{cron_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://api.example.com/runs/crons/{cron_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([
'schedule' => '<string>',
'end_time' => '2023-11-07T05:31:56Z',
'input' => [
],
'metadata' => [
],
'config' => [
],
'context' => [
],
'webhook' => '<string>',
'interrupt_before' => '<string>',
'interrupt_after' => '<string>',
'multitask_strategy' => '<string>',
'enabled' => true,
'stream_mode' => '<string>',
'stream_subgraphs' => true,
'timezone' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/runs/crons/{cron_id}"
payload := strings.NewReader("{\n \"schedule\": \"<string>\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"input\": {},\n \"metadata\": {},\n \"config\": {},\n \"context\": {},\n \"webhook\": \"<string>\",\n \"interrupt_before\": \"<string>\",\n \"interrupt_after\": \"<string>\",\n \"multitask_strategy\": \"<string>\",\n \"enabled\": true,\n \"stream_mode\": \"<string>\",\n \"stream_subgraphs\": true,\n \"timezone\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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://api.example.com/runs/crons/{cron_id}")
.header("Content-Type", "application/json")
.body("{\n \"schedule\": \"<string>\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"input\": {},\n \"metadata\": {},\n \"config\": {},\n \"context\": {},\n \"webhook\": \"<string>\",\n \"interrupt_before\": \"<string>\",\n \"interrupt_after\": \"<string>\",\n \"multitask_strategy\": \"<string>\",\n \"enabled\": true,\n \"stream_mode\": \"<string>\",\n \"stream_subgraphs\": true,\n \"timezone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/runs/crons/{cron_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"schedule\": \"<string>\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"input\": {},\n \"metadata\": {},\n \"config\": {},\n \"context\": {},\n \"webhook\": \"<string>\",\n \"interrupt_before\": \"<string>\",\n \"interrupt_after\": \"<string>\",\n \"multitask_strategy\": \"<string>\",\n \"enabled\": true,\n \"stream_mode\": \"<string>\",\n \"stream_subgraphs\": true,\n \"timezone\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"cron_id": "<string>",
"assistant_id": "<string>",
"schedule": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"thread_id": "<string>",
"end_time": "2023-11-07T05:31:56Z",
"payload": {},
"user_id": "<string>",
"next_run_date": "2023-11-07T05:31:56Z",
"metadata": {},
"enabled": true
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Crons
Update Cron
Update an existing cron job.
Only provided fields are updated (partial patch). Returns the full
Cron object after update.
PATCH
/
runs
/
crons
/
{cron_id}
Update Cron
curl --request PATCH \
--url https://api.example.com/runs/crons/{cron_id} \
--header 'Content-Type: application/json' \
--data '
{
"schedule": "<string>",
"end_time": "2023-11-07T05:31:56Z",
"input": {},
"metadata": {},
"config": {},
"context": {},
"webhook": "<string>",
"interrupt_before": "<string>",
"interrupt_after": "<string>",
"multitask_strategy": "<string>",
"enabled": true,
"stream_mode": "<string>",
"stream_subgraphs": true,
"timezone": "<string>"
}
'import requests
url = "https://api.example.com/runs/crons/{cron_id}"
payload = {
"schedule": "<string>",
"end_time": "2023-11-07T05:31:56Z",
"input": {},
"metadata": {},
"config": {},
"context": {},
"webhook": "<string>",
"interrupt_before": "<string>",
"interrupt_after": "<string>",
"multitask_strategy": "<string>",
"enabled": True,
"stream_mode": "<string>",
"stream_subgraphs": True,
"timezone": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
schedule: '<string>',
end_time: '2023-11-07T05:31:56Z',
input: {},
metadata: {},
config: {},
context: {},
webhook: '<string>',
interrupt_before: '<string>',
interrupt_after: '<string>',
multitask_strategy: '<string>',
enabled: true,
stream_mode: '<string>',
stream_subgraphs: true,
timezone: '<string>'
})
};
fetch('https://api.example.com/runs/crons/{cron_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://api.example.com/runs/crons/{cron_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([
'schedule' => '<string>',
'end_time' => '2023-11-07T05:31:56Z',
'input' => [
],
'metadata' => [
],
'config' => [
],
'context' => [
],
'webhook' => '<string>',
'interrupt_before' => '<string>',
'interrupt_after' => '<string>',
'multitask_strategy' => '<string>',
'enabled' => true,
'stream_mode' => '<string>',
'stream_subgraphs' => true,
'timezone' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/runs/crons/{cron_id}"
payload := strings.NewReader("{\n \"schedule\": \"<string>\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"input\": {},\n \"metadata\": {},\n \"config\": {},\n \"context\": {},\n \"webhook\": \"<string>\",\n \"interrupt_before\": \"<string>\",\n \"interrupt_after\": \"<string>\",\n \"multitask_strategy\": \"<string>\",\n \"enabled\": true,\n \"stream_mode\": \"<string>\",\n \"stream_subgraphs\": true,\n \"timezone\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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://api.example.com/runs/crons/{cron_id}")
.header("Content-Type", "application/json")
.body("{\n \"schedule\": \"<string>\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"input\": {},\n \"metadata\": {},\n \"config\": {},\n \"context\": {},\n \"webhook\": \"<string>\",\n \"interrupt_before\": \"<string>\",\n \"interrupt_after\": \"<string>\",\n \"multitask_strategy\": \"<string>\",\n \"enabled\": true,\n \"stream_mode\": \"<string>\",\n \"stream_subgraphs\": true,\n \"timezone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/runs/crons/{cron_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"schedule\": \"<string>\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"input\": {},\n \"metadata\": {},\n \"config\": {},\n \"context\": {},\n \"webhook\": \"<string>\",\n \"interrupt_before\": \"<string>\",\n \"interrupt_after\": \"<string>\",\n \"multitask_strategy\": \"<string>\",\n \"enabled\": true,\n \"stream_mode\": \"<string>\",\n \"stream_subgraphs\": true,\n \"timezone\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"cron_id": "<string>",
"assistant_id": "<string>",
"schedule": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"thread_id": "<string>",
"end_time": "2023-11-07T05:31:56Z",
"payload": {},
"user_id": "<string>",
"next_run_date": "2023-11-07T05:31:56Z",
"metadata": {},
"enabled": true
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Path Parameters
Body
application/json
Request body for updating an existing cron job.
Maximum string length:
256Maximum string length:
2048Allowed value:
"*"Allowed value:
"*"Available options:
delete, keep Maximum string length:
256Maximum string length:
64Response
Successful Response
Response model matching the SDK Cron TypedDict.
Available options:
delete, keep ⌘I