Webhooks allow you to send alert notifications to any service that accepts HTTP POST requests - Slack, Microsoft Teams, Discord, PagerDuty, Opsgenie, Datadog, or your own custom endpoints.
What are Webhooks?
Webhooks are HTTP endpoints that receive alert notifications when your alert rules trigger. Ankra sends a POST request with alert details to your configured URL, allowing you to integrate with virtually any notification or incident management system. Key features:- Universal compatibility - Works with any service accepting webhooks
- Custom payloads - Full control over the JSON structure sent to your endpoint
- Template variables - Dynamic values like alert name, severity, and resource details
- Pre-built templates - Quick setup for popular services
How Webhooks Work
Creating a Webhook
1
Navigate to Webhooks
Go to Alerts → Integrations → Webhooks and click Create Webhook.
2
Configure Basic Settings
- Webhook Name: A descriptive name (e.g., “PagerDuty Production”)
- Webhook URL: The endpoint URL provided by your integration service
- Description: Optional notes about this webhook’s purpose
- Enabled: Toggle to enable/disable the webhook
3
Select or Create Template
Choose a pre-built template for common services, or create a custom JSON payload:
- Slack - Rich message blocks with buttons
- Microsoft Teams - Adaptive card format
- Discord - Embed format with fields
- Custom JSON - Any JSON structure for other services
4
Save and Test
Save the webhook, then use the Test button to send a sample notification and verify your configuration.
Template Variables
Use these variables in your custom templates. They are replaced with actual values when alerts trigger:Alert Information
| Variable | Description | Example |
|---|---|---|
{{alert_name}} | Name of the alert | ”Production Down Alert” |
{{alert_id}} | Unique alert identifier | ”abc123-def456” |
{{severity}} | Alert severity level | ”critical”, “warning”, “info” |
{{severity_color}} | Hex color for severity | ”#FF0000” |
{{condition_type}} | Type of condition that triggered | ”resource_state” |
{{triggered_at}} | Human-readable trigger time | ”Dec 15, 2024, 3:45 PM” |
{{triggered_at_iso}} | ISO 8601 timestamp | ”2024-12-15T15:45:00Z” |
Resource Information
| Variable | Description | Example |
|---|---|---|
{{resource_name}} | Name of the affected resource | ”nginx-deployment” |
{{resource_type}} | Type of resource | ”addon”, “manifest”, “stack” |
{{job_name}} | Related job name | ”deploy-nginx” |
{{cluster_name}} | Cluster where alert triggered | ”production-us-east” |
Action URLs
| Variable | Description |
|---|---|
{{alert_url}} | Direct link to the alert in Ankra |
{{dashboard_url}} | Link to the Ankra dashboard |
{{acknowledge_url}} | URL to acknowledge the alert |
{{snooze_url}} | URL to snooze the alert |
Integration Examples
Slack
Slack webhooks use the Block Kit format for rich messages:Microsoft Teams
Teams uses MessageCard format:Discord
Discord uses the embed format:PagerDuty
PagerDuty Events API v2 format:Opsgenie
Opsgenie Alert API format:Custom/Generic
For any other service, create a JSON payload that matches their expected format:Testing Webhooks
After creating a webhook, use the Test button to:- Send a sample alert payload to your endpoint
- Verify the message appears correctly in your target service
- Confirm the JSON structure is valid for your integration
Managing Webhooks
Enable/Disable
Toggle webhooks on or off without deleting them. Disabled webhooks won’t receive any notifications but retain their configuration.Edit
Update webhook URLs, templates, or settings at any time. Changes take effect immediately for future alerts.Delete
Remove webhooks you no longer need. Alerts using deleted webhooks will no longer send to that destination.Best Practices
Related
- Alerts - Configure alert rules that trigger webhook notifications
- AI Incidents - AI-powered analysis of triggered alerts
Still have questions? Join our Slack community and we’ll help out.