Skip to content

Outbound Webhook Notifications

Webhook integrations send an HTTP GET, POST, or PUT request to your endpoint when a check changes state. Use them to trigger runbooks, open or close tickets, forward JSON to internal APIs, or connect tools with custom schemas.

Separate Down and Up Requests

Each webhook integration has two sections in Integrations > Webhook:

  • Execute when a check goes down: runs once when an armed check misses its schedule plus grace time, or receives a failure signal.
  • Execute when a check goes up: runs once when a down check receives a recovery ping.

Either URL can be left blank. Leave the up URL empty if you want alerts on failures only. At least one URL is required when saving the integration.

Supported Placeholders

Watchgoose replaces these placeholders in webhook URLs, request headers, and POST or PUT bodies when the alert fires:

Placeholder Where it works Value
$CODE URL, headers, body Check UUID (5bf66975-...).
$NAME URL, headers, body Plain check name (URL-encoded when used in the URL).
$NAME_JSON Body Check name encoded as a complete JSON string, including surrounding double quotes.
$SLUG URL, headers, body URL-friendly check slug.
$STATUS URL, headers, body New check status: down or up.
$NOW URL, headers, body UTC ISO 8601 timestamp of the status change (2026-12-04T02:05:12+00:00).
$TAGS URL, headers, body Space-separated tags on the check.
$TAG1, $TAG2, ... URL, headers, body Individual tags by position ($TAG1 is first, $TAG2 second).
$EXITSTATUS URL, headers, body Exit code (0 to 255) from the last ping, or -1 if none was reported.
$BODY POST / PUT body only Raw UTF-8 body from the last ping (empty if none).
$BODY_JSON POST / PUT body only $BODY encoded as a complete JSON string, including quotes and escaped newlines.
$JSON URL, headers, body Full check JSON object, matching Get a Single Check in the Management API.

Quote $NAME_JSON, $BODY_JSON, and $JSON Safely

Check names and log bodies often contain quotes, backslashes, or newlines. Putting raw $NAME or $BODY inside JSON quotes can break the payload:

{"check": "$NAME", "log": "$BODY"}

Use $NAME_JSON, $BODY_JSON, and $JSON without extra quotes around them:

{
  "event_time": "$NOW",
  "status": "$STATUS",
  "name": $NAME_JSON,
  "slug": "$SLUG",
  "exit_status": $EXITSTATUS,
  "last_log": $BODY_JSON,
  "check": $JSON
}

If a check named Nightly "billing" sync fails with multiline stderr, Watchgoose still sends valid JSON.

Custom Request Headers

Enter optional HTTP headers in Request Headers, one Header-Name: value pair per line:

Content-Type: application/json
Authorization: Bearer whsec_replace_with_your_token
X-Check-Slug: $SLUG

Include Content-Type: application/json whenever you send a JSON body. Watchgoose does not set a JSON content type automatically on custom bodies. Header names must use ASCII or Latin-1 characters; non-Latin-1 characters expanded in header values are encoded as XML character references.

Timeouts, Retries, and Delivery Rules

  • HTTP 200, 201, 202, and 204 responses received within 30 seconds count as delivered. Any other status or timeout counts as failed.
  • Failed live webhook alerts retry up to 2 more times (3 attempts in total). Clicking Test! on the Integrations page sends a single attempt with retries turned off.
  • Each URL, body, header name, and header value can be up to 1,000 characters long before placeholder expansion.
  • Watchgoose does not follow 301, 302, 307, or 308 redirects. Point the webhook directly at the final HTTPS URL.
  • Webhook URLs must resolve to public IP addresses. Private, loopback, and link-local ranges (127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16) and Watchgoose's own hostnames (watchgoose.com, watchgoose.com) are blocked.

Examples

Post JSON to an internal incident endpoint

  • Method (down and up): POST
  • URL: https://ops.example.com/webhooks/watchgoose
  • Request Headers: http Content-Type: application/json X-Webhook-Token: replace-with-shared-secret
  • Request Body: json {"code": "$CODE", "name": $NAME_JSON, "status": "$STATUS", "tags": "$TAGS", "exit_status": $EXITSTATUS, "log": $BODY_JSON}

Use $TAG1 in a dynamic URL path

If you put the owning team first in a check's tags (such as payments prod), $TAG1 expands to payments and URL-encodes it:

  • Method: POST
  • URL: https://ops.example.com/teams/$TAG1/cron-events?status=$STATUS

For built-in chat and paging channels, see PagerDuty, Opsgenie, and On-Call Integrations, Configuring Notifications, and the setup guides for Slack, Microsoft Teams, Discord, and ntfy, Gotify, and Pushover.