vision

patch/api/projects/{project_id}/vision/alerts/{id}/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/vision/alerts/{id}/
  • Auth: HTTP bearer

Path parameters

idstring uuid required

A UUID string identifying this vision alert configuration.

project_idstring required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Request body

idstring uuid

Unique identifier for this alert.

scanner_idstring uuid

Scanner whose observations this alert watches. Immutable after creation.

namestring

Human-readable name for this alert. Defaults to 'Untitled alert' on create when omitted.

enabledboolean

Whether the alert is active. Disabling a metric alert resets its state to not_firing.

kind'metric' | 'match'
  • metric - Metric
  • match - Match
metric'count' | 'avg_score'
  • count - Count matching observations
  • avg_score - Average score
direction'above' | 'below'
  • above - At or above
  • below - At or below
thresholdnumber double nullable

Metric alerts only: the threshold value. Required for metric alerts, must be omitted for match alerts.

window_daysinteger

Metric alerts only: rolling window in days. Allowed values: [1, 3, 7, 14, 30].

check_interval_minutesinteger

Metric alerts only: evaluation cadence in minutes, at least 15.

state'not_firing' | 'firing' | 'pending_resolve' | 'errored' | 'snoozed' | 'broken'
  • not_firing - Not firing
  • firing - Firing
  • pending_resolve - Pending resolve
  • errored - Errored
  • snoozed - Snoozed
  • broken - Broken
evaluation_periodsinteger

Metric alerts only: total check periods in the sliding evaluation window (M in N-of-M).

datapoints_to_alarminteger

Metric alerts only: how many periods must breach to fire (N in N-of-M).

cooldown_minutesinteger

Metric alerts only: minimum minutes between repeated notifications. 0 means no cooldown.

snooze_untilstring date-time nullable

ISO 8601 timestamp until which the alert is snoozed. Set to null to unsnooze.

next_check_atstring date-time nullable

When the next evaluation is scheduled. Server-managed.

last_notified_atstring date-time nullable

When the last notification was sent. Server-managed.

last_checked_atstring date-time nullable

When the alert was last evaluated. Server-managed.

consecutive_failuresinteger

Consecutive evaluation failures. Resets on success. Server-managed.

first_enabled_atstring date-time nullable

When the alert was first enabled. Null means still a draft.

created_atstring date-time

When the alert was created.

updated_atstring date-time nullable

When the alert was last modified.

Response

idstring uuid required

Unique identifier for this alert.

scanner_idstring uuid required

Scanner whose observations this alert watches. Immutable after creation.

namestring

Human-readable name for this alert. Defaults to 'Untitled alert' on create when omitted.

enabledboolean

Whether the alert is active. Disabling a metric alert resets its state to not_firing.

kind'metric' | 'match' required
  • metric - Metric
  • match - Match
metric'count' | 'avg_score'
  • count - Count matching observations
  • avg_score - Average score
direction'above' | 'below'
  • above - At or above
  • below - At or below
thresholdnumber double nullable

Metric alerts only: the threshold value. Required for metric alerts, must be omitted for match alerts.

window_daysinteger

Metric alerts only: rolling window in days. Allowed values: [1, 3, 7, 14, 30].

check_interval_minutesinteger

Metric alerts only: evaluation cadence in minutes, at least 15.

state'not_firing' | 'firing' | 'pending_resolve' | 'errored' | 'snoozed' | 'broken' required
  • not_firing - Not firing
  • firing - Firing
  • pending_resolve - Pending resolve
  • errored - Errored
  • snoozed - Snoozed
  • broken - Broken
evaluation_periodsinteger

Metric alerts only: total check periods in the sliding evaluation window (M in N-of-M).

datapoints_to_alarminteger

Metric alerts only: how many periods must breach to fire (N in N-of-M).

cooldown_minutesinteger

Metric alerts only: minimum minutes between repeated notifications. 0 means no cooldown.

snooze_untilstring date-time nullable

ISO 8601 timestamp until which the alert is snoozed. Set to null to unsnooze.

next_check_atstring date-time nullable required

When the next evaluation is scheduled. Server-managed.

last_notified_atstring date-time nullable required

When the last notification was sent. Server-managed.

last_checked_atstring date-time nullable required

When the alert was last evaluated. Server-managed.

consecutive_failuresinteger required

Consecutive evaluation failures. Resets on success. Server-managed.

first_enabled_atstring date-time nullable required

When the alert was first enabled. Null means still a draft.

created_atstring date-time required

When the alert was created.

updated_atstring date-time nullable required

When the alert was last modified.

Changes

No recorded changes to this operation across all 1 revision of this API.