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

# supportAiAgentCustomerSupportUpdate

> Change AI customer support, as AI Agent › General saves it. A change to `liveChatEnabled`, `autopilotEnabled` or `channels` rewrites the AI reply and AI assignment rules in the same call, so one agent answers each channel. Turning one of those on fails with ACTION_REJECTED while the store hasn't accepted AI billing (`customerSupport.available`). A change to any field but `copilotEnabled` and `copilotAutoDraftEnabled` changes what the AI agent tells or does for shoppers at once, so it also needs commerce_agent_settings_publish (otherwise INSUFFICIENT_SCOPE, and nothing is written). A field sent at its current value is no change, so write scope alone may resend the whole page. A changed value outside its field's stated limits fails with BAD_USER_INPUT and nothing is written. If a write fails part way, the call fails with TRY_AGAIN; send it again.

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

## Arguments

**input** `[SupportAiAgentCustomerSupportInput!](/docs/api-reference/v3/reference/support/support-ai-agent-customer-support-input)` *required*

**fields**

**autopilotEnabled** `Boolean`

Whether AI customer support takes new tickets on the channels in `channels`, handing a ticket to a team member when it can't help. Not null; omit it to keep the value.

**channels** `[SupportAiAgentChannelsInput](/docs/api-reference/v3/reference/support/support-ai-agent-channels-input)`

Channel changes. Null, like omitting it, changes no channel.

**fields**

**attentive** `Boolean`

Attentive. Not null; omit it to keep the value.

**email** `Boolean`

Email, including the contact form. Not null; omit it to keep the value.

**facebookComments** `Boolean`

Public replies to Facebook comments. Off keeps the AI agent on messages only. Not null; omit it to keep the value.

**facebookMessages** `Boolean`

Facebook Messages. Not null; omit it to keep the value.

**instagramComments** `Boolean`

Public replies to Instagram comments. Off keeps the AI agent on DMs only. Not null; omit it to keep the value.

**instagramMessages** `Boolean`

Instagram DMs. Not null; omit it to keep the value.

**postscript** `Boolean`

Postscript. Not null; omit it to keep the value.

**sms** `Boolean`

SMS. Not null; omit it to keep the value.

**tiktok** `Boolean`

TikTok Shop. Not null; omit it to keep the value.

**closeNoReplyTicketsOnHandoff** `Boolean`

Whether a ticket tagged ai:no\_reply is closed, instead of opened, when AI customer support hands it to a team member. Not null; omit it to keep the value.

**copilotAutoDraftEnabled** `Boolean`

Whether Copilot drafts a reply when a customer message arrives. Not null; omit it to keep the value.

**copilotEnabled** `Boolean`

AI Copilot, which drafts and refines replies for team members. Copilot never sends. Not null; omit it to keep the value.

**excludedEmailAddresses** `[String!]`

Email addresses AI customer support never replies to; their tickets are left for the team. At most 500 entries, each at most 255 characters. Not null; omit it to keep the value.

**excludedEmailDomains** `[String!]`

Email domains AI customer support never replies to; their tickets are left for the team. At most 500 entries, each at most 255 characters. Not null; omit it to keep the value.

**liveChatEnabled** `Boolean`

Whether AI customer support answers the storefront chat widget. Not null; omit it to keep the value.

**respondToInternalEmailsEnabled** `Boolean`

Whether AI customer support replies to email from the store's own verified custom domains. Not null; omit it to keep the value.

## Returns

**supportAiAgentCustomerSupportUpdate** `[SupportAiAgentSettings!](/docs/api-reference/v3/reference/support/support-ai-agent-settings)` *required*

How the store's AI agent handles support tickets, recommends products and uses its skills, as the AI Agent settings pages set them. Its name, voice, brand description and discount are in `commerceAgentConfig`.

**fields**

**customerSupport** `[SupportAiAgentCustomerSupport!](/docs/api-reference/v3/reference/support/support-ai-agent-customer-support)` *required*

**fields**

**autopilotEnabled** `Boolean!` *required*

Whether AI customer support takes new tickets on the channels in `channels`, handing a ticket to a team member when it can't help.

**available** `Boolean!` *required*

Whether the store may turn AI customer support on: false until AI billing is accepted, when the General tab hides it and turning `liveChatEnabled`, `autopilotEnabled` or a channel on fails with ACTION\_REJECTED.

**channels** `[SupportAiAgentChannels!](/docs/api-reference/v3/reference/support/support-ai-agent-channels)` *required*

Where AI customer support takes tickets.

**fields**

**attentive** `Boolean!` *required*

Attentive.

**email** `Boolean!` *required*

Email, including the contact form.

**facebookComments** `Boolean!` *required*

