Skip to Content
API ReferenceSupport automation rules

Change a support automation rule state

Switch a rule on or off, archive it, or restore it.

Switching a rule on is the step that lets it act on new tickets by itself. Read the rule first and send its updated_at as expected_updated_at: a refunding rule is refused without it.

PATCH
/v2/support-automation-rules/{supportAutomationRule}/state

Switch a rule on (active) or off (paused), archives it (archived), or brings an archived rule back (restored) in the on or off state it had. A rule you switch on answers new matching tickets straight away, without anyone on your team, while support automation is on. A rule that refunds can be switched on or restored only with the expected_updated_at you read, so you have seen its refund (otherwise 422 on expected_updated_at), and, while automation is on, only when a daily refund cap is set (otherwise 422 on state). An archived rule accepts only restored; another state returns 422 on state. A rule already in the requested state is returned unchanged. Archived rules never run. Requires the support.automation API-key ability, and the key's user needs the Support Automation role in the store (owners and administrators have it). Repeating the request is safe, except with an old expected_updated_at, which no longer matches after the first change: read the rule again. OAuth callers use the admin grant and select a store with X-STORE. Current membership and role permissions apply to every request.

Authorization

headerAuthorizationBearer <API Key>

Provide your SellApp API key as a bearer token.

Path Parameters

supportAutomationRule*integer

The automation rule ID.

Header Parameters

X-STORE?string

Store slug. Required for OAuth access tokens. API keys may omit it to use their current store, or the first accessible store when no current store is selected.

Request Body

application/json
  1. body
state*string

The state to move the rule to.

Value in"active""paused""archived""restored"
expected_updated_at?string

The updated_at you read. Required to switch on or restore a rule that refunds. When the rule changed since, nothing changes and 422 is returned on expected_updated_at.

Formatdate-time

Response Body

Successful response.

application/json
  1. response
data*
Example Request
curl -X PATCH 'https://sell.app/api/v2/support-automation-rules/0/state' \  -H 'X-STORE: launch-lab' \  -H 'Content-Type: application/json' \  -d '{  "state": "active",  "expected_updated_at": "2026-07-03T09:20:00.000000Z"}'
{  "data": {    "id": 7,    "name": "Expired download links",    "is_active": true,    "archived": false,    "priority": 1,    "match_reason_source": "store",    "match_reason_code": "download-link-expired",    "match_product_ids": [      120    ],    "match_min_order_total_cents": null,    "match_max_order_total_cents": 5000,    "match_customer_filter": null,    "history_window": "all_time",    "min_completed_orders": null,    "max_completed_orders": null,    "min_lifetime_spend_cents": null,    "max_lifetime_spend_cents": null,    "min_prior_ticket_count": null,    "max_prior_ticket_count": null,    "min_prior_support_refund_count": null,    "max_prior_support_refund_count": 0,    "min_prior_support_refund_cents": null,    "max_prior_support_refund_cents": null,    "customer_age_days_min": null,    "customer_age_days_max": null,    "response_template_id": 32,    "action_refund_kind": "partial",    "action_refund_percent_basis": 5000,    "action_refund_fixed_cents": null,    "action_refund_cap_cents": 1000,    "action_close_outcome": "refunded_partial",    "currency": "USD",    "created_at": "2026-07-03T09:20:00.000000Z",    "updated_at": "2026-07-03T09:31:00.000000Z"  }}