Skip to main content
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


Home channel

Set an organisation home channel and Ankra starts the conversation itself. Whenever something important happens - a deployment or reconcile failure, an agent going offline, a new severe CVE - and no routing rule matches it, Ankra posts to the home channel. It is the default destination, so your team hears about important events before anyone wires up a single rule.
1

Connect Slack

Connect a Slack workspace to Ankra from the Slack integration in your organisation settings, and invite the Ankra bot to any private channel you want to use.
2

Pick the home channel

Open AISettingsWorkspaces, find Ankra’s home, choose a Slack channel, and save.
Only critical and warning events reach the home channel; informational events stay in the in-app inbox. The home is a fallback - when a routing rule already matches an event it goes there instead, and the home is not double-notified. Alerts that already post to their own destinations are left to those destinations.

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
For Slack and Microsoft Teams you can skip the URL entirely: once the Ankra app is installed in your Slack workspace, or the Ankra AI bot has been added to a Microsoft Teams team, the URL field is replaced by a channel picker and the Ankra bot posts the alerts itself. Teams channels are listed as Team / Channel across every team the bot is in - add the bot to a team first for its channels to appear. See Connecting Microsoft Teams for installing the bot.
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 the notification is delivered. One destination stores one template, and that template renders every notification it receives - alert firings, alert resolutions, and the operational notifications a routing rule sends it. The tables below mark which of those a variable carries a value for.

Notification

Alert Information

Alert firings and resolutions carry all of these. Operational notifications carry {{severity}} and its two presentation values; the rest are empty for them, except a firing routed by a routing rule, which also carries {{condition_type}} and {{trigger_value}}.

Resource Information

Every notification kind fills what it has. Where a producer records no finer resource kind, {{resource_type}} reads as the thing that went wrong - “operation”, “resource”, “agent”, “insight”, “gitops repository”, “security report”. Agent notifications are about the agent on a cluster, so their {{resource_name}} is that cluster’s name.

Action URLs

Empty values and fallbacks

No notification kind carries a value for every variable - a cluster-level alert has no job, an agent update has no condition. Two things stop that showing up as a column of blank rows in your card:
  • Empty rows are dropped for you. After substitution Ankra removes the rows whose whole purpose was to show one value: Adaptive Card FactSet facts whose value came out empty (and a FactSet left with no facts), empty TextBlock entries, Slack section fields whose *Label* has no value under it, and the {"name", "value"} rows a Discord embed or a legacy Teams MessageCard carries. All four built-in presets therefore render correctly for every kind with no editing. Containers, columns and action sets are never removed, and a card is never pruned down to nothing.
  • You can supply your own fallback with {{variable|text}}, for example {{resource_name|not applicable}}. The fallback is used both when the variable is unknown and when it resolves empty, so it wins over the row being dropped.
A variable name Ankra does not recognise renders as an empty string rather than as literal {{...}} text. The JSON-valued variables ({{data}}, {{route_hint}}, {{trigger_details}}, {{resource_snapshot}}) follow where you put them: written unquoted they splice in as a nested object, and written inside a quoted string they are escaped for you so the payload stays valid JSON.
Every other value is escaped for the string it sits in, so a resource name containing a quote or a newline cannot break your template.

Integration Examples

Slack

Slack webhooks use the Block Kit format for rich messages:
Create a Slack webhook at Your Workspace → Apps → Incoming Webhooks.

Microsoft Teams

Microsoft retired Office 365 Connectors, so a Teams channel no longer offers an “Incoming Webhook” — the supported route is a Power Automate (Workflows) flow using the “Send webhook alerts to a channel” template, which hands you an HTTP POST URL to paste into Ankra. Payloads on that route must be Adaptive Cards wrapped in a message attachment. The legacy MessageCard format is silently degraded: the flow reports success, but Teams drops every potentialAction button. Use {{severity_style}} for the card colour — Adaptive Cards cannot consume the {{severity_color}} hex value:
The built-in Microsoft Teams template in the destination form already uses this Adaptive Card format — pick the Teams preset and adjust from there. For interactive alerts inside Teams without Power Automate, connect the Ankra bot instead: see AI Connections.

Discord

Discord uses the embed format:

PagerDuty

PagerDuty Events API v2 format:
Use PagerDuty’s Events API v2 endpoint: https://events.pagerduty.com/v2/enqueue

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:
  1. Send a sample alert payload to your endpoint
  2. Verify the message appears correctly in your target service
  3. Confirm the JSON structure is valid for your integration
Test payloads populate every template variable, so a template that renders correctly under Test renders correctly on delivery - the Test button and the delivery pipeline run the same renderer. A real notification only fills the variables its kind has a value for, and the rows for the rest are dropped as described in Empty values and fallbacks. Testing a routing rule (Alerting → Routing rules → Test) sends the same sample through the rule’s own kind, so you can check a rule and its destination’s template together.

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.

Managing destinations and routes from the CLI

Everything above can be scripted with the ankra CLI, using the same personal access token as the rest of the CLI, so alert routing can live in Git and be applied from CI alongside your clusters. -o json and -o yaml keep the output parseable.
Updates send only the flags you pass, so the rest of a destination or route stays untouched. The same endpoints are available directly for other tooling under /api/v1/org/alerts/integrations and /api/v1/org/notifications/routes with a bearer token. Before you rely on a set of rules, run ankra alerts routes preview to see which destinations a notification would actually reach. Notification routing covers the full matching, ordering, and de-duplication behaviour.
  • 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.