> ## 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.

# supportRulesReorder

> Set the order rules run in, first to last. The store's rules and its built-in rules share one order: list every rule supportRules lists and every rule supportDefaultRules lists, each once; each takes its place in the list as its position. A rule whose saved steps no longer load may be left out, and keeps its place. A list that leaves one out, as when a rule was added meanwhile, or names one twice is BAD_USER_INPUT; a rule id the store doesn't have is NOT_FOUND. At most 1000 entries. Rules on different triggers never run together, so only the order among rules on one trigger changes what they do. Only rules whose place changed are written. If the request fails partway, or two reorders run at once (the last write to each rule wins), send the order again. Returns the store's rules in their new order; supportDefaultRules shows the built-in rules' positions.

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

## Arguments

**order** `[\[SupportRuleOrderEntryInput!\]!](/docs/api-reference/v3/reference/support/support-rule-order-entry-input)` *required*

**fields**

**defaultRuleKind** `[SupportDefaultRuleKind](/docs/api-reference/v3/reference/support/support-default-rule-kind)`

**ruleId** `ID`

## Returns

**supportRulesReorder** `[\[SupportRule!\]!](/docs/api-reference/v3/reference/support/support-rule)` *required*

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. |
| `NOT_FOUND` | `404` | An id the request refers to, other than its target, doesn't exist in the store. A missing target returns null instead. | Use an id that exists in the store. |
| `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 {
  supportRulesReorder(order: { ... }) {
    conditionMatch
    description
    enabled
    id
    name
    position
    shape
    trigger
    # ...
  }
}
```


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