Skip to Content
API ReferenceSupport automation rules

Update a support automation rule

Change a rule's conditions and actions.

A change to a switched-on rule applies to the next new ticket. To change a live rule safely, pause it first, change it, test it with the dry run after switching it back on, and pause it again if the result is wrong.

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

Update an automation rule. Only the conditions and actions you send change; PUT and PATCH behave the same. A field sent as null keeps its value; name it in clear to remove it. match_product_ids replaces the whole list. A change to a switched-on rule applies to the next new ticket. Switching the rule on or off, archiving and the order have their own endpoints, so is_active, archived and priority are accepted only with the values the rule already has; a read can be sent back unchanged. A template or reason the rule already has is kept even if it was paused since; a new one has to be usable. Adding a refund to a switched-on rule while support automation is on and no daily refund cap is set returns 422 on action_refund_kind. An archived rule returns 422 on supportAutomationRule: restore it first. Amounts are integer USD cents (1999 means $19.99), and action_refund_percent_basis is in hundredths of a percent (5000 is 50%). 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 same change 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
name?string

Name your team sees in the rule list.

Lengthlength <= 120
match_reason_source?|

With match_reason_code, the ticket reason the rule answers: platform for a built-in reason, store for one of yours. Send both or neither; null on both answers any reason. A store reason must be active and offered for every product. Read the codes from the support reason options endpoint.

Value in"platform""store"null
match_reason_code?|

A built-in reason code such as not_received, or your reason's slug. An unknown or unusable reason returns 422 on this field.

Lengthlength <= 64
match_product_ids?array<integer>

Products whose tickets the rule answers; a ticket about another product, or without a purchased item, does not match. [] answers every product. At most 200 distinct IDs of your store's products; a repeated, unknown or deleted product returns 422 on match_product_ids.{index}, except a product the rule already names.

Itemsitems <= 200
match_customer_filter?|

first_purchase answers customers with at most one completed order within history_window, repeat answers customers with more.

Value in"first_purchase""repeat"null
history_window?|

How far back the customer-history conditions look: the last 7, 30 or 90 days, or all_time, which is the default.

Value in"7d""30d""90d""all_time"null
match_min_order_total_cents?|

Lowest value of the total of the ticket's purchased item, in integer USD cents (1999 means $19.99). A ticket without a purchased item does not match when either is set.

Range0 <= value <= 999999999999
match_max_order_total_cents?|

Highest value of the total of the ticket's purchased item, in integer USD cents (1999 means $19.99). A ticket without a purchased item does not match when either is set. Lower than the minimum returns 422 on this field.

Range0 <= value <= 999999999999
min_completed_orders?|

Lowest value of how many completed orders the customer has with your store within history_window.

Range0 <= value <= 4294967295
max_completed_orders?|

Highest value of how many completed orders the customer has with your store within history_window. Lower than the minimum returns 422 on this field.

Range0 <= value <= 4294967295
min_lifetime_spend_cents?|

Lowest value of what the customer spent on completed orders within history_window, in integer USD cents.

Range0 <= value <= 999999999999
max_lifetime_spend_cents?|

Highest value of what the customer spent on completed orders within history_window, in integer USD cents. Lower than the minimum returns 422 on this field.

Range0 <= value <= 999999999999
min_prior_ticket_count?|

Lowest value of how many other tickets the customer opened within history_window.

Range0 <= value <= 4294967295
max_prior_ticket_count?|

Highest value of how many other tickets the customer opened within history_window. Lower than the minimum returns 422 on this field.

Range0 <= value <= 4294967295
min_prior_support_refund_count?|

Lowest value of how many support wallet refunds the customer received on other tickets within history_window, not counting reversed ones.

Range0 <= value <= 4294967295
max_prior_support_refund_count?|

Highest value of how many support wallet refunds the customer received on other tickets within history_window, not counting reversed ones. Lower than the minimum returns 422 on this field.

Range0 <= value <= 4294967295
min_prior_support_refund_cents?|

Lowest value of the total of those support wallet refunds, in integer USD cents.

Range0 <= value <= 999999999999
max_prior_support_refund_cents?|

Highest value of the total of those support wallet refunds, in integer USD cents. Lower than the minimum returns 422 on this field.

Range0 <= value <= 999999999999
customer_age_days_min?|

Lowest value of days since the customer's first completed order within history_window.

Range0 <= value <= 4294967295
customer_age_days_max?|

Highest value of days since the customer's first completed order within history_window. Lower than the minimum returns 422 on this field.

Range0 <= value <= 4294967295
response_template_id?|

The reply template the rule sends. It must be one of your active templates with supports_auto_respond; another returns 422 on this field. If the template is paused or taken off automation later, a rule that only replies stops answering and lets the next rule try, and a rule that also refunds or closes takes the tickets it matches but does nothing for them.

action_refund_kind?|

The wallet refund the rule credits to the customer: full refunds what is left to refund on the ticket's item, partial a share of it set by action_refund_percent_basis, fixed the amount in action_refund_fixed_cents. null means the rule does not refund.

Value in"full""partial""fixed"null
action_refund_percent_basis?|

