Grafana alerting webhook to your phone

Updated December 2, 2026

Grafana Alerting's built-in Webhook contact point posts JSON with a top-level message field, and NextMsg ignores extra JSON keys while reading ?channel=grafana from the URL. That means Grafana connects straight to your phone with zero middleware.

Create a dedicated send key in NextMsg first: Settings → Send keys → Add send key → Copy a key (name it e.g. Grafana).

1. Add a Webhook contact point (direct)

  1. In Grafana, go to Alerting → Contact points → Add contact point.
  2. Name it NextMsg and set Integration to Webhook.
  3. Fill in the fields:
    • URL: https://api.nextmsg.app/v1/send?channel=grafana
    • HTTP Method: POST
    • Authorization Header — Scheme: Bearer
    • Authorization Header — Credentials: nextmsg_live_your_key_here (Grafana masks this value after saving)
    • Max Alerts: 2 (keeps the webhook body under NextMsg's 16 KiB limit and the rendered message concise)
  4. Click Test to send a test notification to #grafana, then click Save contact point.
  5. Assign NextMsg to your default or custom route under Alerting → Notification policies.

2. Format crisp alerts (and Provisioning YAML)

Grafana's default webhook message can be wordy when several labels are present. To keep every alert readable on a lock screen and safely under 640 characters, create a notification template under Alerting → Contact points → Notification Templates → Add notification template:

{{ define "nextmsg.message" -}}
**{{ .Status | toUpper }}** ({{ len .Alerts }} alert{{ if gt (len .Alerts) 1 }}s{{ end }})
{{- range .Alerts }}
- {{ .Labels.alertname }}{{ with .Annotations.summary }}: {{ . }}{{ end }}
{{- end }}
{{- end }}

Then open your NextMsg contact point, expand Optional Webhook settings, and set Message to {{ template "nextmsg.message" . }}.

If you manage Grafana via provisioning files or GitOps, the same contact point looks like this:

apiVersion: 1
contactPoints:
  - orgId: 1
    name: NextMsg
    receivers:
      - uid: nextmsg-grafana
        type: webhook
        settings:
          url: https://api.nextmsg.app/v1/send?channel=grafana
          httpMethod: POST
          authorization_scheme: Bearer
          authorization_credentials: ${NEXTMSG_KEY}
          maxAlerts: 2
          message: '{{ template "nextmsg.message" . }}'

3. Large alert groups (optional Cloudflare Worker relay)

If a single alert policy routinely fires 10 or more alerts together, Grafana's raw webhook envelope can exceed 16 KiB even before templating. Point Grafana's Webhook URL at a tiny Cloudflare Worker that condenses the batch into a single ≤ 640-character push:

export default {
  async fetch(req: Request, env: { NEXTMSG_KEY: string; WEBHOOK_SECRET: string }) {
    if (req.method !== "POST") return new Response("Method not allowed", { status: 405 });
    if (req.headers.get("Authorization") !== `Bearer ${env.WEBHOOK_SECRET}`) {
      return new Response("Unauthorized", { status: 401 });
    }

    const body = await req.json<{
      status?: string;
      alerts?: Array<{ labels?: Record<string, string>; annotations?: Record<string, string> }>;
    }>();

    const alerts = body.alerts ?? [];
    const lines = alerts.slice(0, 5).map((a) => {
      const name = a.labels?.alertname ?? "Alert";
      const summary = a.annotations?.summary ? `: ${a.annotations.summary}` : "";
      return `- ${name}${summary}`;
    });
    const extra = alerts.length > 5 ? `\n(+${alerts.length - 5} more)` : "";
    const message = `**Grafana ${(body.status ?? "alert").toUpperCase()}** (${alerts.length})\n${lines.join("\n")}${extra}`.slice(0, 640);

    const res = await fetch("https://api.nextmsg.app/v1/send", {
      method: "POST",
      headers: {
        Authorization: `Bearer ${env.NEXTMSG_KEY}`,
        "Content-Type": "application/json"
      },
      body: JSON.stringify({ channel: "grafana", message })
    });
    return new Response(res.ok ? "ok" : "error", { status: res.status });
  }
};

Keeping notifications calm

  • Split channels by severity: create two contact points using the same key — ?channel=grafana for warnings and ?channel=critical for high-severity production alerts.
  • Mute noisy recoveries: check Disable resolved message on non-critical contact points so transient spikes don't ping you twice.
  • Group alerts sensibly: keep Grafana's default group_wait (30s) and repeat_interval (4h+) so one bad deploy doesn't turn into dozens of pushes.

More guides