---
title: "Update existing alert with input information. If not specified in the input, the existing value will be kept intact"
method: PUT
path: "/api/2.0/alerts/{objectId}"
---

# Update existing alert with input information. If not specified in the input, the existing value will be kept intact

`PUT /api/2.0/alerts/{objectId}`

## Path parameters

- `objectId` integer, required

## Request body

- DatasetAlert — Alert information
  - `createdDate` integer — Created date in milliseconds
  - `lastModDate` integer — Last modified date
  - `id` integer — Alert ID
  - `datasetId` integer — Dataset ID
  - `lastAlert` string, date-time — Last alert date
  - `userId` integer — Alert owner's user ID
  - `status` integer — Alert status
  - `alertCondition` string — Alert condition for conditional alert type
  - `alertName` string — Alert name
  - `alertType` integer — Alert type
  - `accessLevel` integer — Access level of the alert for current user
  - `autoShared` boolean — Is alert auto-shared on
  - `schedule` Schedule — Schedule information
    - `frequencyType` string, required — Frequency type
    - `frequency` integer, required — Frequency count
    - `startTime` string — Start time. This can either be time HH:mm or date time MM/dd/yyyy HH:mm
    - `nextExecutionTime` integer — Next execution time in milliseconds
  - `realtime` boolean — Whether or not this alert is real-time alert
  - `executionReport` ExecutionReport[]
    - `executionDate` integer — Date in milliseconds
    - `executionStatus` 'UNKNOWN' | 'RUNNING' | 'SUCCESS' | 'FAILURE' | 'ALERT' | 'TIMEOUT' — Status
    - `duration` integer — Duration
    - `details` ActionApiResponse[] — Details
      - `ok` boolean — Whether or not the response is a success
      - `channel` 'EMAIL' | 'WEBHOOK' | 'SLACK' | 'TEAMS' — Channel
      - `message` string — Action result details message
  - `firedCount` integer — Number of times this alert has been triggered
  - `createdBy` string — Alert owner's username
  - `deletable` boolean — Whether or not the current user has deletion right to the alert
  - `chartId` integer — Widget ID
  - `properties` DatasetAlertProperties, required — Alert properties
    - `emailOutput` EmailOutput — Email output properties
      - `from` string — Email from
      - `replyTo` string — Email reply to
      - `sendTo` string — Email send to
      - `cc` string — Email cc
      - `bcc` string — Email bcc
      - `emailSubject` string — Email subject
      - `emailBody` string — Email body
    - `webhookOutput` WebhookOutput — Webhook output properties
      - `selectedWebhooks` integer[] — Webhook IDs
    - `slackOutput` SlackOutput — Slack output properties
      - `selectedSlacks` integer[] — Slack IDs
    - `teamsOutput` TeamsOutput — Teams output properties
      - `selectedTeams` integer[] — Teams IDs
    - `dashboardPdfInfo` DashboardPdfInfo — Dashboard PDF information
      - `dashboardPdfId` integer — Additional C9QL to be applied prior to attachment
    - `alertIfNoData` boolean — Whether or not to send alert of there is no data returned
    - `skipSameAlert` boolean — Whether or not to send alert if data is the same as previous alert
    - `attachDataset` boolean — Whether or not to attach raw dataset data
    - `attachAlertData` boolean — Whether or not to attach raw dataset data
    - `attachmentConfig` AttachmentConfig — Attachment config
      - `datasetId` integer — Dataset ID to replace the alert's dataset ID for attachment
      - `query` string — Additional C9QL to be applied prior to attachment
    - `anomalyId` integer — Anomaly definition ID
    - `anomalyLookBack` string — Anomaly lookback period
    - `frequencyMarker` string — Alert frequency in minutes or "custom"
    - `operator` string — Alert/anomaly condition operator
    - `metric` string — Alert/anomaly metric field
    - `dimension` string — Anomaly dimension field
    - `threshold` string — Alert/anomaly threshold value
    - `dateTime` string — Anomaly date/time field
    - `alertContentFilters` Filter[] — Alert content filters
      - `fieldName` string, required — Filter field name. Either fieldName or fieldNames has to be not empty
      - `fieldNames` string[], required — Filter field names in case of tree filter. Either fieldName or fieldNames has to be not empty
      - `values` object[] — Filter values
      - `operator` string — Filter operator
      - `locked` boolean — Whether or not filter is locked (ie: not modifiable)
      - `requireValue` boolean — Whether or not filter requires value to be set
      - `enabled` boolean — Whether or not filter is enabled (default is true)
      - `controlType` string — Filter control type
      - `visible` boolean — Whether or not filter is visible (default is true)
      - `hitList` integer — Suggestion values dataset ID
      - `hitListLabel` string — Suggestion label field name of the hit list dataset
      - `hitListValue` string — Suggestion value field name of the hit list dataset
      - `filteringResult` boolean — Whether the filter should be applied before (false) or after (true) the widget data has been processed
      - `label` string — Display label for the filter
      - `or` boolean — Whether this filter is OR'd with the previous filter (for SQL parsing)
      - `description` string — Filter description
      - `dateLimit` string — Filter date limit
      - `dateLimitOptions` string — Filter date limit options (restriction and from token)
      - `displayValues` object[] — Custom display values
      - `plainControlType` string — Control type for plain text field type
      - `dynamic` boolean — Whether or not filter's value is automatically selected
      - `inclusiveTime` boolean — Whether time range filter is inclusive (includes exact start/end times, where start time is for Start Date and end time for End Date. UI tooltip: When checked, creates a single continuous time period from Start Date/Time to End Date/Time. When unchecked, applies the time range to each day separately (e.g., 9:00-17:00 every day within the date range).)

## Response `200`

