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-listList log alerts

Required API key scopes

logs:read

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

GET /api/environments/:environment_id/logs/alerts
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/logs/alerts/

Example response

Status 200
RESPONSE
{
"count": 123,
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100",
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"enabled": true,
"filters": {
"filterGroup": null,
"serviceNames": null,
"severityLevels": null
},
"threshold_count": 100,
"threshold_operator": "above",
"window_minutes": 5,
"check_interval_minutes": 0,
"state": "not_firing",
"evaluation_periods": 1,
"datapoints_to_alarm": 1,
"cooldown_minutes": 0,
"snooze_until": "2019-08-24T14:15:22Z",
"next_check_at": "2019-08-24T14:15:22Z",
"last_notified_at": "2019-08-24T14:15:22Z",
"last_checked_at": "2019-08-24T14:15:22Z",
"consecutive_failures": 0,
"last_error_message": "string",
"state_timeline": [
{
"start": "2019-08-24T14:15:22Z",
"end": "2019-08-24T14:15:22Z",
"state": "not_firing",
"enabled": true
}
],
"destination_types": [
"slack"
],
"first_enabled_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"updated_at": "2019-08-24T14:15:22Z"
}
]
}

List all environments logs alerts

Also available via the PostHog MCP server:

  • logs-alerts-listList log alerts

Required API key scopes

logs:read

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

GET /api/environments/:environment_id/logs/alerts
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/logs/alerts/

Example response

Status 200
RESPONSE
{
"count": 123,
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100",
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"enabled": true,
"filters": {
"filterGroup": null,
"serviceNames": null,
"severityLevels": null
},
"threshold_count": 100,
"threshold_operator": "above",
"window_minutes": 5,
"check_interval_minutes": 0,
"state": "not_firing",
"evaluation_periods": 1,
"datapoints_to_alarm": 1,
"cooldown_minutes": 0,
"snooze_until": "2019-08-24T14:15:22Z",
"next_check_at": "2019-08-24T14:15:22Z",
"last_notified_at": "2019-08-24T14:15:22Z",
"last_checked_at": "2019-08-24T14:15:22Z",
"consecutive_failures": 0,
"last_error_message": "string",
"state_timeline": [
{
"start": "2019-08-24T14:15:22Z",
"end": "2019-08-24T14:15:22Z",
"state": "not_firing",
"enabled": true
}
],
"destination_types": [
"slack"
],
"first_enabled_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"updated_at": "2019-08-24T14:15:22Z"
}
]
}

Create environments logs alerts

Also available via the PostHog MCP server:

  • logs-alerts-createCreate log alert

Required API key scopes

logs:write

Request parameters

  • name
    string
  • enabled
    boolean
    Default: true
  • filters
  • threshold_count
    integer
    Default: 100
  • threshold_operator
    Default: above
  • window_minutes
    integer
    Default: 5
  • evaluation_periods
    integer
    Default: 1
  • datapoints_to_alarm
    integer
    Default: 1
  • cooldown_minutes
    integer
    Default: 0
  • snooze_until
    stringnull

Response


Example request

POST /api/environments/:environment_id/logs/alerts
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/logs/alerts/\
-d name="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"enabled": true,
"filters": {
"filterGroup": null,
"serviceNames": null,
"severityLevels": null
},
"threshold_count": 100,
"threshold_operator": "above",
"window_minutes": 5,
"check_interval_minutes": 0,
"state": "not_firing",
"evaluation_periods": 1,
"datapoints_to_alarm": 1,
"cooldown_minutes": 0,
"snooze_until": "2019-08-24T14:15:22Z",
"next_check_at": "2019-08-24T14:15:22Z",
"last_notified_at": "2019-08-24T14:15:22Z",
"last_checked_at": "2019-08-24T14:15:22Z",
"consecutive_failures": 0,
"last_error_message": "string",
"state_timeline": [
{
"start": "2019-08-24T14:15:22Z",
"end": "2019-08-24T14:15:22Z",
"state": "not_firing",
"enabled": true
}
],
"destination_types": [
"slack"
],
"first_enabled_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"updated_at": "2019-08-24T14:15:22Z"
}

Create environments logs alerts

Also available via the PostHog MCP server:

  • logs-alerts-createCreate log alert

Required API key scopes

logs:write

Request parameters

  • name
    string
  • enabled
    boolean
    Default: true
  • filters
  • threshold_count
    integer
    Default: 100
  • threshold_operator
    Default: above
  • window_minutes
    integer
    Default: 5
  • evaluation_periods
    integer
    Default: 1
  • datapoints_to_alarm
    integer
    Default: 1
  • cooldown_minutes
    integer
    Default: 0
  • snooze_until
    stringnull

