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

# popupUpdate

> Change a popup's settings: the popup builder's Settings tab, with the same rules. Omitted fields are unchanged. A change to a published popup reaches shoppers within about a minute, as a builder save does. Fails with `BAD_USER_INPUT` (400) for a value the builder wouldn't accept, `DISCOUNT_CODE_NOT_FOUND` (400) for a discount not in this store or no longer in its commerce platform, `ACTION_REJECTED` (422) for CHECKOUT_PROBABILITY while Intent AI is off, for country targeting without at least two Shopify Markets countries, or for a published back-in-stock popup left with no way to open (no embed launcher and `opensAutomatically` false), `CONFLICT` (409) when the popup keeps changing in the builder while saving, and `TRY_AGAIN` (503) when the store's Shopify Markets or the discount can't be checked; nothing is changed then. Returns null if no popup with that id is owned by the caller.

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

## Arguments

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

The popup's `id`, or its `legacyId` from an earlier version of the Redo API.

**input** `[PopupUpdateInput!](/docs/api-reference/v3/reference/marketing/popup-update-input)` *required*

The settings to change.

**fields**

**allowPageInteraction** `Boolean`

Whether shoppers can scroll and click the page behind the open popup.

**campaignTargeting** `[PopupCampaignTargetingInput](/docs/api-reference/v3/reference/marketing/popup-campaign-targeting-input)`

Which UTM campaigns the popup is limited to.

**fields**

**mode** `[PopupCampaignTargetingMode!](/docs/api-reference/v3/reference/marketing/popup-campaign-targeting-mode)` *required*

Whether the popup is limited by UTM campaign.

**utmCampaigns** `[String!]`

The `utm_campaign` values that show the popup, trimmed, none blank. Replaces the whole list; omit it to keep the stored one. To add one, send the current list plus the new value; an empty list removes them all, so every visitor sees the popup.

**closeButton** `[PopupCloseButtonInput](/docs/api-reference/v3/reference/marketing/popup-close-button-input)`

How the close (X) button looks.

**fields**

**backgroundColor** `String`

The color of the circle behind the X, as a hex color.

**iconColor** `String`

The X's color, as a hex color such as #A3A3A3.

**showBackground** `Boolean`

Whether the X has a colored circle behind it.

**completionTags** `[String!]`

Tags added to each customer who completes the popup, trimmed and de-duplicated, none blank. Replaces the whole list. To add one, send the current tags plus the new tag; an empty list removes them all.

**countryTargeting** `[PopupCountryTargetingInput](/docs/api-reference/v3/reference/marketing/popup-country-targeting-input)`

Which shopper countries the popup is shown in.

**fields**

**countries** `[\[CountryCode!\]](/docs/api-reference/v3/reference/common/country-code)`

The countries to list. Replaces the whole list; omit it to keep the stored one. To add one, send the current list plus the new country; an empty list removes them all, and with INCLUDE the popup then shows nowhere.

**mode** `[PopupCountryTargetingMode!](/docs/api-reference/v3/reference/marketing/popup-country-targeting-mode)` *required*

Which countries the popup is shown in. INCLUDE or EXCLUDE needs at least two countries in the store's Shopify Markets.

**device** `[PopupDevice](/docs/api-reference/v3/reference/marketing/popup-device)`

Which devices show the popup. DESKTOP\_ONLY or MOBILE\_ONLY also shows the popup's elements hidden on the other device, as the builder does, so none is left invisible.

**discountCodeId** `ID`

The discount to offer in the signup flows the popup starts: the `id` of one of the store's discount codes with no `category` or the MARKETING category (what `createDiscountCode` makes) that isn't a dynamic range and still exists in the store's commerce platform, the ones the builder's discount menu lists. Null turns the discount offer off.

**frequencyCapHours** `Int`

Hours before the popup shows to the same visitor again, from 1 to 720. Null resets it to the default of 24.

**languages** `[String!]`

