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

# supportCsatSettingsUpdate

> Change the store's CSAT survey settings, as its Customer satisfaction settings save them: the settings page and the rules engine's built-in CSAT rule both change. Arguments you omit are unchanged. Returns the settings after the change.

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

## Arguments

**abTestEnabled** `Boolean`

Turning it on needs an arm with a weight above 0; otherwise BAD\_USER\_INPUT.

**abTestVariants** `[\[SupportCsatAbTestVariantInput!\]](/docs/api-reference/v3/reference/support/support-csat-ab-test-variant-input)`

Replaces the arms; empty removes them. At most 10.

**fields**

**emailTemplateId** `ID`

Omitted or null uses the store's emailTemplate. A SupportCsatSurveyTemplate id. It must print the survey link (hasSurveyLink), unless it is already saved; otherwise BAD\_USER\_INPUT. A template the store doesn't have as a CSAT survey template is NOT\_FOUND.

**key** `String!` *required*

1 to 64 letters, digits, - or \_, unique within the test. Keep an arm's key to keep its results.

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

1 to 100 characters.

**sendDelay** `[SupportCsatSendDelay](/docs/api-reference/v3/reference/support/support-csat-send-delay)`

Omitted or null uses the store's sendDelay.

**weight** `Int!` *required*

From 0 to 100: the arm's share of surveys, relative to the other arms. 0 never picks it.

**allowsComment** `Boolean`

**emailTemplateId** `ID`

Null sends the built-in layout. A SupportCsatSurveyTemplate id. It must print the survey link (hasSurveyLink), unless it is already saved; otherwise BAD\_USER\_INPUT. A template the store doesn't have as a CSAT survey template is NOT\_FOUND.

**enabled** `Boolean`

**headerImageUrl** `String`

An http or https URL. Null clears it. Only the built-in layout shows it.

**inboxEmails** `[String!]`

Replaces the inboxes; empty surveys every inbox. At most 100. An address not already saved must be one of the store's connected email addresses, ignoring case, and is saved as connected; otherwise BAD\_USER\_INPUT.

**messageHtml** `String`

The built-in layout's body, as HTML. It is sanitized as the app's signature HTML is. Null or blank restores the message the settings page starts from.

**methods** `[\[SupportCsatSurveyMethod!\]](/docs/api-reference/v3/reference/support/support-csat-survey-method)`

Replaces the methods. Email surveys go out only with EMAIL listed.

**samplePercentage** `Int`

From 0 to 100.

**sendDelay** `[SupportCsatSendDelay](/docs/api-reference/v3/reference/support/support-csat-send-delay)`

## Returns

**supportCsatSettingsUpdate** `[SupportCsatSettings!](/docs/api-reference/v3/reference/support/support-csat-settings)` *required*

How the store surveys customers about their support, as its Customer satisfaction settings show it. One per store.

**fields**

**abTestEnabled** `Boolean!` *required*

Whether surveys are split across abTestVariants. When false, every survey uses the store's settings.

**abTestVariants** `[\[SupportCsatAbTestVariant!\]!](/docs/api-reference/v3/reference/support/support-csat-ab-test-variant)` *required*

The A/B test's arms, kept while the test is off. Empty when none were set up.

**fields**

**emailTemplate** `[SupportCsatSurveyTemplate](/docs/api-reference/v3/reference/support/support-csat-survey-template)`

The arm's survey email. Null uses the store's emailTemplate, or the template was deleted.

**fields**

**hasSurveyLink** `Boolean`

Whether the template prints the survey link. A template without it can't be the store's survey: the survey would send the built-in layout instead, so the app refuses it. Null, with an error, when it can't be checked. A request checks its templates 100 at a time, for 10 points each time.

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

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

The template's id, the same id the template has as an EmailTemplate.

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

The merchant-facing name of the template.

**key** `String!` *required*

The arm's key, unique within the test.

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

The arm's name.

**sendDelay** `[SupportCsatSendDelay](/docs/api-reference/v3/reference/support/support-csat-send-delay)`

How long after a ticket closes the arm's survey is sent. Null uses the store's sendDelay.

**weight** `Int!` *required*

The arm's share of surveys, relative to the other arms. An arm weighted 0 is never picked.

**allowsComment** `Boolean!` *required*

Whether customers can add a comment to their rating.

**emailTemplate** `[SupportCsatSurveyTemplate](/docs/api-reference/v3/reference/support/support-csat-survey-template)`

The template the survey email is sent with. Null sends the built-in layout, as does a template that was deleted.

**fields**

**hasSurveyLink** `Boolean`

Whether the template prints the survey link. A template without it can't be the store's survey: the survey would send the built-in layout instead, so the app refuses it. Null, with an error, when it can't be checked. A request checks its templates 100 at a time, for 10 points each time.

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

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

The template's id, the same id the template has as an EmailTemplate.

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

The merchant-facing name of the template.

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

Whether the store sends CSAT surveys at all.

**headerImageUrl** `String`

The image at the top of the built-in survey email. Null when none is set. Templates ignore it.

**inboxEmails** `[String!]!` *required*

Only tickets received at these inbox addresses get a survey. Empty means every inbox.

**messageHtml** `String`

The body of the built-in survey email, as HTML. Null when none is set, and the email then has no message. Templates ignore it.

**methods** `[\[SupportCsatSurveyMethod!\]!](/docs/api-reference/v3/reference/support/support-csat-survey-method)` *required*

Where surveys go: by email, in the storefront chat, or both. Empty sends none.

**samplePercentage** `Int!` *required*

The share of eligible tickets surveyed, from 0 to 100. 100 surveys every one.

**sendDelay** `[SupportCsatSendDelay!](/docs/api-reference/v3/reference/support/support-csat-send-delay)` *required*

How long after a ticket closes its survey is sent, unless an A/B test arm sets its own.

## 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 no API token to attribute the change to, such as a first-party token. Nothing was sent. | 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 {
  supportCsatSettingsUpdate(abTestEnabled: true, abTestVariants: { ... }, allowsComment: true, emailTemplateId: "...", enabled: true, headerImageUrl: "...", inboxEmails: "...", messageHtml: "...", methods: EMAIL, samplePercentage: 10, sendDelay: FIVE_MINUTES) {
    abTestEnabled
    allowsComment
    enabled
    headerImageUrl
    inboxEmails
    messageHtml
    methods
    samplePercentage
    # ...
  }
}
```


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