Response


Example request

POST /api/environments/:environment_id/logs/alerts
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/logs/alerts/\
-d name="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"enabled": true,
"filters": {
"filterGroup": null,
"serviceNames": null,
"severityLevels": null
},
"threshold_count": 100,
"threshold_operator": "above",
"window_minutes": 5,
"check_interval_minutes": 0,
"state": "not_firing",
"evaluation_periods": 1,
"datapoints_to_alarm": 1,
"cooldown_minutes": 0,
"snooze_until": "2019-08-24T14:15:22Z",
"next_check_at": "2019-08-24T14:15:22Z",
"last_notified_at": "2019-08-24T14:15:22Z",
"last_checked_at": "2019-08-24T14:15:22Z",
"consecutive_failures": 0,
"last_error_message": "string",
"state_timeline": [
{
"start": "2019-08-24T14:15:22Z",
"end": "2019-08-24T14:15:22Z",
"state": "not_firing",
"enabled": true
}
],
"destination_types": [
"slack"
],
"first_enabled_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"updated_at": "2019-08-24T14:15:22Z"
}

Retrieve environments logs alerts

Also available via the PostHog MCP server:

  • logs-alerts-retrieveGet log alert

Required API key scopes

logs:read

Path parameters

  • id
    string

Response


Example request

GET /api/environments/:environment_id/logs/alerts/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/logs/alerts/:id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"enabled": true,
"filters": {
"filterGroup": null,
"serviceNames": null,
"severityLevels": null
},
"threshold_count": 100,
"threshold_operator": "above",
"window_minutes": 5,
"check_interval_minutes": 0,
"state": "not_firing",
"evaluation_periods": 1,
"datapoints_to_alarm": 1,
"cooldown_minutes": 0,
"snooze_until": "2019-08-24T14:15:22Z",
"next_check_at": "2019-08-24T14:15:22Z",
"last_notified_at": "2019-08-24T14:15:22Z",
"last_checked_at": "2019-08-24T14:15:22Z",
"consecutive_failures": 0,
"last_error_message": "string",
"state_timeline": [
{
"start": "2019-08-24T14:15:22Z",
"end": "2019-08-24T14:15:22Z",
"state": "not_firing",
"enabled": true
}
],
"destination_types": [
"slack"
],
"first_enabled_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"updated_at": "2019-08-24T14:15:22Z"
}

Retrieve environments logs alerts

Also available via the PostHog MCP server:

  • logs-alerts-retrieveGet log alert

Required API key scopes

logs:read

Path parameters

  • id
    string

Response


Example request

GET /api/environments/:environment_id/logs/alerts/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/logs/alerts/:id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"enabled": true,
"filters": {
"filterGroup": null,
"serviceNames": null,
"severityLevels": null
},
"threshold_count": 100,
"threshold_operator": "above",
"window_minutes": 5,
"check_interval_minutes": 0,
"state": "not_firing",
"evaluation_periods": 1,
"datapoints_to_alarm": 1,
"cooldown_minutes": 0,
"snooze_until": "2019-08-24T14:15:22Z",
"next_check_at": "2019-08-24T14:15:22Z",
"last_notified_at": "2019-08-24T14:15:22Z",
"last_checked_at": "2019-08-24T14:15:22Z",
"consecutive_failures": 0,
"last_error_message": "string",
"state_timeline": [
{
"start": "2019-08-24T14:15:22Z",
"end": "2019-08-24T14:15:22Z",
"state": "not_firing",
"enabled": true
}
],
"destination_types": [
"slack"
],
"first_enabled_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"updated_at": "2019-08-24T14:15:22Z"
}

Update environments logs alerts

Also available via the PostHog MCP server:

  • logs-alerts-partial-updateUpdate log alert

Required API key scopes

logs:write

Path parameters

  • id
    string

Request parameters

  • name
    string
  • enabled
    boolean
    Default: true
  • filters
  • threshold_count
    integer
    Default: 100
  • threshold_operator
    Default: above
  • window_minutes
    integer
    Default: 5
  • evaluation_periods
    integer
    Default: 1
  • datapoints_to_alarm
    integer
    Default: 1
  • cooldown_minutes
    integer
    Default: 0
  • snooze_until
    stringnull

Response


Example request

