Skip to main content
PATCH
Update an automation
Partial update on an existing automation. Only the fields you include in the request body are changed. You can modify name, description, event_data, status, the nested trigger object, and filter fields (participant_filter, guard_condition, filter_hints). Scheduling fields inside trigger are validated against the automation’s trigger type: a cron_expression on a one_time automation is rejected. Set status to paused to temporarily stop the automation from firing, and back to active to re-enable it. A failed automation can also be set back to active once you have fixed its configuration. Pausing does not stop a delivery run already in progress; it prevents future triggers from starting. Updating a cron automation’s cron_expression or timezone recomputes its next run time in the same request.
For usage patterns and examples, see the Automations guide.

Authorizations

X-API-Key
string
header
required

API key passed in the X-API-Key header.

Path Parameters

programId
string<uuid>
required

Program ID

automationId
string<uuid>
required

Automation ID

Body

application/json

Fields to update

description
string

Human-readable description

Example:

"Sends a monthly reminder event to VIP participants"

event_data
object

Replacement JSON object to store and submit unchanged when the trigger fires

filter_hints
Automation filter hint · object[]

Checks derived from participant_filter that narrow the participants to consider. Scrip still evaluates the full CEL filter for each candidate.

guard_condition
string

Updated CEL guard condition evaluated at trigger time

Example:

"participant.counters.purchases >= 1"

name
string

Human-readable label (1-255 chars)

Required string length: 1 - 255
Example:

"Monthly points reminder"

participant_filter
string

Updated CEL expression for participant enrollment

Example:

"participant.tags.exists(t, t == 'vip')"

status
enum<string>

Set to active or paused

Available options:
active,
paused
Example:

"paused"

trigger
object

Updated trigger configuration

Example:

Response

Updated automation

created_at
string<date-time>

When this automation was created

Example:

"2024-01-15T10:30:00Z"

description
string

Optional human-readable description of what this automation does

Example:

"Sends a weekly reminder event to VIP participants"

error_message
string

Error message if the one-time automation failed

Example:

"participant not found"

event_data
object

Event data submitted when this automation fires

execution_completed_at
string<date-time>

When the current fan-out execution completed

Example:

"2024-01-15T09:00:42Z"

execution_error
string

Error message if the fan-out execution failed, or JSON-encoded diagnostics for completed runs with CEL eval skips

Example:

"fanout aborted: program is archived"

execution_started_at
string<date-time>

When the current fan-out execution started

Example:

"2024-01-15T09:00:00Z"

execution_status
enum<string>

Status of the current run sending events to participants, separate from the automation's status.

  • idle: no run is in progress.
  • executing: participants are currently being processed.
  • completed: the current run finished; the automation definition may remain active for future runs.
  • failed: the current run stopped with an error; the automation definition may remain active for a retry or future run.
Available options:
idle,
executing,
completed,
failed
Example:

"completed"

filter_hints
Automation filter hint · object[]

Checks derived from participant_filter that narrow the participants to consider. Scrip still evaluates the full CEL filter for each candidate.

guard_condition
string

CEL expression evaluated at trigger time; skips the participant if false

Example:

"participant.counters.purchases >= 1"

id
string<uuid>

Unique identifier for this automation

Example:

"990e8400-e29b-41d4-a716-446655440000"

last_error
string

Error message from the most recent cron execution, if any (cron trigger only)

Example:

"failed to enqueue event: queue unavailable"

last_evaluated_at
string<date-time>

When participant filters were last evaluated (participant_state trigger only)

Example:

"2024-01-15T10:30:00Z"

last_run_at
string<date-time>

When this automation last fired (cron trigger only)

Example:

"2024-01-15T09:00:00Z"

name
string

Human-readable label for this automation

Example:

"Weekly points reminder"

next_run_at
string<date-time>

When this automation will next fire (cron trigger only)

Example:

"2024-01-22T09:00:00Z"

participant_filter
string

CEL expression that determines which participants are enrolled

Example:

"participant.tags.exists(t, t == 'vip')"

participant_id
string<uuid>

Target participant for program-scoped one-time automations

Example:

"550e8400-e29b-41d4-a716-446655440001"

participants_processed
integer

Participants processed so far in the current run

Example:

150

participants_skipped_error
integer

Participants skipped because participant_filter or guard_condition CEL evaluation errored

Example:

0

participants_total
integer

Total participants to process in the current run

Example:

150

processed_at
string<date-time>

When this one-time automation was processed

Example:

"2024-02-01T09:00:05Z"

program_id
string<uuid>

The program this automation belongs to

Example:

"550e8400-e29b-41d4-a716-446655440000"

scope
string

Whether the automation sends one program event or an event for each selected participant: program or participants.

Example:

"participants"

source
enum<string>

Origin of the automation.

  • api: created directly through the Automations API.
  • rule_action: created by a SCHEDULE_EVENT or BROADCAST rule action.
  • system: created by Scrip for scheduled tasks such as tier expiration.
Available options:
api,
rule_action,
system
Example:

"api"

source_event_id
string<uuid>

The event whose processing created this automation. Omitted when no source event is recorded, for example on automations created through the API.

Example:

"770e8400-e29b-41d4-a716-446655440000"

source_rule_id
string<uuid>

The rule whose action created this automation. Omitted when no rule action created it, including automations created through the API.

Example:

"880e8400-e29b-41d4-a716-446655440000"

status
enum<string>

Lifecycle state of the automation definition.

  • active: eligible to fire when its trigger is due.
  • paused: temporarily prevented from firing and may be reactivated.
  • completed: a one-time automation fired successfully and is terminal.
  • failed: stopped firing after a definition-level failure until explicitly reactivated.
  • archived: soft-deleted and permanently prevented from firing.
Available options:
active,
paused,
completed,
failed,
archived
Example:

"active"

trigger
object

Trigger configuration (type, schedule, and timing)

Example:
updated_at
string<date-time>

When this automation was last updated

Example:

"2024-01-15T10:30:00Z"

warnings
object[]

Non-blocking advisories about participant_filter/guard_condition — e.g. a counter/tag/attribute key no rule in the program writes. Present on create/update only; never blocks the save.