> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sequenzy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Popup

> Update, publish, or unpublish a saved popup

Update a saved popup. Only the fields you send change.

Set `status` to `published` to make the popup live, or `draft` to stop it
showing while keeping the popup, its stats, and its embed script. The
`trigger`, `targeting`, `schedule`, `frequency`, and `visual` objects are merged
key by key, so patching one key keeps the rest.

## Request

<ParamField body="name" type="string">
  Internal popup name.
</ParamField>

<ParamField body="status" type="string">
  `draft` or `published`.
</ParamField>

<ParamField body="listIds" type="string[]">
  Replacement list targeting. Pass an empty array to capture into every list.
</ParamField>

<ParamField body="tagIds" type="string[]">
  Replacement tag IDs. Pass an empty array to clear tags.
</ParamField>

<ParamField body="duplicateStrategy" type="string">
  `skip`, `merge`, or `overwrite`.
</ParamField>

<ParamField body="headline" type="string">
  New text for the popup's first heading block. Fails when the popup has no
  heading block; edit `blocks` instead.
</ParamField>

<ParamField body="description" type="string">
  New text for the popup's first paragraph block. Fails when the popup has no
  paragraph block; edit `blocks` instead.
</ParamField>

<ParamField body="buttonText" type="string">
  Submit button label.
</ParamField>

<ParamField body="successMessage" type="string">
  Success screen message.
</ParamField>

<ParamField body="redirectUrl" type="string">
  HTTP or HTTPS success redirect. Pass an empty string to switch back to the
  confirmation message.
</ParamField>

<ParamField body="presentation" type="string">
  `modal`, `slide-in`, `floating-bar`, or `fullscreen`.
</ParamField>

<ParamField body="placement" type="string">
  `center`, `left`, `right`, `top`, or `bottom`.
</ParamField>

<ParamField body="trigger" type="object">
  Partial trigger patch, merged into the current trigger.
</ParamField>

<ParamField body="targeting" type="object">
  Partial targeting patch, merged into the current targeting.
</ParamField>

<ParamField body="schedule" type="object">
  Partial schedule patch, merged into the current schedule.
</ParamField>

<ParamField body="frequency" type="object">
  Partial frequency patch, merged into the current frequency.
</ParamField>

<ParamField body="visual" type="object">
  Partial visual patch, merged into the current visual.
</ParamField>

<ParamField body="theme" type="object">
  Theme overrides merged into the current theme.
</ParamField>

<ParamField body="blocks" type="object[]">
  Complete replacement for the popup's content blocks. Read the current blocks
  with [Get Popup](/api-reference/widgets/get-popup) first. The popup must keep
  exactly one required email field and one submit button.
</ParamField>

```bash theme={null}
curl -X PATCH "https://api.sequenzy.com/api/v1/popups/pop_123" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "headline": "Take 15% off your first order",
    "targeting": { "paths": ["/pricing"], "device": "desktop" }
  }'
```

Unpublish a popup without deleting it:

```bash theme={null}
curl -X PATCH "https://api.sequenzy.com/api/v1/popups/pop_123" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "status": "draft" }'
```

## Responses

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "popup": {
      "id": "pop_123",
      "name": "Welcome offer",
      "status": "published",
      "viewCount": 1840,
      "conversionCount": 96
    },
    "embed": {
      "scriptUrl": "https://sequenzy.com/embed/popups/pop_123?v=capture-runtime-20260716-14"
    },
    "message": "Popup updated."
  }
  ```

  ```json 400 theme={null}
  { "error": "Click-triggered popups require a click selector." }
  ```

  ```json 401 theme={null}
  {
    "error": "Missing API key. Provide via x-api-key header or Authorization: Bearer <key>"
  }
  ```

  ```json 403 theme={null}
  { "error": "API key is missing required scope: widgets:write" }
  ```

  ```json 404 theme={null}
  { "error": "Popup not found" }
  ```

  ```json 500 theme={null}
  { "error": "Failed to update popup." }
  ```
</ResponseExample>