PATCH /api/environments/:environment_id/logs/alerts/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/logs/alerts/:id/\
-d name="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"enabled": true,
"filters": {
"filterGroup": null,
"serviceNames": null,
"severityLevels": null
},
"threshold_count": 100,
"threshold_operator": "above",
"window_minutes": 5,
"check_interval_minutes": 0,
"state": "not_firing",
"evaluation_periods": 1,
"datapoints_to_alarm": 1,
"cooldown_minutes": 0,
"snooze_until": "2019-08-24T14:15:22Z",
"next_check_at": "2019-08-24T14:15:22Z",
"last_notified_at": "2019-08-24T14:15:22Z",
"last_checked_at": "2019-08-24T14:15:22Z",
"consecutive_failures": 0,
"last_error_message": "string",
"state_timeline": [
{
"start": "2019-08-24T14:15:22Z",
"end": "2019-08-24T14:15:22Z",
"state": "not_firing",
"enabled": true
}
],
"destination_types": [
"slack"
],
"first_enabled_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"updated_at": "2019-08-24T14:15:22Z"
}

Update environments logs alerts

Also available via the PostHog MCP server:

  • logs-alerts-partial-updateUpdate log alert

Required API key scopes

logs:write

Path parameters

  • id
    string

Request parameters

  • name
    string
  • enabled
    boolean
    Default: true
  • filters
  • threshold_count
    integer
    Default: 100
  • threshold_operator
    Default: above
  • window_minutes
    integer
    Default: 5
  • evaluation_periods
    integer
    Default: 1
  • datapoints_to_alarm
    integer
    Default: 1
  • cooldown_minutes
    integer
    Default: 0
  • snooze_until
    stringnull

Response


Example request

PATCH /api/environments/:environment_id/logs/alerts/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/logs/alerts/:id/\
-d name="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"enabled": true,
"filters": {
"filterGroup": null,
"serviceNames": null,
"severityLevels": null
},
"threshold_count": 100,
"threshold_operator": "above",
"window_minutes": 5,
"check_interval_minutes": 0,
"state": "not_firing",
"evaluation_periods": 1,
"datapoints_to_alarm": 1,
"cooldown_minutes": 0,
"snooze_until": "2019-08-24T14:15:22Z",
"next_check_at": "2019-08-24T14:15:22Z",
"last_notified_at": "2019-08-24T14:15:22Z",
"last_checked_at": "2019-08-24T14:15:22Z",
"consecutive_failures": 0,
"last_error_message": "string",
"state_timeline": [
{
"start": "2019-08-24T14:15:22Z",
"end": "2019-08-24T14:15:22Z",
"state": "not_firing",
"enabled": true
}
],
"destination_types": [
"slack"
],
"first_enabled_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"updated_at": "2019-08-24T14:15:22Z"
}

Delete environments logs alerts

Also available via the PostHog MCP server:

  • logs-alerts-destroyDelete log alert

Required API key scopes

logs:write

Path parameters

  • id
    string

Example request

DELETE /api/environments/:environment_id/logs/alerts/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X DELETE \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/logs/alerts/:id/

Example response

Status 204 No response body

Delete environments logs alerts

Also available via the PostHog MCP server:

  • logs-alerts-destroyDelete log alert

Required API key scopes

logs:write

Path parameters

  • id
    string

Example request

DELETE /api/environments/:environment_id/logs/alerts/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X DELETE \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/logs/alerts/:id/

Example response

Status 204 No response body

Create environments logs alerts destinations

Also available via the PostHog MCP server:

  • logs-alerts-destinations-createAttach alert destination

Create a notification destination for this alert. One HogFunction is created per alert event kind (firing, resolved, ...) atomically.

Path parameters

  • id
    string

Request parameters

  • type
  • slack_workspace_id
    integer
  • slack_channel_id
    string
  • slack_channel_name
    string
  • webhook_url
    string

Response


Example request

POST /api/environments/:environment_id/logs/alerts/:id/destinations
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/logs/alerts/:id/destinations/\
-d type=undefined

Example response

Status 201
RESPONSE
{
"hog_function_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
]
}

Create environments logs alerts destinations

Also available via the PostHog MCP server:

  • logs-alerts-destinations-createAttach alert destination

Create a notification destination for this alert. One HogFunction is created per alert event kind (firing, resolved, ...) atomically.

Path parameters

  • id
    string

Request parameters

  • type
  • slack_workspace_id
    integer
  • slack_channel_id
    string
  • slack_channel_name
    string
  • webhook_url
    string

Response


Example request

POST /api/environments/:environment_id/logs/alerts/:id/destinations
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/logs/alerts/:id/destinations/\
-d type=undefined

Example response

Status 201
RESPONSE
{
"hog_function_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
]
}

Create environments logs alerts destinations delete

