Warehouse

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

Endpoints

GET
POST
POST

List all warehouse alerts destinations

List the notification destinations of a warehouse alert.

Required API key scopes

alert:readexternal_data_source:read

Path parameters

  • id
    string

Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"type": "slack",
"enabled": true,
"event_kinds": [
"firing"
],
"slack_workspace_id": 0,
"slack_channel_id": "string",
"slack_channel_name": "string",
"webhook_url": "string",
"pagerduty_routing_key": "string",
"pagerduty_severity": "critical",
"pagerduty_region": "us"
}

Create warehouse alerts destinations

Add a notification destination to a warehouse alert.

Required API key scopes

alert:writeexternal_data_source:write

Path parameters

  • id
    string

Request parameters

  • type
  • event_kinds
    Click to open
    array
    Default: firing,resolved
  • slack_workspace_id
    integer
  • slack_channel_id
    string
  • slack_channel_name
    string
  • webhook_url
    string
  • pagerduty_routing_key
    string
  • pagerduty_severity
    Default: critical
  • pagerduty_region
    Default: us

Response


Example request

POST /api/projects/:project_id/warehouse_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/projects/:project_id/warehouse_alerts/:id/destinations/\
-d type=undefined

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"type": "slack",
"enabled": true,
"event_kinds": [
"firing"
],
"slack_workspace_id": 0,
"slack_channel_id": "string",
"slack_channel_name": "string",
"webhook_url": "string",
"pagerduty_routing_key": "string",
"pagerduty_severity": "critical",
"pagerduty_region": "us"
}
Status 400 The destination settings are invalid.

Create warehouse alerts destinations delete

Delete notification destinations of a warehouse alert.

Required API key scopes

alert:writeexternal_data_source:write

Path parameters

  • id
    string

Request parameters

  • destination_ids
    array

Example request

POST /api/projects/:project_id/warehouse_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/projects/:project_id/warehouse_alerts/:id/destinations/delete/\
-d destination_ids="array"

Example response

Status 204 The destinations are deleted.
Status 400 An ID does not belong to this alert.