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.
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.
AuthorizationBearer <API Key>Provide your SellApp API key as a bearer token.
supportAutomationRule*integerThe automation rule ID.
X-STORE?stringStore 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.
application/json- body
name?stringName your team sees in the rule list.
length <= 120match_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.
"platform""store"nullmatch_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.
length <= 64match_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.
items <= 200match_customer_filter?|first_purchase answers customers with at most one completed order within history_window, repeat answers customers with more.
"first_purchase""repeat"nullhistory_window?|How far back the customer-history conditions look: the last 7, 30 or 90 days, or all_time, which is the default.
"7d""30d""90d""all_time"nullmatch_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.
0 <= value <= 999999999999match_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.
0 <= value <= 999999999999min_completed_orders?|Lowest value of how many completed orders the customer has with your store within history_window.
0 <= value <= 4294967295max_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.
0 <= value <= 4294967295min_lifetime_spend_cents?|Lowest value of what the customer spent on completed orders within history_window, in integer USD cents.
0 <= value <= 999999999999max_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.
0 <= value <= 999999999999min_prior_ticket_count?|Lowest value of how many other tickets the customer opened within history_window.
0 <= value <= 4294967295max_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.
0 <= value <= 4294967295min_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.
0 <= value <= 4294967295max_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.
0 <= value <= 4294967295min_prior_support_refund_cents?|Lowest value of the total of those support wallet refunds, in integer USD cents.
0 <= value <= 999999999999max_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.
0 <= value <= 999999999999customer_age_days_min?|Lowest value of days since the customer's first completed order within history_window.
0 <= value <= 4294967295customer_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.
0 <= value <= 4294967295response_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.
"full""partial""fixed"nullaction_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.
1 <= value <= 10000action_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.
1 <= value <= 999999999999action_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.
1 <= value <= 999999999999action_close_outcome?|When set, the rule closes the ticket with this outcome after replying. null leaves the ticket open.
"refunded""refunded_partial""delivered""no_action""duplicate""other"nullis_active?booleanAccepted 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?stringThe 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.
date-timeid?integerRead-only. Accepted so a read can be sent back.
archived?booleanAccepted only with the value the rule already has. Archive or restore the rule with the state endpoint; another value returns 422 on archived.
priority?integerAccepted 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.
"USD"created_at?|Read-only. Accepted so a read can be sent back.
date-timeupdated_at?|Read-only and not checked. Send expected_updated_at to refuse a stale change.
date-timeSuccessful response.
application/json- response
data*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" }}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.
AuthorizationBearer <API Key>Provide your SellApp API key as a bearer token.
supportAutomationRule*integerThe automation rule ID.
X-STORE?stringStore 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.
application/json- body
name?stringName your team sees in the rule list.
length <= 120match_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.
"platform""store"nullmatch_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.
length <= 64match_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.
items <= 200match_customer_filter?|first_purchase answers customers with at most one completed order within history_window, repeat answers customers with more.
"first_purchase""repeat"nullhistory_window?|How far back the customer-history conditions look: the last 7, 30 or 90 days, or all_time, which is the default.
"7d""30d""90d""all_time"nullmatch_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.
0 <= value <= 999999999999match_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.
0 <= value <= 999999999999min_completed_orders?|Lowest value of how many completed orders the customer has with your store within history_window.
0 <= value <= 4294967295max_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.
0 <= value <= 4294967295min_lifetime_spend_cents?|Lowest value of what the customer spent on completed orders within history_window, in integer USD cents.
0 <= value <= 999999999999max_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.
0 <= value <= 999999999999min_prior_ticket_count?|Lowest value of how many other tickets the customer opened within history_window.
0 <= value <= 4294967295max_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.
0 <= value <= 4294967295min_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.
0 <= value <= 4294967295max_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.
0 <= value <= 4294967295min_prior_support_refund_cents?|Lowest value of the total of those support wallet refunds, in integer USD cents.
0 <= value <= 999999999999max_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.
0 <= value <= 999999999999customer_age_days_min?|Lowest value of days since the customer's first completed order within history_window.
0 <= value <= 4294967295customer_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.
0 <= value <= 4294967295response_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.
"full""partial""fixed"nullaction_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.
1 <= value <= 10000action_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.
1 <= value <= 999999999999action_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.
1 <= value <= 999999999999action_close_outcome?|When set, the rule closes the ticket with this outcome after replying. null leaves the ticket open.
"refunded""refunded_partial""delivered""no_action""duplicate""other"nullis_active?booleanAccepted 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?stringThe 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.
date-timeid?integerRead-only. Accepted so a read can be sent back.
archived?booleanAccepted only with the value the rule already has. Archive or restore the rule with the state endpoint; another value returns 422 on archived.
priority?integerAccepted 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.
"USD"created_at?|Read-only. Accepted so a read can be sent back.
date-timeupdated_at?|Read-only and not checked. Send expected_updated_at to refuse a stale change.
date-timeSuccessful response.
application/json- response
data*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" }}