Skip to main content
POST
/
safari
/
automation
/
rule
/
update
Update Automation rule
curl --request POST \
  --url 'https://api.flashcat.cloud/safari/automation/rule/update?app_key=' \
  --header 'Content-Type: application/json' \
  --data '
{
  "rule_id": "auto_7NnLzY2Qp8xS4kUaV3mR6b",
  "enabled": true,
  "cron_expr": "15 9 * * 1",
  "rotate_http_post_trigger_token": true,
  "oncall_incident_trigger_enabled": true,
  "oncall_incident_severities": [
    "Critical",
    "Warning"
  ],
  "oncall_incident_channel_ids": [
    456
  ]
}
'
{
  "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
  "data": {
    "rule_id": "auto_7NnLzY2Qp8xS4kUaV3mR6b",
    "account_id": 10023,
    "team_id": 123,
    "owner_id": 80011,
    "name": "Weekly on-call review",
    "enabled": true,
    "run_scope": "team",
    "cron_expr": "0 9 * * 1",
    "prompt": "Summarize last week's alert noise and escalation load.",
    "environment_kind": "",
    "environment_id": "",
    "schedule_trigger_id": "autotrg_6aKp3wT9mQ2xVc8bR1nY7z",
    "schedule_trigger_enabled": true,
    "http_post_trigger_id": "autotrg_2bLq4xT8mP1sWd9cN3rF6y",
    "http_post_trigger_url": "/safari/automation/triggers/autotrg_2bLq4xT8mP1sWd9cN3rF6y/fire",
    "http_post_trigger_enabled": true,
    "can_edit": true,
    "created_at": 1780367971228,
    "updated_at": 1780367971228,
    "http_post_token": "sat_yQ9p8V7n6M5k4J3h2G1f0E9d8C7b6A5z4Y3x2W1v0U",
    "schedule_next_fire_at_ms": 1780630800000,
    "oncall_incident_trigger_id": "autotrg_9cVb2mN7qKs4dEa8T1rY5p",
    "oncall_incident_trigger_enabled": true,
    "oncall_incident_channel_ids": [
      456
    ],
    "oncall_incident_severities": [
      "Critical",
      "Warning"
    ]
  }
}

Restrictions

AspectValue
Rate limits1,000 requests/minute; 50 requests/second per account
PermissionsValid app_key; management operations require the caller to manage the target rule

Usage

  • A caller may create personal rules and rules for any team in the current account; team_id is immutable after creation.
  • List visibility follows session-list visibility: owners/admins see all rules; ordinary members see rules they created and rules for their teams.
  • http_post_token is returned only when creating or rotating the token. Save it immediately.
  • To trigger from On-call incidents, send oncall_incident_trigger_enabled, oncall_incident_channel_ids, and oncall_incident_severities; matching events run with trigger_kind=oncall_incident.

Authorizations

app_key
string
query
required

App key issued from the Flashduty console. Required on every public API call. Keep it secret — it grants the same access as the owning account.

Body

application/json

Update an Automation rule. Omit fields to leave them unchanged.

rule_id
string
required

Target rule ID.

name
string

New rule name.

Maximum string length: 255
team_id
integer<int64>

Only the current value is accepted; personal/team scope is immutable after creation.

Required range: x >= 0
enabled
boolean

Whether the rule is enabled.

cron_expr
string

Run cadence. Supports 4 fields (hour day month weekday, minute defaults to 0) and 5 fields (minute hour day month weekday). The minute must be one fixed integer; 6-field seconds are not supported. The create API currently requires this field even for HTTP-POST-only rules; send a valid cron and set schedule_trigger_enabled=false.

Example:

"15 9 * * *"

schedule_trigger_enabled
boolean

Whether the schedule trigger is enabled.

prompt
string

New task prompt.

environment_kind
enum<string>

Runtime environment kind. Omit or send an empty value for automatic selection.

Available options:
,
cloud,
byoc
environment_id
string

BYOC Runner ID.

http_post_trigger_enabled
boolean

Whether the HTTP POST trigger is enabled. Sending true creates one when missing.

oncall_incident_trigger_enabled
boolean

Whether the On-call incident trigger is enabled.

oncall_incident_channel_ids
integer<int64>[]

On-call integration IDs to watch. Creating or enabling this trigger requires at least one valid ID.

Required range: x >= 1
oncall_incident_severities
enum<string>[]

Incident severities to watch. Supported values are Critical, Warning, and Info; creating or enabling this trigger requires at least one value.

Available options:
Critical,
Warning,
Info
rotate_http_post_trigger_token
boolean

Whether to rotate the HTTP POST trigger token. The new token is returned only in this response.

Response

Success

Standard response envelope used by every Flashduty public API. On success data contains the endpoint-specific payload and error is absent. On failure error is present and data is absent. request_id is always present and is also mirrored in the Flashcat-Request-Id response header.

request_id
string
required

Unique ID for this request. Mirrored in the Flashcat-Request-Id header. Include it when reporting issues.

Example:

"01HK8XQE3Z7JM2NTFQ5YJ8P9R4"

error
object

Error payload inside the response envelope. Present only on non-2xx responses.

data
object

Automation rule.