Setup Notification webhooks
How to setup Notification webhooks
To send notifications from the CAST AI Console to an external system, select the organization you want to configure the webhook.
-
Click on the Notifications Icon -> View All
-
Click on Webhooks
-
Click on Add webhooks
-
Create the Webhook
Field | Description |
---|---|
Name | The name of the Webhook configuration |
Callback Url | The callback URL to send the requests to |
Severity Triggers | The severity levels that will trigger that notification |
Template | The template of the request that will be sent to the callback URL |
The Request Template should be a valid JSON
. We provide a better overview of how to customize the payloads in the next section.
Request Template Configuration
We allow users to fully customize the request sent to external systems, in that way, we can support almost any application out there. The Request Template is the payload sent within the webhook call. The following variables from notifications are available:
Variable | Description | Usage |
---|---|---|
NotificationID | The UUID of the notification, it is unique | {{ .NotificationID }} |
OrganizationID | The organization that owns the notification | {{ .OrganizationID }} |
Severity | Indicates the severity of the impact on the affected system. | {{ .Severity }} |
Name | Name of the notification | {{ .Name }} |
Message | A high-level text summary message of the event. | {{ .Message}} |
Details | Free-form details from the event can be parsed into JSON | {{ toJSON .Details }} |
Timestamp | When the Notification was created by CAST AI | {{ toISO8601 .Timestamp }} |
Cluster | Cluster information, might be empty, if the notification isn't specific | {{ toJSON .Cluster }} |
Cluster.ID | The unique identifier of the cluster on CAST AI | {{ .Cluster.ID }} |
Cluster.Name | Name of the cluster on CAST AI | {{ .Cluster.Name }} |
Cluster.ProviderType | Cloud provider of the cluster (eks, gke, aks, kops) | {{ .Cluster.ProviderType }} |
Cluster.ProjectNamespaceID | Cluster location where cloud provider organizes resources, eg.: GCP project ID, AWS account ID. | {{ .Cluster.ProjectNamespaceID }} |
As you can see, the variables are in go template style, and you can mix them anywhere you want in your Request Template.
Example of Request Template Slack
To send a notification on Slack we need a simple JSON request with payload in the body,
{
"text": "CAST AI - {{ .Name }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "{{ .Cluster.Name }}<br> {{ .Message}}"
}
}
]
}
How to create the webhook URL isn't in the scope of this how-to. You can find information following the link https://api.slack.com/messaging/webhooks.
Example of Request Template PagerDuty
PagerDuty accepts Alerts in the endpoint https://events.pagerduty.com/v2/enqueue
. The content is a simple JSON request with the payload in the body. You can find below an example of a request template with the available variables:
{
"payload": {
"summary": "{{ .Message }}",
"timestamp": "{{ toISO8601 .Timestamp }}",
"severity": "critical",
"source": "CAST AI",
"component": "{{ .Cluster.Name}}-{{ .Cluster.ProviderType}}-{{ .Cluster.ProjectNamespaceID }}",
"group": "{{ .Name }}",
"class": "kubernetes",
"custom_details": {
"details": "{{ toJSON .Details }}"
}
},
"routing_key": "--routing_key--",
"dedup_key": "{{ .NotificationID }}",
"event_action": "trigger",
"client": "CAST AI",
"client_url": "https://console.cast.ai/external-clusters/{{ .Cluster.ID}}?org={{ .OrganizationID }}",
}
Note that dedup_key
was set as the NotificationID
. This field is unique in CAST AI and will ensure you won't produce an alert with the same content more than once.
How to create the routing_key
isn't in the scope of this how-to. You can find more information at https://developer.pagerduty.com/docs/ZG9jOjExMDI5NTgx-send-an-alert-event.
Example of OpsGenie Notification webhook setup.
This configuration enables the integration of OpsGenie with the CAST AI console, ensuring that alerts are received in OpsGenie.
OpsGenie pre-requisite
Add an API integration
- Go to Settings → Integrations.
- Run a search and select “API”.
- On the next screen, enter a name for the integration.
- Optional: Select a team in Assignee team if you want a specific team to receive alerts from the integration. Learn how alert notifications flow in Opsgenie.
- Select Continue.
The integration is saved at this point. - Expand the Steps to configure the integration section and copy the API key for use in your API requests.
- Select Turn on integration.
The rules you create for the integration will work only if you turn on the integration.

API key integration example
Define rules for creating and processing alerts
The configuration of an API integration involves defining many different alert scenarios. These scenarios specify how and when alerts can be created, closed, acknowledged, etc. The integration comes with a default set of alert creation and processing rules; you can customize them and add as many rules of your own as you like. For example, you can add three rules for create alert, which means the incoming data is evaluated against these three scenarios in order, and if one of them matches, an alert is created.

Alert rules example
OpsGenie Integration
Add a Webhook integration
- Go to Settings > Integrations.
- Select Add integration.
- Run a search and select “Webhook”.
- On the next screen, enter a name for the integration.
- Optional: Select a team in Assignee team if you want a specific team to receive alerts from the integration.
- Select Continue.
The integration is saved at this point. - Select Turn on integration.
The rules you create for the integration will work only if you turn on the integration.
Sending alert description and alert details is only available for Create and Custom actions.

Webhook integration example
Webhook configuration
Utilize the provided API integration key to configure your webhook integration, ensuring it is utilized for authentication purposes.
- Webhook URL should be https://api.opsgenie.com/v2/alerts
- Customer Header should include:
- _Authorization: GenieKey
- _Content-Type: application/json
=
Webhook integration validation
Before entering the essential details into the CAST AI webhook configuration, we recommend executing the following curl command. This action will verify whether the configured integration receives alerts and notifications as anticipated:
curl -X POST "<https://api.opsgenie.com/v2/alerts">
-H "Content-Type: application/json"
-H "Authorization: GenieKey <API Key>"
-d '{"message": "An example alert message"}'
Alert within OpsGenie should be triggered:\`

OpsGenie Alert
CAST AI Integration
Add webhook via CAST AI console
- Navigate to Notifications > Add Webhook
- Set up the fields below using the information collected from the Webhook and API integration
- Name of Webhook
- Callback URL
- Severity
- Request template
- Authorization keys (Headers)

Webhook “Can connect” example
Updated 27 days ago