curl --request PUT \
--url https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/scheduled-tasks/{taskId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agentId": 123,
"cronExpression": "<string>",
"description": "<string>",
"isEnabled": true,
"name": "<string>",
"prompt": "<string>",
"timezone": "<string>"
}
'import requests
url = "https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/scheduled-tasks/{taskId}"
payload = {
"agentId": 123,
"cronExpression": "<string>",
"description": "<string>",
"isEnabled": True,
"name": "<string>",
"prompt": "<string>",
"timezone": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agentId: 123,
cronExpression: '<string>',
description: '<string>',
isEnabled: true,
name: '<string>',
prompt: '<string>',
timezone: '<string>'
})
};
fetch('https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/scheduled-tasks/{taskId}', 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://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/scheduled-tasks/{taskId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'agentId' => 123,
'cronExpression' => '<string>',
'description' => '<string>',
'isEnabled' => true,
'name' => '<string>',
'prompt' => '<string>',
'timezone' => '<string>'
]),
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://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/scheduled-tasks/{taskId}"
payload := strings.NewReader("{\n \"agentId\": 123,\n \"cronExpression\": \"<string>\",\n \"description\": \"<string>\",\n \"isEnabled\": true,\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"timezone\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/scheduled-tasks/{taskId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": 123,\n \"cronExpression\": \"<string>\",\n \"description\": \"<string>\",\n \"isEnabled\": true,\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"timezone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/scheduled-tasks/{taskId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentId\": 123,\n \"cronExpression\": \"<string>\",\n \"description\": \"<string>\",\n \"isEnabled\": true,\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"timezone\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"deploymentId": 123,
"id": 123,
"isEnabled": true,
"name": "<string>",
"prompt": "<string>",
"timezone": "<string>",
"userId": 123,
"agentId": 123,
"cronExpression": "<string>",
"description": "<string>",
"nextRunAt": "<string>"
}Update a scheduled task
curl --request PUT \
--url https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/scheduled-tasks/{taskId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agentId": 123,
"cronExpression": "<string>",
"description": "<string>",
"isEnabled": true,
"name": "<string>",
"prompt": "<string>",
"timezone": "<string>"
}
'import requests
url = "https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/scheduled-tasks/{taskId}"
payload = {
"agentId": 123,
"cronExpression": "<string>",
"description": "<string>",
"isEnabled": True,
"name": "<string>",
"prompt": "<string>",
"timezone": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agentId: 123,
cronExpression: '<string>',
description: '<string>',
isEnabled: true,
name: '<string>',
prompt: '<string>',
timezone: '<string>'
})
};
fetch('https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/scheduled-tasks/{taskId}', 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://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/scheduled-tasks/{taskId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'agentId' => 123,
'cronExpression' => '<string>',
'description' => '<string>',
'isEnabled' => true,
'name' => '<string>',
'prompt' => '<string>',
'timezone' => '<string>'
]),
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://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/scheduled-tasks/{taskId}"
payload := strings.NewReader("{\n \"agentId\": 123,\n \"cronExpression\": \"<string>\",\n \"description\": \"<string>\",\n \"isEnabled\": true,\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"timezone\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/scheduled-tasks/{taskId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": 123,\n \"cronExpression\": \"<string>\",\n \"description\": \"<string>\",\n \"isEnabled\": true,\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"timezone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/scheduled-tasks/{taskId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentId\": 123,\n \"cronExpression\": \"<string>\",\n \"description\": \"<string>\",\n \"isEnabled\": true,\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"timezone\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"deploymentId": 123,
"id": 123,
"isEnabled": true,
"name": "<string>",
"prompt": "<string>",
"timezone": "<string>",
"userId": 123,
"agentId": 123,
"cronExpression": "<string>",
"description": "<string>",
"nextRunAt": "<string>"
}cronExpression: null makes the task Manual. Only the creator or an admin may do this (403 otherwise). A cron fires at most hourly (400 otherwise), and a user can have 20 active tasks (409 past that).Authorizations
Token authentication. Send Authorization: Bearer <YOUR_TOKEN>.
Body
UpdateScheduledTaskInput
The agent that runs the task. Omit to leave unchanged; null resets it to the deployment default.
New standard 5-field cron, at most hourly (the minute field is a single number). Omit it to keep the current schedule; send null to make the task Manual.
100Omit to leave unchanged. Send null to clear the description.
false pauses the schedule, true resumes it. Omit to leave unchanged. Explicit null answers 400.
Omit to leave unchanged. Explicit null answers 400.
1 - 255New prompt, shown as the task's Instructions in Cube. Omit to leave unchanged. Explicit null answers 400.
1New IANA time zone for the cron, e.g. America/New_York. Omit it to keep the current one. Explicit null answers 400.
100Response
False while the schedule is paused.
What the agent is asked on every run, shown as the task's Instructions in Cube. Each run starts a new chat thread, so the prompt has to stand on its own.
IANA time zone the cron is read in, e.g. America/New_York. Defaults to UTC.
The creator. Every run executes as this user, and only they or an admin may change, delete or run the task.
The agent that runs the task; null runs the deployment default.
Standard 5-field cron (minute hour day-of-month month day-of-week), e.g. 0 9 * * 1-5 for 9:00 on weekdays. Null when the task is Manual: it runs only when started with POST /scheduled-tasks/{taskId}/run.
When the schedule next fires (ISO 8601, UTC); null for a Manual or paused task.