Test Notification Channel
Delivers one sample notification to a single, not-yet-saved channel and reports the synchronous pass/fail inline — the "Send test" button on the alert authoring form. Use it to confirm a webhook / Slack / Discord URL or email address actually receives a notification before arming a rule. The channel is validated with the same rules Create Alert enforces on save, then delivered synchronously.
Delivery reuses the exact payload shapes the alert worker produces, so a passing test exercises the real wire contract: webhooks receive a JSON body (HMAC-SHA256-signed as X-Ngris-Signature when a secret is supplied), Slack receives {"text": ...}, Discord receives {"content": ...}, and email is sent via the deployment's SMTP sender. Webhook / Slack / Discord URLs are POSTed through an SSRF-safe client, so internal, loopback, and link-local addresses are rejected.
Unlike the per-rule Test Alert route (which stamps an async test on an existing rule), this endpoint takes an unsaved channel and returns an immediate result.
Plan-gated: requires the traffic-inspector write permission AND the metric_alerts entitlement (403 without either).
Request body
email, webhook, slack, discord. Any other value returns sent: false with an "unsupported channel type" message.email target must contain @; webhook target must be an https:// URL; slack target is a Slack Incoming Webhook URL (https://hooks.slack.com/...); discord target is a Discord webhook URL (https://discord.com/api/webhooks/...). Leading/trailing whitespace is trimmed.X-Ngris-Signature — letting a verifying receiver pass the test exactly as a real fire. Ignored for slack/discord/email.Response (200 OK)
A delivery outcome — both success and a failed delivery return HTTP 200; the transport succeeded, only the delivery may not have. A transport-level failure (e.g. SSRF block, connection error, non-2xx/3xx from the endpoint) is reported as sent: false with the reason in error.
true if the sample notification was delivered successfully (any 2xx/3xx for webhook/slack/discord; SMTP accepted for email).sent is false. Human-readable reason, e.g. a validation message, an SSRF/connection failure, or "endpoint returned HTTP 500: ...".Errors
sent: false, not a 400.)metric_alerts.