<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Use webhooks to send and receive alerts on Grafana Labs</title><link>https://grafana.com/docs/oncall/v0.0.39/integrations/webhooks/</link><description>Recent content in Use webhooks to send and receive alerts on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/oncall/v0.0.39/integrations/webhooks/index.xml" rel="self" type="application/rss+xml"/><item><title>Webhook integration</title><link>https://grafana.com/docs/oncall/v0.0.39/integrations/webhooks/add-webhook-integration/</link><pubDate>Tue, 11 Mar 2025 08:38:14 -0600</pubDate><guid>https://grafana.com/docs/oncall/v0.0.39/integrations/webhooks/add-webhook-integration/</guid><content><![CDATA[&lt;h1 id=&#34;integrate-with-your-data-source-using-webhooks&#34;&gt;Integrate with your data source using webhooks&lt;/h1&gt;
&lt;p&gt;Grafana OnCall directly supports integrations from many data sources, but you can connect to any data source that isn&amp;rsquo;t listed in the &lt;strong&gt;Create Integration&lt;/strong&gt; page by using webhooks.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;In &lt;strong&gt;Integrations&lt;/strong&gt;, click &lt;strong&gt;&#43; New integration for receiving alerts&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select a webhook format.
There are two available formats. &lt;strong&gt;Webhook&lt;/strong&gt; and &lt;strong&gt;Formatted Webhook&lt;/strong&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Webhook&lt;/strong&gt; will pull all of the raw JSON information and display it in the manner that it is received.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Formatted Webhook&lt;/strong&gt; can be used if the body of the alerts sent by your monitoring service are formatted in a way that OnCall can read. The following fields are recognized, but none are required:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;alert_uid&lt;/code&gt;: a unique alert ID for grouping.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;title&lt;/code&gt;: a title.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;image_url&lt;/code&gt;: a URL for an image attached to alert.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;state&lt;/code&gt;: either &lt;code&gt;ok&lt;/code&gt; or &lt;code&gt;alerting&lt;/code&gt;. Helpful for auto-resolving.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;link_to_upstream_details&lt;/code&gt;: link back to your monitoring system.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;message&lt;/code&gt;: alert details.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use the unique webhook URL for requests. For example:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;curl -X POST \
https://a-prod-us-central-0.grafana.net/integrations/v1/formatted_webhook/m12xmIjOcgwH74UF8CN4dk0Dh/ \
-H &amp;#39;Content-Type: Application/json&amp;#39; \
-d &amp;#39;{
    &amp;#34;alert_uid&amp;#34;: &amp;#34;08d6891a-835c-e661-39fa-96b6a9e26552&amp;#34;,
    &amp;#34;title&amp;#34;: &amp;#34;The whole system is down&amp;#34;,
    &amp;#34;image_url&amp;#34;: &amp;#34;https://upload.wikimedia.org/wikipedia/commons/e/ee/Grumpy_Cat_by_Gage_Skidmore.jpg&amp;#34;,
    &amp;#34;state&amp;#34;: &amp;#34;alerting&amp;#34;,
    &amp;#34;link_to_upstream_details&amp;#34;: &amp;#34;https://en.wikipedia.org/wiki/Downtime&amp;#34;,
    &amp;#34;message&amp;#34;: &amp;#34;Smth happened. Oh no!&amp;#34;
}&amp;#39;
    ```&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
]]></content><description>&lt;h1 id="integrate-with-your-data-source-using-webhooks">Integrate with your data source using webhooks&lt;/h1>
&lt;p>Grafana OnCall directly supports integrations from many data sources, but you can connect to any data source that isn&amp;rsquo;t listed in the &lt;strong>Create Integration&lt;/strong> page by using webhooks.&lt;/p></description></item><item><title>Format alerts with templates</title><link>https://grafana.com/docs/oncall/v0.0.39/integrations/webhooks/create-custom-templates/</link><pubDate>Tue, 11 Mar 2025 08:38:14 -0600</pubDate><guid>https://grafana.com/docs/oncall/v0.0.39/integrations/webhooks/create-custom-templates/</guid><content><![CDATA[&lt;h1 id=&#34;format-alerts-with-templates&#34;&gt;Format alerts with templates&lt;/h1&gt;
&lt;p&gt;Grafana OnCall works with over one thousand alert monitoring systems. Almost any monitoring system can send alerts using webhooks with JSON payloads.&lt;/p&gt;
&lt;p&gt;By default, webhooks will deliver raw JSON. To modify the payload to be more human-readable, you can format your alerts fields that OnCall recognizes. You can use Jinja templates for more advanced customization.&lt;/p&gt;
&lt;h2 id=&#34;json-alerting-object&#34;&gt;JSON alerting object&lt;/h2&gt;
&lt;p&gt;Alerts we receive contain metadata as keys and values in a JSON object. The following is an example of an alert from Grafana:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;dashboardId&amp;#34;:1,
  &amp;#34;title&amp;#34;:&amp;#34;[Alerting] Panel Title alert&amp;#34;,
  &amp;#34;message&amp;#34;:&amp;#34;Notification Message&amp;#34;,
  &amp;#34;evalMatches&amp;#34;:[
    {
      &amp;#34;value&amp;#34;:1,
      &amp;#34;metric&amp;#34;:&amp;#34;Count&amp;#34;,
      &amp;#34;tags&amp;#34;:{}
    }
  ],
  &amp;#34;imageUrl&amp;#34;:&amp;#34;https://grafana.com/static/assets/img/blog/mixed_styles.png&amp;#34;,
  &amp;#34;orgId&amp;#34;:1,
  &amp;#34;panelId&amp;#34;:2,
  &amp;#34;ruleId&amp;#34;:1,
  &amp;#34;ruleName&amp;#34;:&amp;#34;Panel Title alert&amp;#34;,
  &amp;#34;ruleUrl&amp;#34;:&amp;#34;http://localhost:3000/d/hZ7BuVbWz/test-dashboard?fullscreen\u0026edit\u0026tab=alert\u0026panelId=2\u0026orgId=1&amp;#34;,
  &amp;#34;state&amp;#34;:&amp;#34;alerting&amp;#34;,
  &amp;#34;tags&amp;#34;:{
    &amp;#34;tag name&amp;#34;:&amp;#34;tag value&amp;#34;
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;the-alert-payload&#34;&gt;The alert payload&lt;/h2&gt;
&lt;p&gt;Once an alert is received by Grafana OnCall, the following occurs, based on the alert content:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;The most useful information is shown in a readable format.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Noise is minimized by grouping alerts, combining similar alerts into a single page.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The alert group is resolved if the monitoring system tells Grafana OnCall to do so.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In Grafana OnCall every alert and alert group has the following fields:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Title&lt;/code&gt;, &lt;code&gt;message&lt;/code&gt; and &lt;code&gt;image url&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Grouping Id&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Resolve Signal&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The JSON payload is converted. For example:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;{{ payload.title }}&lt;/code&gt; -&amp;gt; Title&lt;/li&gt;
&lt;li&gt;&lt;code&gt;{{ payload.message }}&lt;/code&gt; -&amp;gt; Message&lt;/li&gt;
&lt;li&gt;&lt;code&gt;{{ payload.imageUrl }}&lt;/code&gt; -&amp;gt; Image Url&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The result is that each field of the alert in OnCall is now mapped to the JSON payload keys. This also true for the alert behavior:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;{{ payload.ruleId }}&lt;/code&gt; -&amp;gt; Grouping Id&lt;/li&gt;
&lt;li&gt;&lt;code&gt;{{ 1 if payload.state == &#39;OK&#39; else 0 }}&lt;/code&gt; -&amp;gt; Resolve Signal&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;OnCall has default Jinja templates for the most popular monitoring systems.&lt;/p&gt;
&lt;p&gt;If your monitoring system is not in the Grafana OnCAll integrations list you can create the most generic integration &lt;code&gt;Webhook&lt;/code&gt;, send an alert, and write your own templates.&lt;/p&gt;
&lt;p&gt;As a best practice, add &lt;code&gt;_Playbooks_&lt;/code&gt;, &lt;code&gt;_Useful links_&lt;/code&gt;, or &lt;code&gt;_Checklists_&lt;/code&gt; to the alert message.&lt;/p&gt;
&lt;h2 id=&#34;how-to-customize-templates&#34;&gt;How to customize templates&lt;/h2&gt;
&lt;p&gt;You can customize the default templates in Grafana OnCall by opening the &lt;strong&gt;Settings&lt;/strong&gt; window in either the &lt;strong&gt;Integrations&lt;/strong&gt; or &lt;strong&gt;Alert Groups&lt;/strong&gt; tab:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;From the &lt;strong&gt;Integrations&lt;/strong&gt; tab, select the integration, then click the &lt;strong&gt;Settings&lt;/strong&gt; (gear) icon.&lt;/p&gt;
 &lt;!--![123](../_images/custom-actions-1.png &#39;:size=400&#39;)--&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;From the &lt;strong&gt;Alert Groups&lt;/strong&gt; tab, click &lt;strong&gt;Edit rendering, grouping, and other templates&lt;/strong&gt;&lt;/p&gt;
 &lt;!--![123](../_images/custom-actions-2.png &#39;:size=400&#39;)--&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In &lt;strong&gt;Settings&lt;/strong&gt;, select the template to edit from &lt;strong&gt;Edit template for&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Edit the Appearances template as needed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Title&lt;/code&gt;, &lt;code&gt;Message&lt;/code&gt;, &lt;code&gt;Image url&lt;/code&gt; for Web&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Title&lt;/code&gt;, &lt;code&gt;Message&lt;/code&gt;, &lt;code&gt;Image url&lt;/code&gt; for Slack&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Title&lt;/code&gt; used in SMS&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Title&lt;/code&gt; used in Phone&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Title&lt;/code&gt;, &lt;code&gt;Message&lt;/code&gt; used in Email&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Edit the alert behavior as needed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Grouping Id&lt;/code&gt; - This output groups other alerts into a single alert group.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Acknowledge Condition&lt;/code&gt; - The output should be &lt;code&gt;ok&lt;/code&gt;, &lt;code&gt;true&lt;/code&gt;, or &lt;code&gt;1&lt;/code&gt; to auto-acknowledge the alert group. For example, &lt;code&gt;{{ 1 if payload.state == &#39;OK&#39; else 0 }}&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Resolve Condition&lt;/code&gt; - The output should be &lt;code&gt;ok&lt;/code&gt;, &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;1&lt;/code&gt; to auto-resolve the alert group. For example, &lt;code&gt;{{ 1 if payload.state == &#39;OK&#39; else 0 }}&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Source Link&lt;/code&gt; - Used to customize the URL link to provide as the &amp;ldquo;source&amp;rdquo; of the alert.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;advanced-jinja-templates&#34;&gt;Advanced Jinja templates&lt;/h2&gt;
&lt;p&gt;Grafana OnCall uses &lt;a href=&#34;http://jinja.pocoo.org/docs/2.10/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Jinja templating language&lt;/a&gt; to format alert groups for the Web, Slack, phone calls, SMS messages, and more because the JSON format is not easily readable by humans. As a result, you can decide what you want to see when an alert group is triggered as well as how it should be presented.&lt;/p&gt;
&lt;p&gt;Jinja2 offers simple but multi-faceted functionality by using loops, conditions, functions, and more.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; Every alert from a monitoring system comes in the key/value format.
Grafana OnCall has rules about which of the keys match to: &lt;code&gt;__title&lt;/code&gt;, &lt;code&gt;message&lt;/code&gt;, &lt;code&gt;image&lt;/code&gt;, &lt;code&gt;grouping&lt;/code&gt;, and &lt;code&gt;auto-resolve__&lt;/code&gt;.&lt;/p&gt;&lt;/blockquote&gt;
&lt;h3 id=&#34;loops&#34;&gt;Loops&lt;/h3&gt;
&lt;p&gt;Monitoring systems can send an array of values. In this example, you can use Jinja to iterate and format the alert using a Grafana example:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;.jinja2&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-jinja2&#34;&gt;*Values:*
 {% for evalMatch in payload.evalMatches -%}
 `{{ evalMatch[&amp;#39;metric&amp;#39;] }}: &amp;#39;{{ evalMatch[&amp;#39;value&amp;#39;] -}}&amp;#39;`{{ &amp;#34; &amp;#34; }}
 {%- endfor %}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;conditions&#34;&gt;Conditions&lt;/h3&gt;
&lt;p&gt;You can add instructions if an alert comes from a specified Grafana alert rule:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;jinja2&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-jinja2&#34;&gt;{% if  payload.ruleId == &amp;#39;1&amp;#39; -%}
*Alert TODOs*
1. Get acess to the container
    ```
        kubectl port-forward service/example 3000:80
    ```
2. Check for the exception.
3. Open the container and reload caches.
4. Click Custom Button `Send to Jira`
{%- endif -%}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;built-in-jinja-functions&#34;&gt;Built-in Jinja functions&lt;/h3&gt;
&lt;p&gt;Jinja2 includes built-in functions that can also be used in Grafana OnCall. For example:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;.jinja2&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-jinja2&#34;&gt;{{ payload | tojson_pretty }}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Built-in functions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;abs&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;capitalize&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;trim&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;You can see the full list of Jinja built-in functions on github &lt;a href=&#34;https://github.com/pallets/jinja/blob/3915eb5c2a7e2e4d49ebdf0ecb167ea9c21c60b2/src/jinja2/filters.py#L1307&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;here&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;functions-added-by-grafana-oncall&#34;&gt;Functions added by Grafana OnCall&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;time&lt;/code&gt; - current time&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tojson_pretty&lt;/code&gt; - JSON prettified&lt;/li&gt;
&lt;li&gt;&lt;code&gt;iso8601_to_time&lt;/code&gt; - converts time from iso8601 (&lt;code&gt;2015-02-17T18:30:20.000Z&lt;/code&gt;) to datetime&lt;/li&gt;
&lt;li&gt;&lt;code&gt;datetimeformat&lt;/code&gt; - converts time from datetime to the given format (&lt;code&gt;%H:%M / %d-%m-%Y&lt;/code&gt; by default)&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="format-alerts-with-templates">Format alerts with templates&lt;/h1>
&lt;p>Grafana OnCall works with over one thousand alert monitoring systems. Almost any monitoring system can send alerts using webhooks with JSON payloads.&lt;/p></description></item><item><title>Send alert notifications by webhook</title><link>https://grafana.com/docs/oncall/v0.0.39/integrations/webhooks/configure-outgoing-webhooks/</link><pubDate>Tue, 11 Mar 2025 08:38:14 -0600</pubDate><guid>https://grafana.com/docs/oncall/v0.0.39/integrations/webhooks/configure-outgoing-webhooks/</guid><content><![CDATA[&lt;h1 id=&#34;send-alert-group-notifications-by-webhook&#34;&gt;Send alert group notifications by webhook&lt;/h1&gt;
&lt;p&gt;You can configure outgoing webhooks to send alerts to destination. Once a webhook is created, you can choose the webhook as a notification method in escalation steps.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;In Grafana OnCall, navigate to &lt;strong&gt;Outgoing Webhooks&lt;/strong&gt; and click &lt;strong&gt;&#43; Create&lt;/strong&gt;.
This is also the place to edit and delete existing webhooks.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Name your webhook and enter the destination URL.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If the destination requires authentication, enter your credentials.
You can enter a username and password (HTTP) or an authorization header formatted in JSON.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the webhook payload in the &lt;strong&gt;Data&lt;/strong&gt; field.
You can use four variables to automate the body of your webhook. The format you use to call the variables must match the structure of how the fields are nested in your alert payload. The &lt;strong&gt;Data&lt;/strong&gt; field can use the following four variables to auto-populate the webhook payload with information about the first alert in the alert group:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;{{ alert_title }}&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;{{ alert_message }}&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;{{ alert_url }}&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;{{ alert_payload }}&lt;/code&gt;
&lt;br&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;alert_payload&lt;/code&gt; is always the first level of any variable you want to call.&lt;/p&gt;
&lt;p&gt;The following is an example of an entry in the &lt;strong&gt;Data&lt;/strong&gt; field that might return an alert name and description.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
&amp;#34;name&amp;#34;: &amp;#34;{{ alert_payload.labels.alertname }}&amp;#34;,
&amp;#34;message&amp;#34;: &amp;#34;{{ alert_payload.annotations.description }}&amp;#34;
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; If you get an error message and cannot create a webhook, make sure your JSON is formatted correctly.&lt;/p&gt;&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Create Webhook&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
]]></content><description>&lt;h1 id="send-alert-group-notifications-by-webhook">Send alert group notifications by webhook&lt;/h1>
&lt;p>You can configure outgoing webhooks to send alerts to destination. Once a webhook is created, you can choose the webhook as a notification method in escalation steps.&lt;/p></description></item></channel></rss>