The languages the popup offers its copy in, as locale codes such as `fr` or `pt-BR`: ones the builder's language picker lists, or ones already saved on the popup. Replaces the whole list. To add one, send the current list plus the new code; an empty list removes them all, so the popup offers only its authored copy. Translations are written in the builder.

**pageRules** `[\[PopupPageRuleInput!\]](/docs/api-reference/v3/reference/marketing/popup-page-rule-input)`

Which storefront pages show the popup. Replaces the whole list. To add one, send the current rules plus the new one; an empty list removes them all, so the popup shows on every page.

**fields**

**type** `[PopupPageRuleType!](/docs/api-reference/v3/reference/marketing/popup-page-rule-type)` *required*

Whether matching pages show or hide the popup.

**url** `String!` *required*

A full http(s) URL or a path such as `/products/*`, with `*` standing for any text. Not blank, and no spaces.

**renderMode** `[PopupRenderMode](/docs/api-reference/v3/reference/marketing/popup-render-mode)`

TRIGGERED or INLINE. Making a popup INLINE the first time creates its `embedCode`. A BACK\_IN\_STOCK popup can't be INLINE.

**target** `[PopupTarget](/docs/api-reference/v3/reference/marketing/popup-target)`

Which visitors see the popup: the builder's Targeting setting.

**trigger** `[PopupTriggerInput](/docs/api-reference/v3/reference/marketing/popup-trigger-input)`

The popup's one trigger.

**fields**

**delaySeconds** `Int`

For TIME\_ON\_PAGE only: seconds on the page before the popup shows, a whole number greater than 0. Omit to keep the stored delay.

**kind** `[PopupTriggerChoice!](/docs/api-reference/v3/reference/marketing/popup-trigger-choice)` *required*

What shows the popup.

**opensAutomatically** `Boolean`

For BACK\_IN\_STOCK only: whether the popup opens by itself when the shopper selects an out-of-stock variant. Omit to keep the stored value.

## Returns

**popupUpdate** `[Popup](/docs/api-reference/v3/reference/marketing/popup)`

A storefront popup: a modal, full-screen or panel form shown to shoppers, often to collect email and SMS signups. Views and signups are not here; read them from an analytics report.

**fields**

**allowPageInteraction** `Boolean!` *required*

Whether shoppers can scroll and click the page behind the open popup. False locks the page behind it.

**campaignTargeting** `[PopupCampaignTargeting!](/docs/api-reference/v3/reference/marketing/popup-campaign-targeting)` *required*

Which UTM campaigns the popup is limited to.

**fields**

**mode** `[PopupCampaignTargetingMode!](/docs/api-reference/v3/reference/marketing/popup-campaign-targeting-mode)` *required*

Whether the popup is limited by campaign.

**utmCampaigns** `[String!]!` *required*

The `utm_campaign` values that show the popup when `mode` is UTM\_CAMPAIGNS, matched exactly. Kept, but unused, when `mode` is ALL\_VISITORS.

**closeButton** `[PopupCloseButton!](/docs/api-reference/v3/reference/marketing/popup-close-button)` *required*

How the popup's close (X) button looks.

**fields**

**backgroundColor** `String!` *required*

The color of the circle behind the X, as a hex color such as #FFFFFF. Shown only when `showBackground` is true.

**iconColor** `String!` *required*

The X's color, as a hex color such as #A3A3A3.

**showBackground** `Boolean!` *required*

Whether the X has a colored circle behind it.

**completionTags** `[String!]!` *required*

Tags added to each customer who completes the popup, such as a signup. Empty when none.

**countryTargeting** `[PopupCountryTargeting!](/docs/api-reference/v3/reference/marketing/popup-country-targeting)` *required*

Which shopper countries the popup is shown in.

**fields**

**countries** `[\[CountryCode!\]!](/docs/api-reference/v3/reference/common/country-code)` *required*

The countries INCLUDE or EXCLUDE lists. Kept, but unused, when `mode` is ALL.

**mode** `[PopupCountryTargetingMode!](/docs/api-reference/v3/reference/marketing/popup-country-targeting-mode)` *required*

