Logs
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
POST | |
GET | |
PATCH | |
DELETE | |
POST | |
POST | |
GET | |
POST |
List all environments logs alerts
Also available via the PostHog MCP server:
logs-alerts-list— List log alerts
Required API key scopes
logs:readQuery parameters
- limitinteger
- offsetinteger
Response
Example request
GET /api /environments /:environment_id /logs /alertsExample response
Status 200
List all environments logs alerts
Also available via the PostHog MCP server:
logs-alerts-list— List log alerts
Required API key scopes
logs:readQuery parameters
- limitinteger
- offsetinteger
Response
Example request
GET /api /environments /:environment_id /logs /alertsExample response
Status 200
Create environments logs alerts
Also available via the PostHog MCP server:
logs-alerts-create— Create log alert
Required API key scopes
logs:writeRequest parameters
- namestring
- enabledbooleanDefault:
true - filters
- threshold_countintegerDefault:
100 - threshold_operatorDefault:
above - window_minutesintegerDefault:
5 - evaluation_periodsintegerDefault:
1 - datapoints_to_alarmintegerDefault:
1 - cooldown_minutesintegerDefault:
0 - snooze_untilstringnull
Response
Example request
POST /api /environments /:environment_id /logs /alertsExample response
Status 201
Create environments logs alerts
Also available via the PostHog MCP server:
logs-alerts-create— Create log alert
Required API key scopes
logs:writeRequest parameters
- namestring
- enabledbooleanDefault:
true - filters
- threshold_countintegerDefault:
100 - threshold_operatorDefault:
above - window_minutesintegerDefault:
5 - evaluation_periodsintegerDefault:
1 - datapoints_to_alarmintegerDefault:
1 - cooldown_minutesintegerDefault:
0 - snooze_untilstringnull
Response
Example request
POST /api /environments /:environment_id /logs /alertsExample response
Status 201
Retrieve environments logs alerts
Also available via the PostHog MCP server:
logs-alerts-retrieve— Get log alert
Required API key scopes
logs:readPath parameters
- idstring
Response
Example request
GET /api /environments /:environment_id /logs /alerts /:idExample response
Status 200
Retrieve environments logs alerts
Also available via the PostHog MCP server:
logs-alerts-retrieve— Get log alert
Required API key scopes
logs:readPath parameters
- idstring
Response
Example request
GET /api /environments /:environment_id /logs /alerts /:idExample response
Status 200
Update environments logs alerts
Also available via the PostHog MCP server:
logs-alerts-partial-update— Update log alert
Required API key scopes
logs:writePath parameters
- idstring
Request parameters
- namestring
- enabledbooleanDefault:
true - filters
- threshold_countintegerDefault:
100 - threshold_operatorDefault:
above - window_minutesintegerDefault:
5 - evaluation_periodsintegerDefault:
1 - datapoints_to_alarmintegerDefault:
1 - cooldown_minutesintegerDefault:
0 - snooze_untilstringnull
Response
Example request
PATCH /api /environments /:environment_id /logs /alerts /:idExample response
Status 200
Update environments logs alerts
Also available via the PostHog MCP server:
logs-alerts-partial-update— Update log alert
Required API key scopes
logs:writePath parameters
- idstring
Request parameters
- namestring
- enabledbooleanDefault:
true - filters
- threshold_countintegerDefault:
100 - threshold_operatorDefault:
above - window_minutesintegerDefault:
5 - evaluation_periodsintegerDefault:
1 - datapoints_to_alarmintegerDefault:
1 - cooldown_minutesintegerDefault:
0 - snooze_untilstringnull
Response
Example request
PATCH /api /environments /:environment_id /logs /alerts /:idExample response
Status 200
Delete environments logs alerts
Also available via the PostHog MCP server:
logs-alerts-destroy— Delete log alert
Required API key scopes
logs:writePath parameters
- idstring
Example request
DELETE /api /environments /:environment_id /logs /alerts /:idExample response
Status 204 No response body
Delete environments logs alerts
Also available via the PostHog MCP server:
logs-alerts-destroy— Delete log alert
Required API key scopes
logs:writePath parameters
- idstring
Example request
DELETE /api /environments /:environment_id /logs /alerts /:idExample response
Status 204 No response body
Create environments logs alerts destinations
Also available via the PostHog MCP server:
logs-alerts-destinations-create— Attach alert destination
Create a notification destination for this alert. One HogFunction is created per alert event kind (firing, resolved, ...) atomically.
Path parameters
- idstring
Request parameters
- type
- slack_workspace_idinteger
- slack_channel_idstring
- slack_channel_namestring
- webhook_urlstring
Response
Example request
POST /api /environments /:environment_id /logs /alerts /:id /destinationsExample response
Status 201
Create environments logs alerts destinations
Also available via the PostHog MCP server:
logs-alerts-destinations-create— Attach alert destination
Create a notification destination for this alert. One HogFunction is created per alert event kind (firing, resolved, ...) atomically.
Path parameters
- idstring
Request parameters
- type
- slack_workspace_idinteger
- slack_channel_idstring
- slack_channel_namestring
- webhook_urlstring
Response
Example request
POST /api /environments /:environment_id /logs /alerts /:id /destinationsExample response
Status 201
Create environments logs alerts destinations delete
Also available via the PostHog MCP server:
logs-alerts-destinations-delete-create— Detach alert destination
Delete a notification destination by deleting its HogFunction group atomically.
Path parameters
- idstring
Request parameters
- hog_function_idsarray
Example request
POST /api /environments /:environment_id /logs /alerts /:id /destinations /deleteExample response
Status 204 No response body
Create environments logs alerts destinations delete
Also available via the PostHog MCP server:
logs-alerts-destinations-delete-create— Detach alert destination
Delete a notification destination by deleting its HogFunction group atomically.
Path parameters
- idstring
Request parameters
- hog_function_idsarray
Example request
POST /api /environments /:environment_id /logs /alerts /:id /destinations /deleteExample response
Status 204 No response body
List all environments logs alerts events
Also available via the PostHog MCP server:
logs-alerts-events-list— List alert events
Paginated event history for this alert, newest first. Returns state transitions, errored checks, and user-initiated control-plane rows (reset, enable/disable, snooze/unsnooze, threshold change) — quiet no-op check rows (where state didn't change and there was no error) are filtered out since only the last 10 are kept and they carry no forensic value. Optional ?kind=... narrows to a single kind.
Path parameters
- idstring
Query parameters
- limitinteger
- offsetinteger
Response
Example request
GET /api /environments /:environment_id /logs /alerts /:id /eventsExample response
Status 200
List all environments logs alerts events
Also available via the PostHog MCP server:
logs-alerts-events-list— List alert events
Paginated event history for this alert, newest first. Returns state transitions, errored checks, and user-initiated control-plane rows (reset, enable/disable, snooze/unsnooze, threshold change) — quiet no-op check rows (where state didn't change and there was no error) are filtered out since only the last 10 are kept and they carry no forensic value. Optional ?kind=... narrows to a single kind.
Path parameters
- idstring
Query parameters
- limitinteger
- offsetinteger
Response
Example request
GET /api /environments /:environment_id /logs /alerts /:id /eventsExample response
Status 200
Create environments logs alerts reset
Reset a broken alert. Clears the consecutive-failure counter and schedules an immediate recheck.
Path parameters
- idstring
Response
Example request
POST /api /environments /:environment_id /logs /alerts /:id /resetExample response
Status 200
Create environments logs alerts reset
Reset a broken alert. Clears the consecutive-failure counter and schedules an immediate recheck.
Path parameters
- idstring
Response
Example request
POST /api /environments /:environment_id /logs /alerts /:id /reset