logs

Simulate a logs alert on historical data using the full state machine. Read-only — no alert check records are created.

post/api/projects/{project_id}/logs/alerts/simulate/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/logs/alerts/simulate/
  • 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

threshold_countinteger required

Threshold count to evaluate against.

threshold_operator'above' | 'below' required
  • above - Above
  • below - Below
window_minutesinteger required

Window size in minutes — determines bucket interval.

check_interval_minutesinteger

How often the alert is evaluated, in minutes.

evaluation_periodsinteger

Total check periods in the N-of-M evaluation window (M).

datapoints_to_alarminteger

How many periods must breach to fire (N in N-of-M).

cooldown_minutesinteger

Minutes to wait after firing before sending another notification.

date_fromstring required

Relative date string for how far back to simulate (e.g. '-24h', '-7d', '-30d').

Response

fire_countinteger required

Number of times the alert would have sent a fire notification.

resolve_countinteger required

Number of times the alert would have sent a resolve notification.

total_bucketsinteger required

Total number of buckets in the simulation window.

threshold_countinteger required

Threshold count used for evaluation.

threshold_operatorstring required

Threshold operator used for evaluation.

Changes

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