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

# recoverConfigUpdate

> Update a Recover config. Changes apply at once, as the Recover builder's Save does, and omitted fields are unchanged. Returns null if no config in this store has the id. A message that uses a variable it can't have, or uses `{{ discount_code }}` or `{{ discount_link }}` with no discount, is a 400 error with an extension code of BAD_USER_INPUT, and nothing is changed. The error names the builder's wording: Outreach message is `outreachTemplate`, Reply message is `replyTemplate`, Fallback message is `fallback.template`, and the discount menu is `discountCodeId`.

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

## Arguments

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

The config's `id`, or the `templateId` from a RECOVER step's params in an automation.

**input** `[RecoverConfigUpdateInput!](/docs/api-reference/v3/reference/marketing/recover-config-update-input)` *required*

The fields to change.

**fields**

**ageGateYears** `Int`

The minimum age a shopper must confirm before Recover replies, from 1 to 120. Null removes the age gate.

**agentOutreachEnabled** `Boolean`

True lets Commerce Agent write each outreach message, with `outreachTemplate` as its guidance. False is the builder's Fixed message: `outreachTemplate` is sent as written.

**discountCodeId** `ID`

The discount that `{{ discount_code }}` and `{{ discount_link }}` resolve to: the `id` of one of the store's Recover discounts, which the builder lists in its discount menu. Null removes the discount.

**fallback** `[RecoverFallbackInput](/docs/api-reference/v3/reference/marketing/recover-fallback-input)`

Changes to the fallback.

**fields**

**mode** `[RecoverFallbackMode](/docs/api-reference/v3/reference/marketing/recover-fallback-mode)`

What Recover does with a reply the reply message doesn't cover.

**template** `String`

The Fallback message, which is sent as written when `mode` is TEMPLATE.

**name** `String`

The config's name in the Recover builder. It can't be blank.

**outreachTemplate** `String`

The Outreach message: the first message to the shopper, or the agent's guidance for it when `agentOutreachEnabled` is true. It can't be blank, as in the Recover builder.

**replyTemplate** `String`

The Reply message, sent as written when a shopper's reply fits the scenario the outreach set up. Null removes it, so every reply goes to the fallback.

## Returns

**recoverConfigUpdate** `[RecoverConfig](/docs/api-reference/v3/reference/marketing/recover-config)`

The settings of one Recover step in a marketing automation: the outreach message it sends, how it answers the shopper's replies, and the discount it offers.

**fields**

**ageGateYears** `Int`

The minimum age a shopper must confirm before Recover sends replies: Recover asks for a birthdate first and replies once the shopper meets this age. Null when there is no age gate.

**agentOutreachEnabled** `Boolean!` *required*

Whether Commerce Agent writes each outreach message. When true, `outreachTemplate` is guidance for the agent and each shopper gets a personalized message. When false, `outreachTemplate` is sent as written.

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

When the config was created. Null for a config with no recorded time.

**discountCode** `[DiscountCode](/docs/api-reference/v3/reference/marketing/discount-code)`

The discount that `{{ discount_code }}` and `{{ discount_link }}` in the messages resolve to. Null when the config has none. When the store gives each shopper a discount from its discount offer list, the offer list's pick is used instead: in the outreach only when `agentOutreachEnabled` is true, and always in the reply template. Reading it needs the `campaigns_read` scope, which Marketing access includes.

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

**fields**

**code** `String!` *required*

The code customers enter at checkout.

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

When the discount was created.

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

A short human-readable summary of what the code does.

**expiration** `[DiscountCodeExpiration!](/docs/api-reference/v3/reference/marketing/discount-code-expiration)` *required*

When this code stops working.

**fields**

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

The expiry instant when `type` is ON\_DATE.

**days** `Int`

Days after creation when `type` is AFTER\_DAYS.

**type** `[DiscountCodeExpirationType!](/docs/api-reference/v3/reference/marketing/discount-code-expiration-type)` *required*

Whether the code never expires, expires on a date, after a number of days, or on delivery.

**externalId** `String!` *required*

The platform's id for this discount (a Shopify GID or a BigCommerce promotion id).

**groupType** `[DiscountCodeGroupType!](/docs/api-reference/v3/reference/marketing/discount-code-group-type)` *required*

Whether this is one fixed code or a unique code per customer.

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

The id of this discount code.

**kind** `[DiscountCodeKind](/docs/api-reference/v3/reference/marketing/discount-code-kind)`

How the discount reduces the order. Null when the config has no settings type.

**legacyId** `String!` *required*

The discount's legacy Mongo ObjectId (24-char hex) from before the CockroachDB migration.

**provider** `[DiscountCodeProvider!](/docs/api-reference/v3/reference/marketing/discount-code-provider)` *required*

The commerce platform that hosts this code.

**settings** `[DiscountCodeSettings](/docs/api-reference/v3/reference/marketing/discount-code-settings)`

How the discount reduces the order.

**title** `String!` *required*

The merchant-facing name of the discount.

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

When the discount was last edited.

**fallback** `[RecoverFallback!](/docs/api-reference/v3/reference/marketing/recover-fallback)` *required*

What Recover does with a reply that `replyTemplate` doesn't cover, or with every reply when there is no reply template.

**fields**

**mode** `[RecoverFallbackMode!](/docs/api-reference/v3/reference/marketing/recover-fallback-mode)` *required*

What Recover does with such a reply.

**template** `String!` *required*

The message sent as the reply when `mode` is TEMPLATE. It is kept when `mode` is another value, and used again if `mode` goes back to TEMPLATE.

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

The id of this Recover config. `recoverConfig` also accepts the `templateId` from a RECOVER step's params in an automation.

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

The config's name in the Recover builder, which the merchant uses to tell their Recover configs apart.

**outreachTemplate** `String!` *required*

The first message to the shopper, or the agent's guidance for it when `agentOutreachEnabled` is true. It can use variables such as `{{ discount_code }}`.

**replyTemplate** `String`

The message sent as written when a shopper's reply fits the scenario the outreach set up. Null when there is none: every reply is handled by `fallback`.

**trigger** `[MarketingTrigger!](/docs/api-reference/v3/reference/marketing/marketing-trigger)` *required*

The trigger the config was created for, which decides the variables its messages can use. Set when the config is created and not changed. A config saved before triggers were recorded reads as MARKETING\_CHECKOUT\_ABANDONMENT. UNKNOWN when the stored trigger is not modeled in this API version.

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

When the config was last edited. Null for a config with no recorded time.

## Example

```graphql theme={null}
mutation {
  recoverConfigUpdate(id: "...", input: { ... }) {
    ageGateYears
    agentOutreachEnabled
    createdAt
    id
    name
    outreachTemplate
    replyTemplate
    trigger
    # ...
  }
}
```


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