Skip to content

Webhooks

Webhooks send alert notifications to any HTTP endpoint. YipYap also recognizes webhook URLs from popular chat platforms and formats the message for them.

  1. Go to Settings > Channels and click Add Channel.
  2. Choose Webhook as the type and give the channel a name.
  3. Enter the destination URL.
  4. Check Payload Format. YipYap picks it from the URL (see Auto-detected platforms). Choose Generic (JSON) to get the YipYap payload described below.
  5. Optionally add Custom Headers (JSON), for example an Authorization header that your endpoint checks. See Authenticating requests.
  6. Click Create. YipYap creates a signing secret for the channel and shows it in a panel that asks you to copy it now. Copy it into your receiver before you close the panel.
  7. Click Test on the channel to send a test request.
  • The URL must start with http:// or https://. Use https:// so the payload and your headers are encrypted in transit.
  • On YipYap Cloud the host must resolve to a public address. A URL that points at a private, loopback, link-local or cloud metadata address is rejected when you save, with an error such as monitors cannot target private/internal IP addresses.
  • A self-hosted server follows the YIPYAP_ALLOW_PRIVATE_TARGETS setting. The open-source build allows private addresses by default, so it can reach services on your own network.
  • Enter the final URL of your endpoint. Do not rely on a redirect to reach it.

YipYap sends an HTTP POST each time an escalation step notifies the channel while an alert is firing. When the alert resolves, the channel gets one more request with status set to resolved. Acknowledging an alert does not send a request.

Expect more than one request for the same alert:

  • Each escalation step, repeat, and loop that targets the channel sends again.
  • A channel set on a step target gets one request per page of that step, however many people the step’s targets resolve to.

Each request has its own job_id and the same alert_id. Use alert_id to group or deduplicate requests for the same alert.

The resolve request uses the same payload with status set to resolved, message set to Resolved: and the monitor name, and the same alert_id, monitor_id and monitor_name as the alert’s earlier requests. ack_url is empty, since there is nothing left to acknowledge. Only a channel that was notified while the alert was firing gets one, once per alert.

With the Generic (JSON) format, the body is a JSON object with Content-Type: application/json:

{
"job_id": "2f6d1c9e-5b7a-4e0d-9c3f-8a1b2c3d4e5f",
"alert_id": "7c1e4b2a-9d3f-4a6e-8b5c-0f1e2d3c4b5a",
"org_id": "a3b4c5d6-e7f8-4a9b-8c0d-1e2f3a4b5c6d",
"monitor_id": "b1e2d3c4-5a6f-4b7c-8d9e-0f1a2b3c4d5e",
"monitor_name": "API Health",
"status": "firing",
"severity": "critical",
"message": "Alert: API Health is firing",
"ack_url": "https://console.yipyap.run/ack/eyJhbGciOi...",
"runbook_url": "https://wiki.example.com/runbooks/api",
"service_name": "Checkout API",
"context_links": [
{
"label": "Dashboard",
"url": "https://grafana.example.com/d/api?from=1764000000000",
"icon": "chart"
}
],
"dependency_status": [
{
"service_name": "Postgres",
"relationship": "calls",
"is_alerting": false
}
]
}
FieldTypeDescription
job_idstringUnique ID of this delivery. Differs on every request.
alert_idstringID of the alert. The same for every request about one alert.
org_idstringID of your organization.
monitor_idstringID of the monitor that raised the alert.
monitor_namestringName of the monitor that raised the alert.
statusstringAlert status when the notification was sent: firing, acknowledged or resolved.
severitystringcritical, warning or info.
messagestringShort human-readable summary, for example Alert: API Health is firing.
ack_urlstringSigned link that acknowledges the alert. Opening it shows a confirmation page; the button acknowledges without sign-in. Valid for 7 days or until the alert is resolved. Empty when the server has no public base URL. See the warning below.
runbook_urlstringThe service runbook, or the monitor runbook if the service has none. Omitted when neither is set.
service_namestringName of the service the monitor belongs to. Omitted when the monitor has no service.
context_linksarrayThe service’s context links with their URL templates filled in. Each item has label, url and an optional icon. Omitted when there are none.
dependency_statusarrayOne item per service dependency with service_name, relationship and is_alerting. Omitted when the service has no dependencies.

Use status to tell a firing alert from a repeat that reached the channel after someone acknowledged it, and from the final resolve request.

Clicking Test on a channel sends the same payload shape with monitor_name set to Test Notification, message set to This is a test notification from YipYap., severity set to info, status set to firing, alert_id and monitor_id that start with test-, and no service fields. If your endpoint opens tickets or pages people, skip requests whose alert_id starts with test-.

YipYap signs webhook requests with a secret that belongs to the channel. The signature proves the request came from YipYap and that the body was not changed in transit.

Every webhook channel gets a signing secret when you create it. YipYap shows it once, in a panel that asks you to copy it now, as a value that starts with whsec_. Copy it into your receiver’s secret store before you close the panel. It is not shown again, and no read endpoint returns it.

A channel created before signing existed, or imported with the bulk importer, starts unsigned. Open the channel, find Signing secret, and click Generate secret. The tag changes from Unsigned to Signed. To replace the secret later, click Rotate secret. The old secret stops working immediately, so update the receiver first or accept the gap.

Each signed request carries two headers:

X-YipYap-Timestamp: 1700000000
X-YipYap-Signature: v1=5a83cb255e788cae0f2a49cd57a05c6...

The signature is:

hex( HMAC-SHA256( key = secret, message = timestamp + "." + raw_body ) )
  • The key is the whole secret string, including the whsec_ prefix, as UTF-8 bytes.
  • timestamp is the X-YipYap-Timestamp value exactly as received, in Unix seconds.
  • raw_body is the request body byte for byte. Verify it before you parse the JSON, because re-serialising changes the bytes.