Which countries the popup is shown in.

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

When the popup was created.

**device** `[PopupDevice!](/docs/api-reference/v3/reference/marketing/popup-device)` *required*

Which devices the popup is shown on.

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

The discount offered in the signup flows the popup starts. Null when the popup offers no discount, or its discount was deleted. Reading it needs the `campaigns_read` scope.

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

**fields**

**category** `[DiscountCodeCategory](/docs/api-reference/v3/reference/marketing/discount-code-category)`

What the discount is used for, such as `RECOVER` for the discounts the Recover builder lists. Null when no category is stored.

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

**embedCode** `String`

The HTML snippet the merchant pastes into a page to show the popup inline, such as `<div id="redo-marketing-embedded-form-ab1cd"></div>`. Kept when the popup goes back to TRIGGERED, so a pasted snippet keeps working. Null until the popup is first made INLINE.

**frequencyCapHours** `Int!` *required*

How many hours the storefront waits before showing the popup to the same visitor again, from 1 to 720. 24 when the merchant never set one. Applies only to the TIME\_ON\_PAGE, EXIT\_INTENT and BACK\_IN\_STOCK triggers; the Intent AI triggers and inline popups ignore it.

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

The id of this popup.

**languages** `[String!]!` *required*

The languages the popup offers its copy in, as locale codes such as `fr` or `pt-BR`. The translations themselves are written in the builder. Empty when the popup shows only its authored copy.

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

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

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

The merchant-facing name of the popup. Empty when it has none.

**pageRules** `[\[PopupPageRule!\]!](/docs/api-reference/v3/reference/marketing/popup-page-rule)` *required*

Which storefront pages show the popup. Empty when it shows on every page.

**fields**

**type** `[PopupPageRuleType!](/docs/api-reference/v3/reference/marketing/popup-page-rule-type)` *required*

Whether matching pages show or hide the popup.

**url** `String!` *required*

A full URL (`https://shop.example.com/products/*`) or a path (`/products/*`). It matches the page exactly, or with `*` standing for any text.

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

When the popup was last published. Null while it is unpublished.

**renderMode** `[PopupRenderMode!](/docs/api-reference/v3/reference/marketing/popup-render-mode)` *required*

Whether the popup opens over the page or shows inline in it.

**status** `[PopupStatus!](/docs/api-reference/v3/reference/marketing/popup-status)` *required*

Whether the popup is published.

**target** `[PopupTarget](/docs/api-reference/v3/reference/marketing/popup-target)`

Which visitors the popup is shown to. Null when it has no audience setting.

**testUrl** `String`

Storefront URL that opens this popup for live testing, even while unpublished. Public and unsigned; does not expire. The storefront still enforces device and country targeting, so a mobile-only or geo-targeted popup won't show unless opened from a matching device and country. Null for back-in-stock popups (which require a product page with an out-of-stock variant) or when the store has no storefront domain.

**triggers** `[\[PopupTrigger!\]!](/docs/api-reference/v3/reference/marketing/popup-trigger)` *required*

What shows the popup, in the order the dashboard lists them. Only INLINE when it is embedded. Empty when no trigger is on.

**fields**

**delaySeconds** `Int`

For TIME\_ON\_PAGE, how many seconds the shopper is on the page before the popup shows. Null for other kinds.

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

What shows the popup.

**opensAutomatically** `Boolean`

For BACK\_IN\_STOCK, whether the popup opens by itself when the shopper selects an out-of-stock variant. When false, only an embed launcher opens it. Null for other kinds.

**type** `[PopupType!](/docs/api-reference/v3/reference/marketing/popup-type)` *required*

How the popup is laid out on desktop, from its first step. POPUP when it has no steps.

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

When the popup was last edited.

## Example

```graphql theme={null}
mutation {
  popupUpdate(id: "...", input: { ... }) {
    allowPageInteraction
    completionTags
    createdAt
    device
    embedCode
    frequencyCapHours
    id
    languages
    # ...
  }
}
```


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