provider logs POST /api/projects/{project_id}/logs/alerts/simulate/
@utdk/posthog /api/projects/{project_id}/logs/alerts/simulate/
logs_alerts_simulate_create
Simulate a logs alert on historical data using the full state machine. Read-only — no alert check records are created.
project_id path required
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
string

Try it

Authentication
Configure credentials for PostHog API
logsAlertsSimulateCreate
POST/api/projects/{project_id}/logs/alerts/simulate/
Simulate a logs alert on historical data using the full state machine. Read-only — no alert check records are created.

Parameters

required

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

Input

required

Filter criteria — same format as LogsAlertConfiguration.filters.

required

Threshold count to evaluate against.

required

Whether the alert fires when the count is above or below the threshold. * `above` - Above * `below` - Below

required

Window size in minutes — determines bucket interval.

How often the alert is evaluated, in minutes.

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

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

Minutes to wait after firing before sending another notification.

required

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

Configure credentials above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import posthog from '@utdk/posthog';

await posthog.logsAlertsSimulateCreate({
  "check_interval_minutes": 5,
  "evaluation_periods": 1,
  "datapoints_to_alarm": 1,
  "cooldown_minutes": 0
})