platform_alerts
post/api/projects/{project_id}/platform_alerts/

Request

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

Path parameters

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

source_kindstring required

Product whose data the alert evaluates. It cannot change after the create.

namestring

Human-readable name of the alert. Defaults to 'Untitled alert'.

enabledboolean

Whether the alert is evaluated on schedule. Defaults to true.

evaluation_periodsinteger

Number of recent checks considered when deciding to fire. Defaults to 1.

datapoints_to_alarminteger

Number of breaching checks within evaluation_periods required to fire. Cannot exceed evaluation_periods. Defaults to 1.

cooldown_minutesinteger

Minimum minutes between notifications for the same alert. Defaults to 0.

Response

idstring uuid required

Unique identifier of the alert configuration.

namestring required

Human-readable name of the alert.

enabledboolean required

Whether the alert is evaluated on schedule.

source_kind'logs' | 'insight' required
  • logs - Logs
  • insight - Insight
source_configobject required

Source-specific settings. The shape depends on source_kind. The bound the alert is evaluated against is under the condition key.

check_interval_minutesinteger required

Minutes between scheduled checks. Applies when recurrence_unit is null.

anchor_timestring nullable required

Local time (HH:MM in the project timezone) a calendar recurrence lands on. Null means the default anchor for the unit.

evaluation_periodsinteger required

Number of recent checks considered when deciding to fire.

datapoints_to_alarminteger required

Number of breaching checks within evaluation_periods required to fire.

cooldown_minutesinteger required

Minimum minutes between notifications for the same alert.

next_check_atstring date-time nullable required

When the next check is due. Null when no check is scheduled.

consecutive_failuresinteger required

Number of checks in a row that failed to evaluate.

legacy_configuration_idstring uuid nullable required

ID of the legacy source configuration this row was backfilled from. Null for alerts created on the platform.

snooze_untilstring date-time nullable required

Time until which every instance's notifications are muted. Null when not muted. An instance's own snooze_until mutes one group, and the later of the two holds.

check_status'ok' | 'errored' | 'broken' required
  • ok - OK
  • errored - Errored
  • broken - Broken
overflowed_groupsinteger required

New groups the last successful check could not track because the alert already held grouping.max_instances instances. 0 when every group fit.

overflow_is_lower_boundboolean required

Whether the last successful check cut its results before counting overflowed_groups. When true, more groups than overflowed_groups may be untracked.

owner'source' | 'platform' required
  • source - Source
  • platform - Platform
created_atstring date-time required

When the configuration was created.

updated_atstring date-time required

When the configuration was last changed.

Changes