curl --request POST \
--url http://localhost:3000/api/v1/cron/add \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"account": "<string>",
"agent": "<string>",
"at": "<string>",
"cron": "<string>",
"deleteAfter": true,
"description": "<string>",
"envFile": "<string>",
"every": "<string>",
"exec": "<string>",
"idempotencyKey": "<string>",
"isolated": true,
"message": "<string>",
"onError": "<string>",
"shell": "<string>",
"timeout": "<string>",
"tz": "<string>"
}
'import requests
url = "http://localhost:3000/api/v1/cron/add"
payload = {
"name": "<string>",
"account": "<string>",
"agent": "<string>",
"at": "<string>",
"cron": "<string>",
"deleteAfter": True,
"description": "<string>",
"envFile": "<string>",
"every": "<string>",
"exec": "<string>",
"idempotencyKey": "<string>",
"isolated": True,
"message": "<string>",
"onError": "<string>",
"shell": "<string>",
"timeout": "<string>",
"tz": "<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>',
account: '<string>',
agent: '<string>',
at: '<string>',
cron: '<string>',
deleteAfter: true,
description: '<string>',
envFile: '<string>',
every: '<string>',
exec: '<string>',
idempotencyKey: '<string>',
isolated: true,
message: '<string>',
onError: '<string>',
shell: '<string>',
timeout: '<string>',
tz: '<string>'
})
};
fetch('http://localhost:3000/api/v1/cron/add', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/v1/cron/add",
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>',
'account' => '<string>',
'agent' => '<string>',
'at' => '<string>',
'cron' => '<string>',
'deleteAfter' => true,
'description' => '<string>',
'envFile' => '<string>',
'every' => '<string>',
'exec' => '<string>',
'idempotencyKey' => '<string>',
'isolated' => true,
'message' => '<string>',
'onError' => '<string>',
'shell' => '<string>',
'timeout' => '<string>',
'tz' => '<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 := "http://localhost:3000/api/v1/cron/add"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"account\": \"<string>\",\n \"agent\": \"<string>\",\n \"at\": \"<string>\",\n \"cron\": \"<string>\",\n \"deleteAfter\": true,\n \"description\": \"<string>\",\n \"envFile\": \"<string>\",\n \"every\": \"<string>\",\n \"exec\": \"<string>\",\n \"idempotencyKey\": \"<string>\",\n \"isolated\": true,\n \"message\": \"<string>\",\n \"onError\": \"<string>\",\n \"shell\": \"<string>\",\n \"timeout\": \"<string>\",\n \"tz\": \"<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("http://localhost:3000/api/v1/cron/add")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"account\": \"<string>\",\n \"agent\": \"<string>\",\n \"at\": \"<string>\",\n \"cron\": \"<string>\",\n \"deleteAfter\": true,\n \"description\": \"<string>\",\n \"envFile\": \"<string>\",\n \"every\": \"<string>\",\n \"exec\": \"<string>\",\n \"idempotencyKey\": \"<string>\",\n \"isolated\": true,\n \"message\": \"<string>\",\n \"onError\": \"<string>\",\n \"shell\": \"<string>\",\n \"timeout\": \"<string>\",\n \"tz\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/cron/add")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"account\": \"<string>\",\n \"agent\": \"<string>\",\n \"at\": \"<string>\",\n \"cron\": \"<string>\",\n \"deleteAfter\": true,\n \"description\": \"<string>\",\n \"envFile\": \"<string>\",\n \"every\": \"<string>\",\n \"exec\": \"<string>\",\n \"idempotencyKey\": \"<string>\",\n \"isolated\": true,\n \"message\": \"<string>\",\n \"onError\": \"<string>\",\n \"shell\": \"<string>\",\n \"timeout\": \"<string>\",\n \"tz\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"changedCount": 123,
"job": {},
"status": "<string>",
"target": {
"type": "<string>"
},
"warnings": [
"<string>"
]
}Add a new scheduled job
curl --request POST \
--url http://localhost:3000/api/v1/cron/add \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"account": "<string>",
"agent": "<string>",
"at": "<string>",
"cron": "<string>",
"deleteAfter": true,
"description": "<string>",
"envFile": "<string>",
"every": "<string>",
"exec": "<string>",
"idempotencyKey": "<string>",
"isolated": true,
"message": "<string>",
"onError": "<string>",
"shell": "<string>",
"timeout": "<string>",
"tz": "<string>"
}
'import requests
url = "http://localhost:3000/api/v1/cron/add"
payload = {
"name": "<string>",
"account": "<string>",
"agent": "<string>",
"at": "<string>",
"cron": "<string>",
"deleteAfter": True,
"description": "<string>",
"envFile": "<string>",
"every": "<string>",
"exec": "<string>",
"idempotencyKey": "<string>",
"isolated": True,
"message": "<string>",
"onError": "<string>",
"shell": "<string>",
"timeout": "<string>",
"tz": "<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>',
account: '<string>',
agent: '<string>',
at: '<string>',
cron: '<string>',
deleteAfter: true,
description: '<string>',
envFile: '<string>',
every: '<string>',
exec: '<string>',
idempotencyKey: '<string>',
isolated: true,
message: '<string>',
onError: '<string>',
shell: '<string>',
timeout: '<string>',
tz: '<string>'
})
};
fetch('http://localhost:3000/api/v1/cron/add', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/v1/cron/add",
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>',
'account' => '<string>',
'agent' => '<string>',
'at' => '<string>',
'cron' => '<string>',
'deleteAfter' => true,
'description' => '<string>',
'envFile' => '<string>',
'every' => '<string>',
'exec' => '<string>',
'idempotencyKey' => '<string>',
'isolated' => true,
'message' => '<string>',
'onError' => '<string>',
'shell' => '<string>',
'timeout' => '<string>',
'tz' => '<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 := "http://localhost:3000/api/v1/cron/add"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"account\": \"<string>\",\n \"agent\": \"<string>\",\n \"at\": \"<string>\",\n \"cron\": \"<string>\",\n \"deleteAfter\": true,\n \"description\": \"<string>\",\n \"envFile\": \"<string>\",\n \"every\": \"<string>\",\n \"exec\": \"<string>\",\n \"idempotencyKey\": \"<string>\",\n \"isolated\": true,\n \"message\": \"<string>\",\n \"onError\": \"<string>\",\n \"shell\": \"<string>\",\n \"timeout\": \"<string>\",\n \"tz\": \"<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("http://localhost:3000/api/v1/cron/add")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"account\": \"<string>\",\n \"agent\": \"<string>\",\n \"at\": \"<string>\",\n \"cron\": \"<string>\",\n \"deleteAfter\": true,\n \"description\": \"<string>\",\n \"envFile\": \"<string>\",\n \"every\": \"<string>\",\n \"exec\": \"<string>\",\n \"idempotencyKey\": \"<string>\",\n \"isolated\": true,\n \"message\": \"<string>\",\n \"onError\": \"<string>\",\n \"shell\": \"<string>\",\n \"timeout\": \"<string>\",\n \"tz\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/cron/add")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"account\": \"<string>\",\n \"agent\": \"<string>\",\n \"at\": \"<string>\",\n \"cron\": \"<string>\",\n \"deleteAfter\": true,\n \"description\": \"<string>\",\n \"envFile\": \"<string>\",\n \"every\": \"<string>\",\n \"exec\": \"<string>\",\n \"idempotencyKey\": \"<string>\",\n \"isolated\": true,\n \"message\": \"<string>\",\n \"onError\": \"<string>\",\n \"shell\": \"<string>\",\n \"timeout\": \"<string>\",\n \"tz\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"changedCount": 123,
"job": {},
"status": "<string>",
"target": {
"type": "<string>"
},
"warnings": [
"<string>"
]
}Authorizations
Runtime context-key (rctx_*) issued by the Ravi gateway. Used by ordinary gateway operations; not accepted by Console-only operations. Bootstrap the first key with ravi daemon init-admin-key; rotate, derive, and revoke via the ravi context family. Specs: runtime/context-keys, sdk/auth.
Body
Job name
Account for channel delivery (auto-detected from agent)
Agent ID (default: default agent)
One-shot time (e.g., 2025-02-01T15:00)
Cron expression (e.g., '0 9 * * *')
Delete job after first run
Job description
Env file loaded for shell jobs
Interval (e.g., 30m, 1h)
Alias for --shell
Durable create idempotency key
Run in isolated session
Prompt message
Error action, e.g. notify-session:
Run a shell command directly without invoking an agent
Shell timeout, e.g. 60 or 5m
Timezone (e.g., America/Sao_Paulo)