provider alerts POST /api/environments/{environment_id}/alerts/simulate/
@utdk/posthog /api/environments/{environment_id}/alerts/simulate/
environments_alerts_simulate_create
Simulate a detector on an insight's historical data. Read-only — no AlertCheck records are created.
environment_id path required
Deprecated. Use /api/projects/{project_id}/ instead.
string

Try it

Authentication
Configure credentials for PostHog API
environmentsAlertsSimulateCreate
POST/api/environments/{environment_id}/alerts/simulate/
Simulate a detector on an insight's historical data. Read-only — no AlertCheck records are created.

Parameters

required

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

Input

required

Insight ID to simulate the detector on.

required

Detector configuration to simulate.

Zero-based index of the series to analyze (trends insights only).

Relative date string for how far back to simulate (e.g. '-24h', '-30d', '-4w'). If not provided, uses the detector's minimum required samples. Trends insights only — a SQL query's own rows are the series.

Per-insight-kind alert config. For SQL insights, selects the evaluated column and read direction (last_row/first_row) so the preview matches the alert; ignored for trends.

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.environmentsAlertsSimulateCreate({
  "series_index": 0
})