curl --request POST \
--url https://api.omnara.com/v1/orgs/{orgID}/projects/{projectID}/cron-triggers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"target": {
"type": "agent",
"agent_id": "<string>"
},
"cron": "<string>",
"timezone": "UTC",
"message_template": "<string>",
"enabled": true
}
'import requests
url = "https://api.omnara.com/v1/orgs/{orgID}/projects/{projectID}/cron-triggers"
payload = {
"name": "<string>",
"target": {
"type": "agent",
"agent_id": "<string>"
},
"cron": "<string>",
"timezone": "UTC",
"message_template": "<string>",
"enabled": True
}
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>',
target: {type: 'agent', agent_id: '<string>'},
cron: '<string>',
timezone: 'UTC',
message_template: '<string>',
enabled: true
})
};
fetch('https://api.omnara.com/v1/orgs/{orgID}/projects/{projectID}/cron-triggers', 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.omnara.com/v1/orgs/{orgID}/projects/{projectID}/cron-triggers",
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>',
'target' => [
'type' => 'agent',
'agent_id' => '<string>'
],
'cron' => '<string>',
'timezone' => 'UTC',
'message_template' => '<string>',
'enabled' => true
]),
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://api.omnara.com/v1/orgs/{orgID}/projects/{projectID}/cron-triggers"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"target\": {\n \"type\": \"agent\",\n \"agent_id\": \"<string>\"\n },\n \"cron\": \"<string>\",\n \"timezone\": \"UTC\",\n \"message_template\": \"<string>\",\n \"enabled\": true\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://api.omnara.com/v1/orgs/{orgID}/projects/{projectID}/cron-triggers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"target\": {\n \"type\": \"agent\",\n \"agent_id\": \"<string>\"\n },\n \"cron\": \"<string>\",\n \"timezone\": \"UTC\",\n \"message_template\": \"<string>\",\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.omnara.com/v1/orgs/{orgID}/projects/{projectID}/cron-triggers")
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 \"target\": {\n \"type\": \"agent\",\n \"agent_id\": \"<string>\"\n },\n \"cron\": \"<string>\",\n \"timezone\": \"UTC\",\n \"message_template\": \"<string>\",\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"org_id": "<string>",
"project_id": "<string>",
"name": "<string>",
"target": {
"type": "agent",
"agent_id": "<string>",
"delivery_mode": "queued"
},
"cron": "<string>",
"timezone": "UTC",
"enabled": true,
"last_fired_at": "2023-11-07T05:31:56Z",
"next_fire_at": "2023-11-07T05:31:56Z",
"failure_report": {
"message": "<string>",
"will_retry": true,
"failed_at": "2023-11-07T05:31:56Z"
},
"last_run": {
"state": "queued",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"failure_message": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"message_template": "<string>"
}{
"id": "<string>",
"org_id": "<string>",
"project_id": "<string>",
"name": "<string>",
"target": {
"type": "agent",
"agent_id": "<string>",
"delivery_mode": "queued"
},
"cron": "<string>",
"timezone": "UTC",
"enabled": true,
"last_fired_at": "2023-11-07T05:31:56Z",
"next_fire_at": "2023-11-07T05:31:56Z",
"failure_report": {
"message": "<string>",
"will_retry": true,
"failed_at": "2023-11-07T05:31:56Z"
},
"last_run": {
"state": "queued",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"failure_message": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"message_template": "<string>"
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Create cron trigger
Creates a cron trigger that fires on a schedule. A trigger targeting an agent profile launches a new agent from the profile’s current config on each firing; a trigger targeting an agent sends an input to that agent. Missed firings are coalesced, matching standard cron behavior: if one or more scheduled times pass while firing is delayed, the trigger fires once for the oldest missed time and then resumes its schedule from the current time, without retroactively firing for the other missed times.
curl --request POST \
--url https://api.omnara.com/v1/orgs/{orgID}/projects/{projectID}/cron-triggers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"target": {
"type": "agent",
"agent_id": "<string>"
},
"cron": "<string>",
"timezone": "UTC",
"message_template": "<string>",
"enabled": true
}
'import requests
url = "https://api.omnara.com/v1/orgs/{orgID}/projects/{projectID}/cron-triggers"
payload = {
"name": "<string>",
"target": {
"type": "agent",
"agent_id": "<string>"
},
"cron": "<string>",
"timezone": "UTC",
"message_template": "<string>",
"enabled": True
}
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>',
target: {type: 'agent', agent_id: '<string>'},
cron: '<string>',
timezone: 'UTC',
message_template: '<string>',
enabled: true
})
};
fetch('https://api.omnara.com/v1/orgs/{orgID}/projects/{projectID}/cron-triggers', 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.omnara.com/v1/orgs/{orgID}/projects/{projectID}/cron-triggers",
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>',
'target' => [
'type' => 'agent',
'agent_id' => '<string>'
],
'cron' => '<string>',
'timezone' => 'UTC',
'message_template' => '<string>',
'enabled' => true
]),
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://api.omnara.com/v1/orgs/{orgID}/projects/{projectID}/cron-triggers"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"target\": {\n \"type\": \"agent\",\n \"agent_id\": \"<string>\"\n },\n \"cron\": \"<string>\",\n \"timezone\": \"UTC\",\n \"message_template\": \"<string>\",\n \"enabled\": true\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://api.omnara.com/v1/orgs/{orgID}/projects/{projectID}/cron-triggers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"target\": {\n \"type\": \"agent\",\n \"agent_id\": \"<string>\"\n },\n \"cron\": \"<string>\",\n \"timezone\": \"UTC\",\n \"message_template\": \"<string>\",\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.omnara.com/v1/orgs/{orgID}/projects/{projectID}/cron-triggers")
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 \"target\": {\n \"type\": \"agent\",\n \"agent_id\": \"<string>\"\n },\n \"cron\": \"<string>\",\n \"timezone\": \"UTC\",\n \"message_template\": \"<string>\",\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"org_id": "<string>",
"project_id": "<string>",
"name": "<string>",
"target": {
"type": "agent",
"agent_id": "<string>",
"delivery_mode": "queued"
},
"cron": "<string>",
"timezone": "UTC",
"enabled": true,
"last_fired_at": "2023-11-07T05:31:56Z",
"next_fire_at": "2023-11-07T05:31:56Z",
"failure_report": {
"message": "<string>",
"will_retry": true,
"failed_at": "2023-11-07T05:31:56Z"
},
"last_run": {
"state": "queued",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"failure_message": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"message_template": "<string>"
}{
"id": "<string>",
"org_id": "<string>",
"project_id": "<string>",
"name": "<string>",
"target": {
"type": "agent",
"agent_id": "<string>",
"delivery_mode": "queued"
},
"cron": "<string>",
"timezone": "UTC",
"enabled": true,
"last_fired_at": "2023-11-07T05:31:56Z",
"next_fire_at": "2023-11-07T05:31:56Z",
"failure_report": {
"message": "<string>",
"will_retry": true,
"failed_at": "2023-11-07T05:31:56Z"
},
"last_run": {
"state": "queued",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"failure_message": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"message_template": "<string>"
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Authorizations
An opaque Omnara personal or organization bearer token.
Headers
Idempotency key for replay-safe mutating requests.
1 - 255Path Parameters
^org_[a-z2-7]{26}$^proj_[a-z2-7]{26}$Body
Human-readable name. Spaces and punctuation are allowed; leading or trailing whitespace and invisible or control characters are not.
1 - 64- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
Standard five-field cron expression (minute, hour, day of month, month, day of week). TZ=/CRON_TZ= prefixes are rejected; set the timezone field instead.
9 - 256IANA time zone the schedule is evaluated in.
64Go text/template rendered on each firing to produce the message sent to the target. The template receives a trigger value with name, fired_at, last_fired_at, and local_date fields. Timestamps remain UTC; local_date is the scheduled occurrence's ISO date in the schedule timezone. Required for agent and profile targets; omitted for integration targets, which use their own settings. Rendering is capped at 64 KiB of output and one second of wall-clock time, and printf width and precision specifiers are capped at 1024; a firing whose template fails to render is recorded in failure_report without sending a message.
65536Response
Existing cron trigger returned.
^cron_[a-z2-7]{26}$^org_[a-z2-7]{26}$^proj_[a-z2-7]{26}$Human-readable name. Spaces and punctuation are allowed; leading or trailing whitespace and invisible or control characters are not.
1 - 64- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
Standard five-field cron expression (minute, hour, day of month, month, day of week). TZ=/CRON_TZ= prefixes are rejected; set the timezone field instead.
9 - 256IANA time zone the schedule is evaluated in.
64When the trigger last fired, or null if it has never fired. For integration targets this means durable inbox handoff.
Next scheduled firing, or null while the trigger is disabled.
Most recent failed firing, or null if no firing has failed since the last successful firing.
Show child attributes
Show child attributes
Status of the latest accepted scheduled integration launch, scoped to this project and integration. Null for ordinary cron, before any launch is accepted, or when retained details have expired. Never falls back to an older launch. Schedule firing failures remain separate in failure_report. Deleting or disabling a schedule does not cancel launch work already accepted by the integration.
Show child attributes
Show child attributes
Go text/template rendered on each firing to produce the message sent to the target. The template receives a trigger value with name, fired_at, last_fired_at, and local_date fields. Timestamps remain UTC; local_date is the scheduled occurrence's ISO date in the schedule timezone. Required for agent and profile targets; omitted for integration targets, which use their own settings. Rendering is capped at 64 KiB of output and one second of wall-clock time, and printf width and precision specifiers are capped at 1024; a firing whose template fails to render is recorded in failure_report without sending a message.
65536