---
title: "Update an announcement"
method: PATCH
path: "/announcements/{id}"
tags: ["Announcements"]
---

# Update an announcement

`PATCH /announcements/{id}`

## Request

- Base URL: `https://api.produktly.com/api/v1`
- URL: `https://api.produktly.com/api/v1/announcements/{id}`
- Auth: HTTP bearer

Only the fields you send are changed. settings are merged over stored settings; targeting replaces wholesale. Live announcements can be edited, but an update that would leave one unpublishable (no title, no targeting, or missing content for popup/toast) returns 400; set active: false first to take it down.

## Path parameters

- `id` integer, required

## Request body

- object
  - `name` string
  - `title` string
  - `content` string
  - `settings` object: Merged over existing settings
    - `type` 'topbar' | 'topbar-hovering' | 'popup' | 'toast': Display style. Default "topbar". content is only rendered for popup and toast
    - `isSticky` boolean: Topbar only. Default true
    - `pushContentDown` boolean: Topbar only. Sticky placement needs isSticky and this
    - `toastLocation` 'bottomleft' | 'bottomright' | 'topleft' | 'topright': Toast only. Default "bottomleft"
    - `width` integer: Popup/toast only. Defaults 500 / 320
    - `height` integer: Popup/toast only
    - `showCloseButton` boolean: Default true
    - `showActionButton` boolean: Default true
    - `actionText` string: Default "Learn more"
    - `actionType` 'url' | 'tour': Default "url"
    - `actionLink` string
    - `actionTourId` integer
    - `actionOpenInNewTab` boolean: Default true
    - `showSecondaryActionButton` boolean: Default false
    - `secondaryActionText` string
    - `secondaryActionType` 'url' | 'tour': Default "url"
    - `secondaryActionLink` string
    - `secondaryActionTourId` integer: Required when secondaryActionType is tour
    - `secondaryActionOpenInNewTab` boolean: Default true
    - `themeColor` string
    - `textColor` string
    - `display` 'once' | 'always' | 'custom': Default "once"
    - `displayTimes` integer: Required when display="custom"
  - `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

- Announcement
  - `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
  - `title` string, nullable, required
  - `content` string, nullable, required
  - `settings` object, required
  - `rules` object[], required
  - `ruleLogicalOperator` string, nullable, 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 announcement
- `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)