For a partial refund only: the share in hundredths of a percent, so 5000 is 50% and 750 is 7.5%. The refund is rounded down to the cent. Sent with another kind, it returns 422.

Range1 <= value <= 10000
action_refund_fixed_cents?|

For a fixed refund only: the amount in integer USD cents (500 means $5.00). Sent with another kind, it returns 422. When the item has less left to refund, the refund fails and the rule does nothing for that ticket.

Range1 <= value <= 999999999999
action_refund_cap_cents?|

Most the rule refunds automatically for one order, in integer USD cents, counted across all tickets about that order. A refund is reduced to what is left under it; when nothing is left, the rule does nothing for that ticket. Needs action_refund_kind.

Range1 <= value <= 999999999999
action_close_outcome?|

When set, the rule closes the ticket with this outcome after replying. null leaves the ticket open.

Value in"refunded""refunded_partial""delivered""no_action""duplicate""other"null
is_active?boolean

Accepted only with the value the rule already has, so a read can be sent back. Switch the rule on or off with the state endpoint; another value returns 422 on is_active.

clear?array<>

Fields to remove, since null keeps a value. match_reason removes the reason, action_refund removes the whole refund, action_refund_cap_cents only the per-order cap, action_close_outcome stops the rule closing tickets. Clearing a field you also change returns 422 on clear.

expected_updated_at?string

The updated_at you read. When the record was saved by someone else since, the change is refused with 422 on expected_updated_at and nothing is saved, so you never overwrite an edit you have not seen.

Formatdate-time
id?integer

Read-only. Accepted so a read can be sent back.

archived?boolean

Accepted only with the value the rule already has. Archive or restore the rule with the state endpoint; another value returns 422 on archived.

priority?integer

Accepted only with the value the rule already has. Change the order with the reorder endpoint; another value returns 422 on priority.

currency?"USD"

Read-only. Accepted only as USD.

Value in"USD"
created_at?|

Read-only. Accepted so a read can be sent back.

Formatdate-time
updated_at?|

Read-only and not checked. Send expected_updated_at to refuse a stale change.

Formatdate-time

Response Body

Successful response.

application/json
  1. response
data*
Example Request
curl -X PATCH 'https://sell.app/api/v2/support-automation-rules/7' \  -H 'X-STORE: launch-lab' \  -H 'Content-Type: application/json' \  -d '{  "name": "Expired download links, first refund only",  "clear": [    "match_max_order_total_cents"  ],  "expected_updated_at": "2026-07-03T09:20:00.000000Z"}'
{  "data": {    "id": 7,    "name": "Expired download links, first refund only",    "is_active": false,    "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": null,    "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:25:00.000000Z"  }}
PUT
/v2/support-automation-rules/{supportAutomationRule}

Update an automation rule. Only the conditions and actions you send change; PUT and PATCH behave the same. A field sent as null keeps its value; name it in clear to remove it. match_product_ids replaces the whole list. A change to a switched-on rule applies to the next new ticket. Switching the rule on or off, archiving and the order have their own endpoints, so is_active, archived and priority are accepted only with the values the rule already has; a read can be sent back unchanged. A template or reason the rule already has is kept even if it was paused since; a new one has to be usable. Adding a refund to a switched-on rule while support automation is on and no daily refund cap is set returns 422 on action_refund_kind. An archived rule returns 422 on supportAutomationRule: restore it first. Amounts are integer USD cents (1999 means $19.99), and action_refund_percent_basis is in hundredths of a percent (5000 is 50%). 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 same change 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
name?string

Name your team sees in the rule list.

Lengthlength <= 120
match_reason_source?|

With match_reason_code, the ticket reason the rule answers: platform for a built-in reason, store for one of yours. Send both or neither; null on both answers any reason. A store reason must be active and offered for every product. Read the codes from the support reason options endpoint.

Value in"platform""store"null
match_reason_code?|

A built-in reason code such as not_received, or your reason's slug. An unknown or unusable reason returns 422 on this field.

Lengthlength <= 64
match_product_ids?array<integer>

Products whose tickets the rule answers; a ticket about another product, or without a purchased item, does not match. [] answers every product. At most 200 distinct IDs of your store's products; a repeated, unknown or deleted product returns 422 on match_product_ids.{index}, except a product the rule already names.

Itemsitems <= 200
match_customer_filter?|

first_purchase answers customers with at most one completed order within history_window, repeat answers customers with more.

Value in"first_purchase""repeat"null
history_window?|

How far back the customer-history conditions look: the last 7, 30 or 90 days, or all_time, which is the default.

Value in"7d""30d""90d""all_time"null
match_min_order_total_cents?|

Lowest value of the total of the ticket's purchased item, in integer USD cents (1999 means $19.99). A ticket without a purchased item does not match when either is set.

Range0 <= value <= 999999999999
match_max_order_total_cents?|

Highest value of the total of the ticket's purchased item, in integer USD cents (1999 means $19.99). A ticket without a purchased item does not match when either is set. Lower than the minimum returns 422 on this field.

Range0 <= value <= 999999999999
min_completed_orders?|

