> ## Documentation Index
> Fetch the complete documentation index at: https://developers.redo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# supportRuleUpdate

> Rename a rule, or enable or disable it. Enabling is the risky write: the rule runs from the next time its trigger fires. An enabled rule runs on live tickets without review, so read the rule's `warnings` (null when the API can't work them out), its `conditions` and `actions`, and supportRuleOverlapWarnings for rules it fights with before you enable it. Enabling a rule whose own actions send to customers (a reply, the AI agent or an assignment to it, a survey or custom code), or that has a step other than the Rules page's, needs support_messages_send as well, else INSUFFICIENT_SCOPE. That check covers only the rule's own actions: a rule that closes tickets still sets off whatever the store sends when a ticket closes, such as its satisfaction survey. A rule whose saved steps no longer load can only be disabled or deleted. Returns the rule afterwards, or null when the store has no rule with this id.

**Required scopes:** [`support_rules_write`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-support_rules_write)

## Arguments

**id** `ID!` *required*

The rule's id.

**input** `[SupportRuleUpdateInput!](/docs/api-reference/v3/reference/support/support-rule-update-input)` *required*

**fields**

**enabled** `Boolean`

True publishes the rule, so it runs on live tickets from the next time its trigger fires; false stops it.

**name** `String`

Saved trimmed: not blank, at most 200 characters.

## Returns

**supportRuleUpdate** `[SupportRule](/docs/api-reference/v3/reference/support/support-rule)`

A rule the store created in the help desk's rule settings. A deleted rule can't be read.

**fields**

**actions** `[\[SupportRuleAction!\]](/docs/api-reference/v3/reference/support/support-rule-action)`

What the rule does, in order. A kind the API doesn't take yet, such as a reply, has a null `kind`. Null for a rule that isn't LINEAR, whose steps the API doesn't read.

**fields**

**config** `[JSON](/docs/api-reference/v3/reference/common/json)`

The kind's settings. Their shape is the `configJsonSchema` of this kind and version in supportRuleKinds. Null for a kind the API doesn't take yet, such as a reply or a nested group made on the Rules page; the page shows it.

**kind** `String`

The kind, as supportRuleKinds lists it. Null for a kind the API doesn't take yet, such as a reply or a nested group made on the Rules page; the page shows it.

**kindVersion** `Int`

The version of the kind the config is written for. Null for a kind the API doesn't take yet, such as a reply or a nested group made on the Rules page; the page shows it.

**conditionMatch** `[SupportRuleConditionMatch](/docs/api-reference/v3/reference/support/support-rule-condition-match)`

Which of `conditions` must pass for `actions` to run; ALL when there are none. Null for a rule that isn't LINEAR.

**conditions** `[\[SupportRuleCondition!\]](/docs/api-reference/v3/reference/support/support-rule-condition)`

What a ticket must match for the actions to run; none runs them every time the trigger fires. A kind the API doesn't take yet has a null `kind`. Null for a rule that isn't LINEAR, whose steps the API doesn't read.

**fields**

**config** `[JSON](/docs/api-reference/v3/reference/common/json)`

The kind's settings. Their shape is the `configJsonSchema` of this kind and version in supportRuleKinds. Null for a kind the API doesn't take yet, such as a reply or a nested group made on the Rules page; the page shows it.

**kind** `String`

The kind, as supportRuleKinds lists it. Null for a kind the API doesn't take yet, such as a reply or a nested group made on the Rules page; the page shows it.

**kindVersion** `Int`

The version of the kind the config is written for. Null for a kind the API doesn't take yet, such as a reply or a nested group made on the Rules page; the page shows it.

**description** `String!` *required*

The rule's description; empty when it has none.

**enabled** `Boolean!` *required*

Whether the rule runs when its trigger fires.

**id** `ID!` *required*

The id of this rule.

**name** `String!` *required*

The rule's name.

**position** `Int!` *required*

Where the rule runs among the store's rules and the built-in rules, which share this sequence (`SupportDefaultRule.position`): lower runs first, and at the same position a built-in rule runs first. Change it with supportRulesReorder.

**shape** `[SupportRuleShape!](/docs/api-reference/v3/reference/support/support-rule-shape)` *required*

Whether the rule is one set of conditions and one list of actions, which `conditions` and `actions` show, a graph of steps the Rules page built, with branches or waits, or steps that no longer load.

**trigger** `[SupportRuleTrigger](/docs/api-reference/v3/reference/support/support-rule-trigger)`

What makes the rule run. Null for a rule on a trigger about a team member rather than a ticket, or with steps that don't hold one.

**updatedAt** `[DateTime](/docs/api-reference/v3/reference/common/date-time)`

When the rule last changed. Null for a rule never saved with the time.

**warnings** `[\[SupportRuleWarning!\]](/docs/api-reference/v3/reference/support/support-rule-warning)`

What enabling the rule risks: closing or replying to every ticket that triggers it, or fighting with teammates. Empty when none applies, and null for a rule that isn't LINEAR, whose risks the API doesn't work out; read it with `conditions` and supportRuleOverlapWarnings before you enable the rule.

**fields**

**code** `[SupportRuleWarningCode!](/docs/api-reference/v3/reference/support/support-rule-warning-code)` *required*

Which risk it is; branch on this.

**message** `String!` *required*

The warning in a sentence, for a person to read. Its wording can change.

## Errors

Besides the [errors any request can return](https://developers.redo.com/docs/api-reference/v3/errors.md), this operation fails with these codes in `extensions.code`.

| Code | HTTP status | Meaning | Retry |
| - | - | - | - |
| `API_TOKEN_REQUIRED` | `403` | The credential has neither an API token nor a team member to attribute the change to, such as a first-party service's token, or is a merchant-app session, which can't make this write. Nothing was sent. | Call with a store API token, or with a credential that acts for a team member: the public MCP's, or a merchant-app session's for a write that accepts one. |
| `FORBIDDEN` | `403` | The team member the change is made for doesn't have the permission it needs. Nothing was written. | Ask a store admin to grant the permission, or call with a store API token. |
| `BAD_USER_INPUT` | `400` | An argument is invalid, or names something the store doesn't have. The message says which. Nothing was written. | Fix the input the message names, then send it again. |
| `INSUFFICIENT_SCOPE` | `403` | The token lacks a scope the request needs: for a field, or for a part of the write the service decides from the record, such as a macro's internal note. The message names the scope. Nothing was written. | Use a token with the scope the message names, or leave out the part that needs it. |
| `INTERNAL_SERVER_ERROR` | `500` | Something failed on Redo's side. The change may or may not have been made. | Read the record to see whether the change was made before sending it again. A send with an idempotencyKey is safe to retry with the same key. |

## Example

```graphql theme={null}
mutation {
  supportRuleUpdate(id: "...", input: { ... }) {
    conditionMatch
    description
    enabled
    id
    name
    position
    shape
    trigger
    # ...
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.