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:readQuery parameters
- limitinteger
- offsetinteger
Response
Example request
GET /api /projects /:project_id /platform_alertsexport 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/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/projects/{project_id}/platform_alerts/".format(project_id=project_id),headers={"Authorization": "Bearer {}".format(api_key)},).json()
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:readPath parameters
- idstring
Response
Example request
GET /api /projects /:project_id /platform_alerts /:idexport 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/
api_key = "[your personal api key]"project_id = "[your project id]"response = requests.get("<ph_app_host>/api/projects/{project_id}/platform_alerts/{platform_alert_id}/".format(project_id=project_id,platform_alert_id="<the platform alert id>"),headers={"Authorization": "Bearer {}".format(api_key)},).json()
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"}]}