provider logs POST /api/environments/{environment_id}/logs/alerts/simulate/
@utdk/posthog /api/environments/{environment_id}/logs/alerts/simulate/
environments_logs_alerts_simulate_create
Simulate a logs alert on historical data using the full state machine. Read-only — no alert check records are created.
environment_id path required
Deprecated. Use /api/projects/{project_id}/ instead.
string

Try it

Authentication
Configure credentials for PostHog API
environmentsLogsAlertsSimulateCreate
POST/api/environments/{environment_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

Deprecated. Use /api/projects/{project_id}/ instead.

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.environmentsLogsAlertsSimulateCreate({
  "check_interval_minutes": 5,
  "evaluation_periods": 1,
  "datapoints_to_alarm": 1,
  "cooldown_minutes": 0
})