Success

- DatasetAlert — Alert information
  - `createdDate` integer — Created date in milliseconds
  - `lastModDate` integer — Last modified date
  - `id` integer — Alert ID
  - `datasetId` integer — Dataset ID
  - `lastAlert` string, date-time — Last alert date
  - `userId` integer — Alert owner's user ID
  - `status` integer — Alert status
  - `alertCondition` string — Alert condition for conditional alert type
  - `alertName` string — Alert name
  - `alertType` integer — Alert type
  - `accessLevel` integer — Access level of the alert for current user
  - `autoShared` boolean — Is alert auto-shared on
  - `schedule` Schedule — Schedule information
    - `frequencyType` string, required — Frequency type
    - `frequency` integer, required — Frequency count
    - `startTime` string — Start time. This can either be time HH:mm or date time MM/dd/yyyy HH:mm
    - `nextExecutionTime` integer — Next execution time in milliseconds
  - `realtime` boolean — Whether or not this alert is real-time alert
  - `executionReport` ExecutionReport[]
    - `executionDate` integer — Date in milliseconds
    - `executionStatus` 'UNKNOWN' | 'RUNNING' | 'SUCCESS' | 'FAILURE' | 'ALERT' | 'TIMEOUT' — Status
    - `duration` integer — Duration
    - `details` ActionApiResponse[] — Details
      - `ok` boolean — Whether or not the response is a success
      - `channel` 'EMAIL' | 'WEBHOOK' | 'SLACK' | 'TEAMS' — Channel
      - `message` string — Action result details message
  - `firedCount` integer — Number of times this alert has been triggered
  - `createdBy` string — Alert owner's username
  - `deletable` boolean — Whether or not the current user has deletion right to the alert
  - `chartId` integer — Widget ID
  - `properties` DatasetAlertProperties, required — Alert properties
    - `emailOutput` EmailOutput — Email output properties
      - `from` string — Email from
      - `replyTo` string — Email reply to
      - `sendTo` string — Email send to
      - `cc` string — Email cc
      - `bcc` string — Email bcc
      - `emailSubject` string — Email subject
      - `emailBody` string — Email body
    - `webhookOutput` WebhookOutput — Webhook output properties
      - `selectedWebhooks` integer[] — Webhook IDs
    - `slackOutput` SlackOutput — Slack output properties
      - `selectedSlacks` integer[] — Slack IDs
    - `teamsOutput` TeamsOutput — Teams output properties
      - `selectedTeams` integer[] — Teams IDs
    - `dashboardPdfInfo` DashboardPdfInfo — Dashboard PDF information
      - `dashboardPdfId` integer — Additional C9QL to be applied prior to attachment
    - `alertIfNoData` boolean — Whether or not to send alert of there is no data returned
    - `skipSameAlert` boolean — Whether or not to send alert if data is the same as previous alert
    - `attachDataset` boolean — Whether or not to attach raw dataset data
    - `attachAlertData` boolean — Whether or not to attach raw dataset data
    - `attachmentConfig` AttachmentConfig — Attachment config
      - `datasetId` integer — Dataset ID to replace the alert's dataset ID for attachment
      - `query` string — Additional C9QL to be applied prior to attachment
    - `anomalyId` integer — Anomaly definition ID
    - `anomalyLookBack` string — Anomaly lookback period
    - `frequencyMarker` string — Alert frequency in minutes or "custom"
    - `operator` string — Alert/anomaly condition operator
    - `metric` string — Alert/anomaly metric field
    - `dimension` string — Anomaly dimension field
    - `threshold` string — Alert/anomaly threshold value
    - `dateTime` string — Anomaly date/time field
    - `alertContentFilters` Filter[] — Alert content filters
      - `fieldName` string, required — Filter field name. Either fieldName or fieldNames has to be not empty
      - `fieldNames` string[], required — Filter field names in case of tree filter. Either fieldName or fieldNames has to be not empty
      - `values` object[] — Filter values
      - `operator` string — Filter operator
      - `locked` boolean — Whether or not filter is locked (ie: not modifiable)
      - `requireValue` boolean — Whether or not filter requires value to be set
      - `enabled` boolean — Whether or not filter is enabled (default is true)
      - `controlType` string — Filter control type
      - `visible` boolean — Whether or not filter is visible (default is true)
      - `hitList` integer — Suggestion values dataset ID
      - `hitListLabel` string — Suggestion label field name of the hit list dataset
      - `hitListValue` string — Suggestion value field name of the hit list dataset
      - `filteringResult` boolean — Whether the filter should be applied before (false) or after (true) the widget data has been processed
      - `label` string — Display label for the filter
      - `or` boolean — Whether this filter is OR'd with the previous filter (for SQL parsing)
      - `description` string — Filter description
      - `dateLimit` string — Filter date limit
      - `dateLimitOptions` string — Filter date limit options (restriction and from token)
      - `displayValues` object[] — Custom display values
      - `plainControlType` string — Control type for plain text field type
      - `dynamic` boolean — Whether or not filter's value is automatically selected
      - `inclusiveTime` boolean — Whether time range filter is inclusive (includes exact start/end times, where start time is for Start Date and end time for End Date. UI tooltip: When checked, creates a single continuous time period from Start Date/Time to End Date/Time. When unchecked, applies the time range to each day separately (e.g., 9:00-17:00 every day within the date range).)

## Other responses

- `400` — Bad request
- `401` — User is not authenticated
- `403` — User is not allowed to access this resource
- `500` — Error during processing

---

[API](https://skmtc.net/knowi/apis/user-management-api.md) · [All operations](https://skmtc.net/knowi/apis/user-management-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/knowi/user-management-api/revisions/6e6982573ba6/schema)
