Skip to main content
PATCH
/
v1
/
programs
/
{programId}
/
automations
/
{automationId}
Update an automation
curl --request PATCH \
  --url https://api.scrip.dev/v1/programs/{programId}/automations/{automationId} \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "cron_expression": "<string>",
  "description": "<string>",
  "event_name": "<string>",
  "filter_hints": [
    {}
  ],
  "guard_condition": "<string>",
  "name": "<string>",
  "participant_filter": "<string>",
  "payload": {},
  "schedule_config": {},
  "status": "active",
  "timezone": "<string>",
  "trigger_at": "2023-11-07T05:31:56Z"
}
'
{
  "created_at": "2023-11-07T05:31:56Z",
  "cron_expression": "<string>",
  "description": "<string>",
  "error_message": "<string>",
  "event_name": "<string>",
  "execution_completed_at": "2023-11-07T05:31:56Z",
  "execution_error": "<string>",
  "execution_started_at": "2023-11-07T05:31:56Z",
  "execution_status": "<string>",
  "filter_hints": [
    {}
  ],
  "guard_condition": "<string>",
  "id": "<string>",
  "last_error": "<string>",
  "last_evaluated_at": "2023-11-07T05:31:56Z",
  "last_run_at": "2023-11-07T05:31:56Z",
  "name": "<string>",
  "next_run_at": "2023-11-07T05:31:56Z",
  "participant_filter": "<string>",
  "participant_id": "<string>",
  "participants_processed": 123,
  "participants_total": 123,
  "payload": {},
  "processed_at": "2023-11-07T05:31:56Z",
  "program_id": "<string>",
  "schedule_config": {},
  "schedule_type": "<string>",
  "scope": "<string>",
  "source": "<string>",
  "status": "<string>",
  "timezone": "<string>",
  "trigger_at": "2023-11-07T05:31:56Z",
  "trigger_type": "<string>",
  "updated_at": "2023-11-07T05:31:56Z"
}
Partial update on an existing automation. Only the fields you include in the request body are changed. You can modify name, event_name, payload, status, scheduling fields (cron_expression, timezone, trigger_at, schedule_config), and filter fields (participant_filter, guard_condition, filter_hints). Set status to paused to temporarily stop the automation from firing. Set it back to active to re-enable it. Pausing does not affect any in-progress fan-out; it prevents future triggers from starting.
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

cron_expression
string

Updated cron expression (cron trigger only)

description
string

Human-readable description

event_name
string

Updated event name (1-255 chars)

Required string length: 1 - 255
filter_hints
object[]

Updated optimization hints for the participant filter

guard_condition
string

Updated CEL guard condition evaluated at trigger time

name
string

Human-readable label (1-255 chars)

Required string length: 1 - 255
participant_filter
string

Updated CEL expression for participant enrollment

payload
object

Updated custom data included in the generated event

schedule_config
object

Updated schedule configuration (participant_state trigger only)

status
enum<string>

Set to active or paused

Available options:
active,
paused
timezone
string

Updated IANA timezone for schedule evaluation

trigger_at
string<date-time>

Updated fire time (one_time trigger only, RFC 3339)

Response

Updated automation

created_at
string<date-time>

When this automation was created

cron_expression
string

Cron expression defining the recurring schedule (cron trigger only)

description
string

Optional human-readable description of what this automation does

error_message
string

Error message if the one-time automation failed

event_name
string

The event name generated when this automation fires

execution_completed_at
string<date-time>

When the current fan-out execution completed

execution_error
string

Error message if the fan-out execution failed

execution_started_at
string<date-time>

When the current fan-out execution started

execution_status
string

Current fan-out execution state: idle, pending, executing, completed, or failed (participant-scoped only)

filter_hints
object[]

Optimization hints for the participant filter (e.g., has_tag, has_attribute)

guard_condition
string

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

id
string

Unique identifier for this automation

last_error
string

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

last_evaluated_at
string<date-time>

When participant filters were last evaluated (participant_state trigger only)

last_run_at
string<date-time>

When this automation last fired (cron trigger only)

name
string

Human-readable label for this automation

next_run_at
string<date-time>

When this automation will next fire (cron trigger only)

participant_filter
string

CEL expression that determines which participants are enrolled

participant_id
string

Target participant for program-scoped one-time automations

participants_processed
integer

Participants processed so far in the current fan-out run

participants_total
integer

Total participants to process in the current fan-out run

payload
object

Custom data included in the generated event

processed_at
string<date-time>

When this one-time automation was processed

program_id
string

The program this automation belongs to

schedule_config
object

Configuration for the schedule type (participant_state trigger only)

schedule_type
string

How participant subscriptions are scheduled: ATTRIBUTE_DATE, INTERVAL, CRON, or THRESHOLD (participant_state trigger only)

scope
string

Whether the automation fires once at the program level or fans out per participant: program or participants

source
string

How this automation was created: api or rule_action

status
string

Current state: active, paused, completed, failed, or archived

timezone
string

IANA timezone used for scheduling (e.g., America/New_York)

trigger_at
string<date-time>

When this automation is scheduled to fire (one_time trigger only, RFC 3339)

trigger_type
string

How this automation is triggered: cron, one_time, participant_state, or immediate

updated_at
string<date-time>

When this automation was last updated