---
title: "Update a feedback widget"
method: PATCH
path: "/feedback-widgets/{widgetId}"
tags: ["Feedback Widgets"]
---

# Update a feedback widget

`PATCH /feedback-widgets/{widgetId}`

## Request

- Base URL: `https://api.produktly.com/api/v1`
- URL: `https://api.produktly.com/api/v1/feedback-widgets/{widgetId}`
- Auth: HTTP bearer

Only the fields you send are changed. settings are merged over stored settings; targeting and options (whether passed directly or via optionsPreset) replace wholesale. Live widgets can be edited, but an update that would leave one unpublishable (no options or no targeting) returns 400; set active: false first to take it down.

## Path parameters

- `widgetId` integer, required

## Request body

- object
  - `name` string
  - `options` object[]: Replaces all options
    - `name` string, required: Shown under the emoji and submitted as optionName
    - `emoji` string
    - `type` string: Submitted as the response type. Defaults to a slug of name
  - `optionsPreset` integer
  - `settings` object: Merged over existing settings
    - `question` string: Default "We would love to hear your feedback"
    - `showBeacon` boolean: Default true. When false, open with Produktly.openFeedback()
    - `collapsedText` string: Beacon label. Default "Feedback"
    - `beaconLocation` 'mid-right' | 'mid-left' | 'bottom-right' | 'bottom-left' | 'right-bottom' | 'left-bottom' | 'top-right' | 'top-left' | 'right-top' | 'left-top': Default "mid-right"
    - `collectEmail` boolean: Default false
    - `emailOptional` boolean
    - `shouldValidateEmail` boolean: Default true
    - `allowScreenshots` boolean
    - `autoCaptureScreenshot` boolean
    - `requireScreenshot` boolean: Only enforced when allowScreenshots is on and autoCaptureScreenshot is off
    - `themeColor` string
    - `textColor` string
    - `emailLabelText` string
    - `emailOptionalLabelText` string
    - `messageLabelText` string
    - `submitBtnText` string
    - `submitAnotherBtnText` string
    - `feedbackSuccessText` string
    - `feedbackErrorText` string
    - `emailMissingErrorText` string
    - `emailInvalidErrorText` string
    - `messageMissingErrorText` string
    - `screenshotLabelText` string
    - `screenshotMissingErrorText` string
    - `slackWebhookUrl` string: Write-only. Never returned by read endpoints
    - `discordWebhookUrl` string: Write-only
    - `zapierWebhookUrl` string: Write-only
    - `customWebhookUrl` string: Write-only
    - `notificationEmails` string: Comma-separated. Write-only
  - `targeting` union
    - object
      - `showOnAllPages` true, required
    - object
      - `rules` object[], required
        - `type` union, required
          - 'url' | 'current_time' | 'time_of_day' | 'day_of_week' | 'location' | 'language' | 'produktly_user_created_at' | 'device_type' | 'screen_width' | 'screen_height' | 'produktly_user_visit_count' | 'produktly_user_days_active'
          - string
          - string
        - `comparisonOperator` 'equals' | 'not_equal' | 'contains' | 'no_contains' | 'starts_with' | 'ends_with' | 'one_of' | 'not_one_of' | 'greater' | 'greater_eq' | 'less' | 'less_eq' | 'exists' | 'not_exists' | 'time_ago' | 'within_last' | 'between', required
        - `value` union
          - string
          - number
          - union[]
            - union
              - …
          - object
            - `value` integer, required
            - `unit` 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'years', required
      - `logicalOperator` 'AND' | 'OR' | 'and' | 'or': How multiple rules combine. Default "AND".
    - object
      - `userSegmentIds` integer[], required
  - `themeId` integer, nullable
  - `folderId` integer, nullable
  - `active` boolean

## Response `200`

Updated

- FeedbackWidgetDetail
  - `id` integer, required
  - `name` string, required
  - `active` boolean, required
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required
  - `folderId` integer, nullable, required
  - `themeId` integer, nullable, required
  - `settings` object, required
  - `rules` object[], required
  - `ruleLogicalOperator` string, nullable, required
  - `options` object[], required
  - `dashboardUrl` string, required
  - `note` string

## Other responses

- `400`: Validation error
- `401`: Unauthorized
- `404`: Not found
- `409`: widget_is_live — this API key cannot edit a published feedback widget
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/produktly/apis/produktly-api.md) · [All operations](https://skmtc.dev/produktly/apis/produktly-api/llms.txt) · [OpenAPI document](https://skmtc.dev/produktly/apis/produktly-api/revisions/fd942a97a7d1?raw)
