Skip to main content
POST
Create cron trigger

Authorizations

Authorization
string
header
required

An opaque Omnara personal or organization bearer token.

Headers

Idempotency-Key
string

Idempotency key for replay-safe mutating requests.

Required string length: 1 - 255

Path Parameters

orgID
string
required
Pattern: ^org_[a-z2-7]{26}$
projectID
string
required
Pattern: ^proj_[a-z2-7]{26}$

Body

application/json
name
string
required

Human-readable name. Spaces and punctuation are allowed; leading or trailing whitespace and invisible or control characters are not.

Required string length: 1 - 64
target
object
required
cron
string
required

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.

Required string length: 9 - 256
timezone
string
default:UTC

IANA time zone the schedule is evaluated in.

Maximum string length: 64
message_template
string

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.

Maximum string length: 65536
enabled
boolean
default:true

Response

Existing cron trigger returned.

id
string
required
Pattern: ^cron_[a-z2-7]{26}$
org_id
string
required
Pattern: ^org_[a-z2-7]{26}$
project_id
string
required
Pattern: ^proj_[a-z2-7]{26}$
name
string
required

Human-readable name. Spaces and punctuation are allowed; leading or trailing whitespace and invisible or control characters are not.

Required string length: 1 - 64
target
object
required
cron
string
required

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.

Required string length: 9 - 256
timezone
string
default:UTC
required

IANA time zone the schedule is evaluated in.

Maximum string length: 64
enabled
boolean
required
last_fired_at
string<date-time> | null
required

When the trigger last fired, or null if it has never fired. For integration targets this means durable inbox handoff.

next_fire_at
string<date-time> | null
required

Next scheduled firing, or null while the trigger is disabled.

failure_report
object | null
required

Most recent failed firing, or null if no firing has failed since the last successful firing.

last_run
object | null
required

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.

created_at
string<date-time>
required
updated_at
string<date-time>
required
message_template
string

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.

Maximum string length: 65536