Public replies to Facebook comments. Off keeps the AI agent on messages only.

**facebookMessages** `Boolean!` *required*

Facebook Messages.

**instagramComments** `Boolean!` *required*

Public replies to Instagram comments. Off keeps the AI agent on DMs only.

**instagramMessages** `Boolean!` *required*

Instagram DMs.

**postscript** `Boolean!` *required*

Postscript.

**sms** `Boolean!` *required*

SMS.

**tiktok** `Boolean!` *required*

TikTok Shop.

**closeNoReplyTicketsOnHandoff** `Boolean!` *required*

Whether a ticket tagged ai:no\_reply is closed, instead of opened, when AI customer support hands it to a team member.

**copilotAutoDraftEnabled** `Boolean!` *required*

Whether Copilot drafts a reply when a customer message arrives.

**copilotEnabled** `Boolean!` *required*

AI Copilot, which drafts and refines replies for team members. Copilot never sends.

**excludedEmailAddresses** `[String!]!` *required*

Email addresses AI customer support never replies to; their tickets are left for the team. At most 500 entries, each at most 255 characters.

**excludedEmailDomains** `[String!]!` *required*

Email domains AI customer support never replies to; their tickets are left for the team. At most 500 entries, each at most 255 characters.

**liveChatEnabled** `Boolean!` *required*

Whether AI customer support answers the storefront chat widget.

**respondToInternalEmailsEnabled** `Boolean!` *required*

Whether AI customer support replies to email from the store's own verified custom domains.

**productRecommendations** `[SupportAiAgentProductRecommendations!](/docs/api-reference/v3/reference/support/support-ai-agent-product-recommendations)` *required*

**fields**

**excludedProductTags** `[String!]!` *required*

Products with any of these tags are never recommended. At most 500 entries, each at most 255 characters.

**ignoreInventoryEnabled** `Boolean!` *required*

Whether the AI agent treats every product as available, whatever its inventory.

**ignoreInventoryText** `String!` *required*

What the AI agent says about availability while `ignoreInventoryEnabled` is on, at most 500 characters.

**limitRecommendationsEnabled** `Boolean!` *required*

Whether the AI agent recommends at most `recommendationLimit` products.

**recommendationLimit** `Int!` *required*

The most products the AI agent recommends at once, from 1.

**suggestedShopifyProductIds** `[String!]!` *required*

Shopify product ids (the number in gid://shopify/Product/\<id>, digits only) the AI agent suggests first, at most 5; otherwise BAD\_USER\_INPUT.

**skills** `[SupportAiAgentSkills!](/docs/api-reference/v3/reference/support/support-ai-agent-skills)` *required*

**fields**

**backInStockNotificationsEnabled** `Boolean!` *required*

Whether the AI agent offers a shopper an email when an out-of-stock product is back. It needs a marketing (email and SMS) subscription: without one the page locks it, and a change fails with ACTION\_REJECTED.

**cartEditingEnabled** `Boolean!` *required*

Whether the AI agent may edit a shopper's cart.

**discountCodesEnabled** `Boolean!` *required*

Whether the AI agent may create discount codes. The discount it creates them from is the Commerce Agent config's `discount`.

**orderEditingEnabled** `Boolean!` *required*

Whether the AI agent may edit orders. Turning it on saves it off until the shopper agent or AI customer support is live for the store, as the page does. The order editing settings page shows the same setting.

**productBundleDiscountExpirationMinutes** `Int!` *required*

How long a bundle discount code lasts, in minutes, from 0.

**productBundleMaxDiscountPercentage** `Float!` *required*

The largest bundle discount, from 0 to 10 percent.

**productBundlesEnabled** `Boolean!` *required*

Whether the AI agent may offer product bundles.

**productVisualizationEnabled** `Boolean!` *required*

Whether the AI agent offers Try It On images of a shopper wearing a product.

**returnsPortalLinkOverrideUrl** `String!` *required*

The returns portal link the AI agent sends instead of the default one: an https URL of at most 2048 characters, or empty for the default.

**tryItOnMessage** `String`

The message that offers Try It On, at most 500 characters. Null while the store uses the default message.

## 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. |
| `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. |
| `ACTION_REJECTED` | `422` | The record can't take the action now, or the platform it belongs to refused it. The message says why, in words a merchant can act on. | Act on the message, such as reconnecting the store's account, then send it again. A platform rate limit clears on its own after a few minutes. |
| `TRY_AGAIN` | `503` | The change couldn't start for a passing reason, and nothing was written or sent. | Send the same request again after a short wait, with the same idempotencyKey if it has one. |
| `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 {
  supportAiAgentCustomerSupportUpdate(input: { ... })
}
```


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