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>",
"every": "<string>",
"isolated": true,
"message": "<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>",
"every": "<string>",
"isolated": True,
"message": "<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>',
every: '<string>',
isolated: true,
message: '<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>',
'every' => '<string>',
'isolated' => true,
'message' => '<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 \"every\": \"<string>\",\n \"isolated\": true,\n \"message\": \"<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 \"every\": \"<string>\",\n \"isolated\": true,\n \"message\": \"<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 \"every\": \"<string>\",\n \"isolated\": true,\n \"message\": \"<string>\",\n \"tz\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}cron
Add a new scheduled job
POST
/
api
/
v1
/
cron
/
add
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>",
"every": "<string>",
"isolated": true,
"message": "<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>",
"every": "<string>",
"isolated": True,
"message": "<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>',
every: '<string>',
isolated: true,
message: '<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>',
'every' => '<string>',
'isolated' => true,
'message' => '<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 \"every\": \"<string>\",\n \"isolated\": true,\n \"message\": \"<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 \"every\": \"<string>\",\n \"isolated\": true,\n \"message\": \"<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 \"every\": \"<string>\",\n \"isolated\": true,\n \"message\": \"<string>\",\n \"tz\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}Authorizations
Runtime context-key (rctx_*) issued by the Ravi gateway. Required for every non-open scope. 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
application/json
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
Interval (e.g., 30m, 1h)
Run in isolated session
Prompt message
Timezone (e.g., America/Sao_Paulo)
Response
Success — no @Returns schema declared; payload shape is loose.
The response is of type object.