Lowest value of how many completed orders the customer has with your store within history_window.

Range0 <= value <= 4294967295
max_completed_orders?|

Highest value of how many completed orders the customer has with your store within history_window. Lower than the minimum returns 422 on this field.

Range0 <= value <= 4294967295
min_lifetime_spend_cents?|

Lowest value of what the customer spent on completed orders within history_window, in integer USD cents.

Range0 <= value <= 999999999999
max_lifetime_spend_cents?|

Highest value of what the customer spent on completed orders within history_window, in integer USD cents. Lower than the minimum returns 422 on this field.

Range0 <= value <= 999999999999
min_prior_ticket_count?|

Lowest value of how many other tickets the customer opened within history_window.

Range0 <= value <= 4294967295
max_prior_ticket_count?|

Highest value of how many other tickets the customer opened within history_window. Lower than the minimum returns 422 on this field.

Range0 <= value <= 4294967295
min_prior_support_refund_count?|

Lowest value of how many support wallet refunds the customer received on other tickets within history_window, not counting reversed ones.

Range0 <= value <= 4294967295
max_prior_support_refund_count?|

Highest value of how many support wallet refunds the customer received on other tickets within history_window, not counting reversed ones. Lower than the minimum returns 422 on this field.

Range0 <= value <= 4294967295
min_prior_support_refund_cents?|

Lowest value of the total of those support wallet refunds, in integer USD cents.

Range0 <= value <= 999999999999
max_prior_support_refund_cents?|

Highest value of the total of those support wallet refunds, in integer USD cents. Lower than the minimum returns 422 on this field.

Range0 <= value <= 999999999999
customer_age_days_min?|

Lowest value of days since the customer's first completed order within history_window.

Range0 <= value <= 4294967295
customer_age_days_max?|

Highest value of days since the customer's first completed order within history_window. Lower than the minimum returns 422 on this field.

Range0 <= value <= 4294967295
response_template_id?|

The reply template the rule sends. It must be one of your active templates with supports_auto_respond; another returns 422 on this field. If the template is paused or taken off automation later, a rule that only replies stops answering and lets the next rule try, and a rule that also refunds or closes takes the tickets it matches but does nothing for them.

action_refund_kind?|

The wallet refund the rule credits to the customer: full refunds what is left to refund on the ticket's item, partial a share of it set by action_refund_percent_basis, fixed the amount in action_refund_fixed_cents. null means the rule does not refund.

Value in"full""partial""fixed"null
action_refund_percent_basis?|

For a partial refund only: the share in hundredths of a percent, so 5000 is 50% and 750 is 7.5%. The refund is rounded down to the cent. Sent with another kind, it returns 422.

Range1 <= value <= 10000
action_refund_fixed_cents?|

For a fixed refund only: the amount in integer USD cents (500 means $5.00). Sent with another kind, it returns 422. When the item has less left to refund, the refund fails and the rule does nothing for that ticket.

Range1 <= value <= 999999999999
action_refund_cap_cents?|

Most the rule refunds automatically for one order, in integer USD cents, counted across all tickets about that order. A refund is reduced to what is left under it; when nothing is left, the rule does nothing for that ticket. Needs action_refund_kind.

Range1 <= value <= 999999999999
action_close_outcome?|

When set, the rule closes the ticket with this outcome after replying. null leaves the ticket open.

Value in"refunded""refunded_partial""delivered""no_action""duplicate""other"null
is_active?boolean

Accepted only with the value the rule already has, so a read can be sent back. Switch the rule on or off with the state endpoint; another value returns 422 on is_active.

clear?array<>

Fields to remove, since null keeps a value. match_reason removes the reason, action_refund removes the whole refund, action_refund_cap_cents only the per-order cap, action_close_outcome stops the rule closing tickets. Clearing a field you also change returns 422 on clear.

expected_updated_at?string

The updated_at you read. When the record was saved by someone else since, the change is refused with 422 on expected_updated_at and nothing is saved, so you never overwrite an edit you have not seen.

Formatdate-time
id?integer

Read-only. Accepted so a read can be sent back.

archived?boolean

Accepted only with the value the rule already has. Archive or restore the rule with the state endpoint; another value returns 422 on archived.

priority?integer

Accepted only with the value the rule already has. Change the order with the reorder endpoint; another value returns 422 on priority.

currency?"USD"

Read-only. Accepted only as USD.

Value in"USD"
created_at?|

Read-only. Accepted so a read can be sent back.

Formatdate-time
updated_at?|

Read-only and not checked. Send expected_updated_at to refuse a stale change.

Formatdate-time

Response Body

Successful response.

application/json
  1. response
data*
Example Request
curl -X PUT 'https://sell.app/api/v2/support-automation-rules/7' \  -H 'X-STORE: launch-lab' \  -H 'Content-Type: application/json' \  -d '{  "name": "Expired download links, first refund only",  "clear": [    "match_max_order_total_cents"  ],  "expected_updated_at": "2026-07-03T09:20:00.000000Z"}'
{  "data": {    "id": 7,    "name": "Expired download links, first refund only",    "is_active": false,    "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": null,    "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:25:00.000000Z"  }}