Luxor Documentation Hub Logo
Luxor Platform/API Documentation/Commander

Update automation rule

Updates an existing automation rule. Accepts any subset of creation fields. Common use: flip status between enabled/disabled.

PATCH
/v2/commander/automation/rules/{rule_id}

Authorization

authorization<token>

Use your API key here.

In: header

Request Body

application/jsonOptional
namestring
Minimum length: 1
statusstring
Value in: "enabled" | "disabled"
site_idsarray<string>
filterobject
conditionobject
scheduleobject
frequencystring
Value in: "every_5_min" | "every_15_min" | "every_hour"
actionsarray<object>
stop_conditionobject

Optional stop condition. PATCH semantics: omit the field to leave both sub-fields unchanged; send null for the whole object to clear both; send null for a single sub-field to clear just that one; send a number to set it. period_minutes maps 1:1 to the underlying cooldownMinutes (no lossy conversion).

Path Parameters

rule_idRequiredstring

Rule ID

curl -X PATCH "https://app.luxor.tech/api/v2/commander/automation/rules/r-a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
  -H "authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string",
    "status": "enabled",
    "site_ids": [
      "497f6eca-6276-4993-bfeb-53cbbbba6f08"
    ],
    "filter": {
      "apply_to_all": false,
      "combinator": "AND",
      "groups": []
    },
    "condition": {
      "type": "metric",
      "metric": "site_id",
      "operator": ">",
      "value": "string"
    },
    "schedule": {
      "cron": "0 19 * * *",
      "timezone": "America/Chicago"
    },
    "frequency": "every_5_min",
    "actions": [
      {
        "action_type": "Reboot",
        "params": {}
      }
    ],
    "stop_condition": {
      "max_executions": 0,
      "period_minutes": 0
    }
  }'

Default Response