To verify a request:

  1. Read X-YipYap-Timestamp and reject the request if it is more than 5 minutes from your clock, in either direction. This is the replay window.
  2. Compute the expected signature from the timestamp and the raw body.
  3. Split X-YipYap-Signature on commas. Ignore entries whose scheme is not v1, and accept if any v1 value matches using a constant-time compare.

Custom headers set on the channel cannot replace the two signature headers.

secret = whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw
timestamp = 1700000000
body = {"alert_id":"a1","status":"firing"}
signature = v1=5a83cb255e788cae0f2a49cd57a05c6af26aac65684d6fef44edc0770a4ad895

Each example returns true only when the timestamp is inside the window and a v1 signature matches. Load the secret from your own secret store or an environment variable, not from source code.

verify_webhook.py
import hashlib
import hmac
import time
def is_from_yipyap(secret, timestamp, signature, body):
if abs(time.time() - int(timestamp)) > 300:
return False
expected = hmac.new(secret.encode(), timestamp.encode() + b"." + body,
hashlib.sha256).hexdigest()
for part in signature.split(","):
scheme, _, value = part.strip().partition("=")
if scheme == "v1" and hmac.compare_digest(value, expected):
return True
return False
verify-webhook.mjs
import { createHmac, timingSafeEqual } from 'node:crypto';
export function isFromYipYap(secret, timestamp, signature, rawBody) {
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;
const expected = createHmac('sha256', secret)
.update(`${timestamp}.`)
.update(rawBody)
.digest();
return signature.split(',').some((part) => {
const [scheme, value] = part.trim().split('=');
if (scheme !== 'v1' || !value) return false;
const got = Buffer.from(value, 'hex');
return got.length === expected.length && timingSafeEqual(got, expected);
});
}
verify.go
package webhook
import (
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
"math"
"strconv"
"strings"
"time"
)
func IsFromYipYap(secret, timestamp, signature string, body []byte) bool {
ts, err := strconv.ParseInt(timestamp, 10, 64)
if err != nil || math.Abs(time.Since(time.Unix(ts, 0)).Seconds()) > 300 {
return false
}
mac := hmac.New(sha256.New, []byte(secret))
mac.Write([]byte(timestamp + "."))
mac.Write(body)
want := mac.Sum(nil)
for _, part := range strings.Split(signature, ",") {
scheme, value, ok := strings.Cut(strings.TrimSpace(part), "=")
got, err := hex.DecodeString(value)
if ok && scheme == "v1" && err == nil && hmac.Equal(got, want) {
return true
}
}
return false
}

A person can also add a webhook as their own contact method. It sends the same Generic (JSON) payload. Its Signing secret field is optional and you choose the value. When it is set, every request carries the X-YipYap-Timestamp and X-YipYap-Signature headers described above, computed with that secret. When it is empty, requests are not signed. Like a channel’s secret, it is not shown again after you save. The URL of a personal webhook must resolve to a public address, on a self-hosted server too, unless the operator sets YIPYAP_ALLOW_PRIVATE_CONTROL_PLANE_TARGETS=true.

You can still add custom headers to a channel, for example an Authorization token that your endpoint checks. A custom header proves only that the sender knows the value. It does not prove the body is unchanged. Prefer the signature, and serve the endpoint over HTTPS so neither the secret nor the body can be read in transit.

If you use a shared secret in a custom header, compare it in constant time and reject the request with 401 when it does not match. Check the header before you parse the body.

After you save a webhook channel, YipYap does not show the custom header values or the full URL again, to anyone, including owners and admins. Settings > Channels and the API show the header names and the host of the URL only. Many webhook URLs (Slack, Discord, Teams) carry their own secret in the path, so they get the same treatment.

To change a header value or the URL, enter the new value and save. Keep a copy of the value in your own secret store, because you cannot read it back from YipYap. The signing secret is the same: only Signed or Unsigned is shown after the one-time reveal.

When you paste a URL from one of these platforms, YipYap sets Payload Format to match and sends a short text message in the platform’s format instead of the generic payload:

PlatformURL contains
Slackhooks.slack.com/
Discorddiscord.com/api/webhooks/ or discordapp.com/api/webhooks/
Microsoft Teamswebhook.office.com or .logic.azure.com
Google Chatchat.googleapis.com
Lark / Feishuopen.larksuite.com or open.feishu.cn
DingTalkoapi.dingtalk.com
Synology ChatSYNO.Chat.External

The message contains the severity, monitor name, message, and the service name and runbook link when they are set. You can override the detected format in Payload Format. Choosing Generic (JSON) turns detection off for that channel.

  • YipYap waits up to 30 seconds for a response.
  • Any status code of 300 or above, a timeout, or a connection error counts as a failure.
  • A failed request is retried up to 4 more times (5 attempts in total), waiting 1, 2, 4 and 8 seconds between attempts.

Make your endpoint return a 2xx status quickly and do any slow work after responding.

SymptomWhat to check
Saving the channel fails with monitors cannot target private/internal IP addressesThe host resolves to a private address. See Destination URL.
Test fails with a status codeYour endpoint answered with 300 or above. A 401 or 403 usually means the custom header does not match the value your endpoint expects.
Test fails with a timeout or connection errorThe endpoint took longer than 30 seconds, or YipYap cannot reach it. On YipYap Cloud the endpoint must be reachable from the public internet.
A chat platform shows raw JSONPayload Format is set to Generic (JSON). Pick the platform’s format instead.
The same alert arrives several timesExpected. See When YipYap sends a request and deduplicate on alert_id.