curl --request POST \
--url https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/scheduled-tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"prompt": "<string>",
"agentId": 123,
"cronExpression": "<string>",
"description": "<string>",
"isEnabled": true,
"timezone": "<string>"
}
'import requests
url = "https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/scheduled-tasks"
payload = {
"name": "<string>",
"prompt": "<string>",
"agentId": 123,
"cronExpression": "<string>",
"description": "<string>",
"isEnabled": True,
"timezone": "<string>"
}
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>',
prompt: '<string>',
agentId: 123,
cronExpression: '<string>',
description: '<string>',
isEnabled: true,
timezone: '<string>'
})
};
fetch('https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/scheduled-tasks', 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",
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>',
'prompt' => '<string>',
'agentId' => 123,
'cronExpression' => '<string>',
'description' => '<string>',
'isEnabled' => true,
'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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"agentId\": 123,\n \"cronExpression\": \"<string>\",\n \"description\": \"<string>\",\n \"isEnabled\": true,\n \"timezone\": \"<string>\"\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://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/scheduled-tasks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"agentId\": 123,\n \"cronExpression\": \"<string>\",\n \"description\": \"<string>\",\n \"isEnabled\": true,\n \"timezone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/scheduled-tasks")
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 \"prompt\": \"<string>\",\n \"agentId\": 123,\n \"cronExpression\": \"<string>\",\n \"description\": \"<string>\",\n \"isEnabled\": true,\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>"
}Create a scheduled task
curl --request POST \
--url https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/scheduled-tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"prompt": "<string>",
"agentId": 123,
"cronExpression": "<string>",
"description": "<string>",
"isEnabled": true,
"timezone": "<string>"
}
'import requests
url = "https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/scheduled-tasks"
payload = {
"name": "<string>",
"prompt": "<string>",
"agentId": 123,
"cronExpression": "<string>",
"description": "<string>",
"isEnabled": True,
"timezone": "<string>"
}
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>',
prompt: '<string>',
agentId: 123,
cronExpression: '<string>',
description: '<string>',
isEnabled: true,
timezone: '<string>'
})
};
fetch('https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/scheduled-tasks', 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",
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>',
'prompt' => '<string>',
'agentId' => 123,
'cronExpression' => '<string>',
'description' => '<string>',
'isEnabled' => true,
'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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"agentId\": 123,\n \"cronExpression\": \"<string>\",\n \"description\": \"<string>\",\n \"isEnabled\": true,\n \"timezone\": \"<string>\"\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://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/scheduled-tasks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"agentId\": 123,\n \"cronExpression\": \"<string>\",\n \"description\": \"<string>\",\n \"isEnabled\": true,\n \"timezone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/scheduled-tasks")
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 \"prompt\": \"<string>\",\n \"agentId\": 123,\n \"cronExpression\": \"<string>\",\n \"description\": \"<string>\",\n \"isEnabled\": true,\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 in timezone, or only on demand without a cron. Runs act as the caller. 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>.
Path Parameters
Body
CreateScheduledTaskInput
1 - 255What the agent is asked on every run, shown as the task's Instructions in Cube. Each run starts a new chat thread with no memory of earlier ones, so write the whole request.
1The agent that runs the task. Omit for 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. A task runs at most once an hour, so the minute field is a single number. Null or omitted makes the task Manual: it runs only when started with POST /scheduled-tasks/{taskId}/run.
100Create the schedule paused with false. Defaults to true.
IANA time zone the cron is read in, e.g. America/New_York. Defaults to UTC.
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.