Platform

For instructions on how to authenticate to use this endpoint, see API overview.

Endpoints

GET
GET

List all platform alerts

Required API key scopes

alert:read

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

GET /api/projects/:project_id/platform_alerts
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/platform_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,
"source_kind": "logs",
"source_config": {},
"check_interval_minutes": 0,
"recurrence_unit": "day",
"anchor_time": "string",
"evaluation_periods": 0,
"datapoints_to_alarm": 0,
"cooldown_minutes": 0,
"schedule_restriction": {
"blocked_windows": [
{
"start": "string",
"end": "string"
}
]
},
"next_check_at": "2019-08-24T14:15:22Z",
"consecutive_failures": 0,
"legacy_configuration_id": "c5c22f76-e160-4adf-9790-fd4a93ed375d",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"alerts": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"grouping_key": "string",
"state": "not_firing",
"firing_started_at": "2019-08-24T14:15:22Z",
"last_notified_at": "2019-08-24T14:15:22Z",
"snooze_until": "2019-08-24T14:15:22Z"
}
]
}
]
}

Retrieve platform alerts

Required API key scopes

alert:read

Path parameters

  • id
    string

Response


Example request

GET /api/projects/:project_id/platform_alerts/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/platform_alerts/:id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"enabled": true,
"source_kind": "logs",
"source_config": {},
"check_interval_minutes": 0,
"recurrence_unit": "day",
"anchor_time": "string",
"evaluation_periods": 0,
"datapoints_to_alarm": 0,
"cooldown_minutes": 0,
"schedule_restriction": {
"blocked_windows": [
{
"start": "string",
"end": "string"
}
]
},
"next_check_at": "2019-08-24T14:15:22Z",
"consecutive_failures": 0,
"legacy_configuration_id": "c5c22f76-e160-4adf-9790-fd4a93ed375d",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"alerts": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"grouping_key": "string",
"state": "not_firing",
"firing_started_at": "2019-08-24T14:15:22Z",
"last_notified_at": "2019-08-24T14:15:22Z",
"snooze_until": "2019-08-24T14:15:22Z"
}
]
}