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

# supportRuleCreate

> Create a rule, always disabled: it runs on no ticket until supportRuleUpdate enables it. Its conditions and actions are of the kinds supportRuleKinds lists. It goes after every rule and built-in rule, so the built-in rules can't undo what it does; move it with supportRulesReorder. Its actions run when its trigger fires and its conditions pass. A request that fails with INTERNAL_SERVER_ERROR may have saved the rule: look for it with supportRules before you send it again. 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.

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

## Arguments

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

**fields**

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

Run in order: 1 to 20.

**fields**

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

The kind's settings, matching the `configJsonSchema` of this kind and version in supportRuleKinds.

**kind** `String!` *required*

A kind supportRuleKinds lists, such as `sender`.

**kindVersion** `Int!` *required*

The version of the kind the config is written for.

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

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

At most 50. None, or omitted, runs the actions every time the trigger fires.

**fields**

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

The kind's settings, matching the `configJsonSchema` of this kind and version in supportRuleKinds.

**kind** `String!` *required*

A kind supportRuleKinds lists, such as `sender`.

**kindVersion** `Int!` *required*

The version of the kind the config is written for.

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

Saved trimmed: not blank, at most 200 characters.

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

## Returns

**supportRuleCreate** `[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. |
| `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 {
  supportRuleCreate(input: { ... }) {
    conditionMatch
    description
    enabled
    id
    name
    position
    shape
    trigger
    # ...
  }
}
```


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