Alerts
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
POST | |
GET | |
PATCH | |
DELETE | |
POST | |
POST | |
POST | |
POST |
List all alerts
Also available via the PostHog MCP server:
alerts-list— List alerts
Required API key scopes
alert:readQuery parameters
- created_bystring
- has_detectorboolean
- insight_idinteger
- insight_tagstring
- limitinteger
- offsetinteger
- searchstring
Response
Example request
GET /api /projects /:project_id /alertsExample response
Status 200
RESPONSE
Create alerts
Required API key scopes
alert:writeRequest parameters
- insightinteger
- namestring
- subscribed_usersarray
- threshold
- condition
- enabledboolean
- schedule_start_timestringnull
- config
- detector_config
- calculation_interval
- snoozed_untilstringnull
- skip_weekendbooleannull
- schedule_restriction
- investigation_agent_enabledboolean
- investigation_gates_notificationsboolean
- investigation_inconclusive_action
Response
Example request
POST /api /projects /:project_id /alertsExample response
Status 201
RESPONSE
Retrieve alerts
Required API key scopes
alert:readPath parameters
- idstring
Query parameters
- checks_date_fromstring
- checks_date_tostring
- checks_limitinteger
- checks_offsetinteger
Response
Example request
GET /api /projects /:project_id /alerts /:idExample response
Status 200
RESPONSE
Update alerts
Required API key scopes
alert:writePath parameters
- idstring
Request parameters
- insightinteger
- namestring
- subscribed_usersarray
- threshold
- condition
- enabledboolean
- schedule_start_timestringnull
- config
- detector_config
- calculation_interval
- snoozed_untilstringnull
- skip_weekendbooleannull
- schedule_restriction
- investigation_agent_enabledboolean
- investigation_gates_notificationsboolean
- investigation_inconclusive_action
Response
Example request
PATCH /api /projects /:project_id /alerts /:idExample response
Status 200
RESPONSE
Delete alerts
Required API key scopes
alert:writePath parameters
- idstring
Example request
DELETE /api /projects /:project_id /alerts /:idExample response
Status 204 No response body
Create alerts destinations
Send this alert to a Slack channel as well as by email. The workspace must already be connected to the project. The returned IDs identify the destination.
Required API key scopes
alert:writePath parameters
- idstring
Request parameters
- typeDefault:
slack - slack_workspace_idinteger
- slack_channel_idstring
- slack_channel_namestring
Response
Example request
POST /api /projects /:project_id /alerts /:id /destinationsExample response
Status 201
RESPONSE
Create alerts destinations delete
Stop sending this alert to a destination. The alert keeps its email recipients.
Required API key scopes
alert:writePath parameters
- idstring
Request parameters
- hog_function_idsarray
Example request
POST /api /projects /:project_id /alerts /:id /destinations /deleteExample response
Status 204 No response body
Create alerts test delivery
Send a synthetic test notification to subscribed users and every active destination on this alert.
Required API key scopes
alert:writePath parameters
- idstring
Response
Example request
POST /api /projects /:project_id /alerts /:id /test-deliveryExample response
Status 202
RESPONSE
Create alerts simulate
Simulate a detector on an insight's historical data. Read-only — no AlertCheck records are created.
Required API key scopes
alert:readinsight:readRequest parameters
- insight
- detector_config
- series_indexintegerDefault:
0 - date_fromstringnull
- config
Response
Example request
POST /api /projects /:project_id /alerts /simulateExample response
Status 200
RESPONSE