Create an alert with an outgoing webhook
Use case: Create an alert with an outgoing webhook
This guide demonstrates how to create an alert that sends notifications through an outgoing webhook (e.g., Slack) using the REST API. The flow involves:
- Creating a webhook integration
- Testing the webhook
- Listing webhooks to retrieve
integrationId
- Creating the alert definition
Steps
- Create a webhook integration
POST /v1/outgoing-webhooks
Create a new webhook integration to send notifications to Slack. The current webhook configuration enables notifications about error and critical logs, spike anomalies, and data usage. The alert message is also configured to include a snapshot of metric data.
Field | Description |
---|---|
type | Integration type (e.g.,2 = Slack) |
url | Webhook destination URL |
digests | Events that trigger notifications |
attachments | Metric snapshots |
Supported webhook types
Value | Name | Description |
---|---|---|
0 | UNKNOWN | Default or undefined |
1 | GENERIC | Generic webhook |
2 | SLACK | Slack integration |
3 | PAGERDUTY | PagerDuty integration |
4 | SEND_LOG | Log forwarding webhook |
5 | EMAIL_GROUP | Email group notification |
6 | MICROSOFT_TEAMS | Microsoft Teams |
7 | JIRA | Jira integration |
8 | OPSGENIE | Opsgenie integration |
9 | DEMISTO | Demisto |
10 | AWS_EVENT_BRIDGE | AWS EventBridge |
11 | IBM_EVENT_NOTIFICATIONS | IBM Event Notifications |
12 | MS_TEAMS_WORKFLOW | MS Teams workflow app |
Request body
- Test outgoing webhook
POST /v1/outgoing-webhooks/test
To validate the webhook configuration, send a test request.
Request body
Same as the create payload above.
Successful response
- Retrieve webhook integration ID
GET /v1/outgoing-webhooks/all
Use the List Outgoing Webhooks API to retrieve the list of available integrations. From the response, extract the externalId
of the webhook you just created—this will be used as integrationId
in the alert definition.
Sample response
- Create an alert with the webhook
POST /v3/alert-defs
Now that you have the integrationId
, you can define an alert and specify the webhook as a notification destination.
Summary
Create webhook | POST /api/integrations/webhook | Define the outgoing integration |
---|---|---|
Test webhook | POST /api/integrations/webhook/test | Optional but recommended |
Get webhook ID | GET /api/integrations/webhook | Extract externalId |
Create alert | POST /api/alerts | Attach webhook using integrationId |