Configs and Profiles

Update cron trigger

Changed on

Updates the schedule, message template, or enabled state. The target is immutable; delete the trigger and create a new one to retarget.

patch/orgs/{orgID}/projects/{projectID}/cron-triggers/{cronTriggerID}

Request

  • Base URL
    https://api.omnara.com/v1
  • Auth
    • HTTP bearer
    • or API key in cookie __Host-omnara_session and API key in header X-Omnara-Csrf

Path parameters

orgID, string required

Organization ID (org_...).

projectID, string required

Project ID (proj_...).

cronTriggerID, string required

Cron trigger ID (cron_...).

Request body

UpdateCronTriggerRequest required
target, union

Updates target options. The target type and ID cannot change. Integration settings can change for future occurrences. Omitted delivery_mode preserves the current mode.

name, string

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

cron, string

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.

timezone, string

IANA time zone the schedule is evaluated in.

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.

enabled, boolean

Whether the trigger fires on schedule; false pauses it.

Response

Cron trigger updated.

CronTrigger required
id, string required
org_id, string required
project_id, string required

Project ID (proj_...).

name, string required

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

target, union required

What each firing does: type agent sends the message to an existing agent, type profile launches a new agent from a profile, and type integration hands the firing to an integration, such as a new Slack or Discord thread.

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.

timezone, string required

IANA time zone the schedule is evaluated in.

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.

enabled, boolean required
last_fired_at, string date-time nullable required
next_fire_at, string date-time nullable required
failure_report, CronTriggerFailureReport nullable required
last_run, CronTriggerLastRun nullable required
created_at, string date-time required
updated_at, string date-time required

Changes

    • breaking

      the response property message_template became optional for the status

    • breaking

      added to the target response property oneOf list for the response status

    • info

      added integration discriminator mapping keys to the target request property

    3 more changes in this revision