Also available via the PostHog MCP server:

  • logs-alerts-destinations-delete-createDetach alert destination

Delete a notification destination by deleting its HogFunction group atomically.

Path parameters

  • id
    string

Request parameters

  • hog_function_ids
    array

Example request

POST /api/environments/:environment_id/logs/alerts/:id/destinations/delete
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/logs/alerts/:id/destinations/delete/\
-d hog_function_ids="array"

Example response

Status 204 No response body

Create environments logs alerts destinations delete

Also available via the PostHog MCP server:

  • logs-alerts-destinations-delete-createDetach alert destination

Delete a notification destination by deleting its HogFunction group atomically.

Path parameters

  • id
    string

Request parameters

  • hog_function_ids
    array

Example request

POST /api/environments/:environment_id/logs/alerts/:id/destinations/delete
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/logs/alerts/:id/destinations/delete/\
-d hog_function_ids="array"

Example response

Status 204 No response body

List all environments logs alerts events

Also available via the PostHog MCP server:

  • logs-alerts-events-listList 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

  • id
    string

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

GET /api/environments/:environment_id/logs/alerts/:id/events
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/logs/alerts/:id/events/

Example response

Status 200
RESPONSE
{
"count": 123,
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100",
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"created_at": "2019-08-24T14:15:22Z",
"kind": "check",
"state_before": "string",
"state_after": "string",
"threshold_breached": true,
"result_count": 0,
"error_message": "string",
"query_duration_ms": 0
}
]
}

List all environments logs alerts events

Also available via the PostHog MCP server:

  • logs-alerts-events-listList 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

  • id
    string

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

GET /api/environments/:environment_id/logs/alerts/:id/events
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/logs/alerts/:id/events/

Example response

Status 200
RESPONSE
{
"count": 123,
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100",
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"created_at": "2019-08-24T14:15:22Z",
"kind": "check",
"state_before": "string",
"state_after": "string",
"threshold_breached": true,
"result_count": 0,
"error_message": "string",
"query_duration_ms": 0
}
]
}

Create environments logs alerts reset

Reset a broken alert. Clears the consecutive-failure counter and schedules an immediate recheck.

Path parameters

  • id
    string

Response


Example request

POST /api/environments/:environment_id/logs/alerts/:id/reset
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/logs/alerts/:id/reset/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"enabled": true,
"filters": {
"filterGroup": null,
"serviceNames": null,
"severityLevels": null
},
"threshold_count": 100,
"threshold_operator": "above",
"window_minutes": 5,
"check_interval_minutes": 0,
"state": "not_firing",
"evaluation_periods": 1,
"datapoints_to_alarm": 1,
"cooldown_minutes": 0,
"snooze_until": "2019-08-24T14:15:22Z",
"next_check_at": "2019-08-24T14:15:22Z",
"last_notified_at": "2019-08-24T14:15:22Z",
"last_checked_at": "2019-08-24T14:15:22Z",
"consecutive_failures": 0,
"last_error_message": "string",
"state_timeline": [
{
"start": "2019-08-24T14:15:22Z",
"end": "2019-08-24T14:15:22Z",
"state": "not_firing",
"enabled": true
}
],
"destination_types": [
"slack"
],
"first_enabled_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"updated_at": "2019-08-24T14:15:22Z"
}

Create environments logs alerts reset

Reset a broken alert. Clears the consecutive-failure counter and schedules an immediate recheck.

Path parameters

  • id
    string

Response


Example request

POST /api/environments/:environment_id/logs/alerts/:id/reset
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/logs/alerts/:id/reset/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"enabled": true,
"filters": {
"filterGroup": null,
"serviceNames": null,
"severityLevels": null
},
"threshold_count": 100,
"threshold_operator": "above",
"window_minutes": 5,
"check_interval_minutes": 0,
"state": "not_firing",
"evaluation_periods": 1,
"datapoints_to_alarm": 1,
"cooldown_minutes": 0,
"snooze_until": "2019-08-24T14:15:22Z",
"next_check_at": "2019-08-24T14:15:22Z",
"last_notified_at": "2019-08-24T14:15:22Z",
"last_checked_at": "2019-08-24T14:15:22Z",
"consecutive_failures": 0,
"last_error_message": "string",
"state_timeline": [
{
"start": "2019-08-24T14:15:22Z",
"end": "2019-08-24T14:15:22Z",
"state": "not_firing",
"enabled": true
}
],
"destination_types": [
"slack"
],
"first_enabled_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"updated_at": "2019-08-24T14:15:22Z"
}

Community questions

Questions about this page? or post a community question.