Webhooks
Send Wardn's release, approval and drift events to your own systems as signed HTTP posts, check the signature, and what happens when the receiver is down.
An outbound webhook is an address you give Wardn. When something happens that the endpoint subscribes to, Wardn posts a small JSON document to it, signed so the receiver knows it came from Wardn. Use it to start a chat bot, update a status page, open a ticket or feed your own dashboards.
Webhooks only tell your systems what happened. They never decide anything: a release, an approval or a deployment never waits for a receiver, and a receiver that is down cannot hold up the outbox that carries Wardn's other work. A post that cannot be delivered is tried again on a schedule and then marked failed, where you can see it and send it again.
The events
| Event | Sent when | data |
|---|---|---|
release.started | A release begins to run (from waiting, scheduled or held; resuming a paused release is not a start) | releaseId, number, status, previous |
release.finished | A release completes, fails or is cancelled | releaseId, number, status (completed, failed or cancelled), previous, note when there is one |
approval.requested | A rollout is waiting for approval | requestId, deploymentId, snapshotId, action, requestedBy |
drift.detected | A report found a deployment's cluster no longer matches what Wardn applied | deploymentId, driftCount, sync, health, snapshotId |
webhook.test | You pressed Send a test. Never subscribed to | message |
An endpoint takes the events you choose, at least one. Data only ever gains fields; a type is never renamed.
Every post has the same envelope:
{
"version": 1,
"id": "evt_060708090a0b0c0d0e0f",
"type": "release.finished",
"createdAt": "2026-01-02T10:53:00Z",
"orgId": "org_…",
"data": { "releaseId": "…", "number": 42, "status": "failed", "previous": "running", "note": "wave 2 failed its checks" }
}id is the event's id, the same for every endpoint and every try. version is the envelope's version.
Add an endpoint
You need integration:manage (Owners and Admins) and a server with WARDN_SECRET_MASTER_KEY set, because Wardn keeps each endpoint's signing secret in its secret store. In the web app open Settings › Integrations › Webhooks › Add endpoint, or:
curl -fsS -X POST "$WARDN_API_URL/api/v1/outbound-webhooks" \
-H "Authorization: Bearer $WARDN_TOKEN" -H 'Content-Type: application/json' \
-d '{"name":"deploy-events","url":"https://hooks.example.com/wardn/deploys","events":["release.started","release.finished"]}'The answer holds the endpoint and, once, its secret (whsec_ and 64 hex characters). Copy it then: Wardn keeps it only to sign with, and shows only its last four characters afterwards. Rotate makes a new one and shows it once; the old one stops signing at once, and the next try of every post still waiting is signed with the new one. An organization has at most 20 endpoints.
The address must be https://, with no user name, password or fragment. It is checked again at every post:
- Wardn never connects to loopback, link-local or cloud metadata addresses, and not to private ones either when the install sets
WARDN_CONNECTIONS_BLOCK_PRIVATE_ADDRESSES(a hosted or multi-tenant install must set it, and so must any install whose organizations do not share its network: without it an endpoint can be aimed at the private addresses of the network Wardn runs on; thewardn-scalechart sets it by default). The check is made on the address a name resolves to, at the moment of connecting, on every try, so a name that is pointed at an internal address after you added it is refused. - A failed post is told in one sentence. Whether the address is refused, the name does not resolve, the connection is refused, the certificate fails, or the receiver answers with an error, the Test result and the delivery log say only "Wardn could not deliver to that address", and a status code is shown only for a post the receiver accepted. Otherwise an address you typed could be used to probe what is on Wardn's network. The cause is in the server log, for whoever runs the install.
- Redirects are not followed. A
301,302,307or308is an answer, and counts as a failure: give Wardn the address the receiver answers at. - No proxy from the environment is used, no connection is kept between posts, a post is cut off after 10 seconds, and only the first 64 KiB of an answer is read and none of it is kept.
WARDN_CONNECTIONS_ALLOW_INSECURE_HTTP=truepermitshttp://addresses, for development only. Loopback stays refused even then, so point a development endpoint at a tunnel or another machine.
What a post looks like
POST /wardn/deploys HTTP/1.1
Content-Type: application/json
User-Agent: Wardn-Webhooks
Wardn-Event: release.finished
Wardn-Delivery: dlv_8c1f4a2b09de
Wardn-Signature: t=1767351180,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bdWardn-Deliveryis the delivery's id. It is the same on every try of one delivery (and when you send a failed one again), so a receiver can keep the ids it has handled and ignore a repeat. Delivery is at least once.Wardn-Signatureist=<unix seconds>,v1=<hex>. The value is the HMAC-SHA256 of"<t>.<raw body>"under the endpoint's signing secret. Each try is signed afresh with the time of that try, so a post made 30 minutes into a retry schedule is as fresh as the first.
Check the signature
Verify against the raw bytes of the body, before parsing it, compare in constant time, and refuse a timestamp more than 5 minutes from your clock: that is what makes a copied post useless to replay. A header may carry several v1= values; accept the post if any matches.
func verify(secret string, header string, body []byte) bool {
var ts string
var sigs []string
for _, p := range strings.Split(header, ",") {
if k, v, ok := strings.Cut(strings.TrimSpace(p), "="); ok {
if k == "t" { ts = v } else if k == "v1" { sigs = append(sigs, v) }
}
}
sec, err := strconv.ParseInt(ts, 10, 64)
if err != nil || math.Abs(float64(time.Now().Unix()-sec)) > 300 {
return false
}
m := hmac.New(sha256.New, []byte(secret))
m.Write([]byte(ts + "."))
m.Write(body)
want := m.Sum(nil)
for _, s := range sigs {
if got, err := hex.DecodeString(s); err == nil && hmac.Equal(got, want) {
return true
}
}
return false
}import { createHmac, timingSafeEqual } from "node:crypto";
export function verify(secret, header, rawBody) {
const parts = header.split(",").map((p) => p.trim().split("="));
const ts = parts.find(([k]) => k === "t")?.[1];
const sigs = parts.filter(([k]) => k === "v1").map(([, v]) => v);
if (!ts || Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false;
const want = createHmac("sha256", secret).update(`${ts}.`).update(rawBody).digest();
return sigs.some((s) => {
const got = Buffer.from(s, "hex");
return got.length === want.length && timingSafeEqual(got, want);
});
}import hashlib, hmac, time
def verify(secret: str, header: str, raw_body: bytes) -> bool:
parts = [p.strip().split("=", 1) for p in header.split(",")]
ts = next((v for k, v in parts if k == "t"), None)
sigs = [v for k, v in parts if k == "v1"]
if ts is None or abs(time.time() - int(ts)) > 300:
return False
want = hmac.new(secret.encode(), f"{ts}.".encode() + raw_body, hashlib.sha256).hexdigest()
return any(hmac.compare_digest(s, want) for s in sigs)Answer with any 2xx as soon as you have the event; do the work afterwards.
Retries
| Answer | What happens |
|---|---|
2xx | Delivered |
410 Gone | Failed at once: the receiver says the address is retired |
| An address Wardn may not connect to | Failed at once; trying again would only repeat it |
429, 5xx, any other status, a redirect, a refused or timed-out connection | Tried again |
A delivery gets 5 tries over 30 minutes: at once, then after 1, 5, 15 and 30 minutes counted from the first. After the fifth it is marked failed and is not tried again. A delivery for a paused endpoint waits, using no tries, until it is resumed. A sender that was down catches up without posting twice in a breath (at least 10 seconds apart).
On the endpoint's page, Recent deliveries shows each one: 200 · 120ms, Retried · 200 on 3rd try, Failed · 503 after 5 tries. A failed delivery has Send again, which starts it afresh with its five tries under the same delivery id. Deliveries are kept for 30 days; each try is also a line in the Integrations delivery log. Deleting an endpoint removes its history from the page; the Activity entry stays.
Send a test posts a webhook.test event now, once, even to a paused endpoint, and says what came back. It is kept with the deliveries and never retried.
Pause, change and delete
Pause stops posts to the endpoint. Events that happen while it is paused are dropped for it, not kept. Adding or changing an endpoint (name, address, events, pause), rotating the secret, sending a test and deleting an endpoint are each an Activity entry that names the endpoint and the host of its address, never the secret and never the path or query of the address. Deliveries themselves are not Activity: they are churn, and live in the endpoint's history.
API
All of it needs integration:manage. Webhooks are under /outbound-webhooks (the /webhooks/… paths are Wardn's inbound receivers).
| Request | |
|---|---|
GET /outbound-webhooks | The endpoints, and the events an endpoint can take |
POST /outbound-webhooks | Add one; returns secret once |
GET, PATCH, DELETE /outbound-webhooks/{endpointId} | Read, change (name, url, events, paused) or delete |
POST /outbound-webhooks/{endpointId}/rotate | New signing secret, returned once |
POST /outbound-webhooks/{endpointId}/test | Post a test now |
GET /outbound-webhooks/{endpointId}/deliveries | Newest first, ?status=pending|delivered|failed, with total |
POST /outbound-webhooks/{endpointId}/deliveries/{deliveryId}/redeliveries | Send a failed delivery again |
What is tested, and against what
Signing, the retry schedule, event selection, once-only deliveries, tenant isolation and the guard on addresses are tested against a real Postgres. Posts are tested against in-process HTTP servers (errors, 5xx then success, 410, timeouts, redirects, refused addresses and a name that resolves to loopback). Not tested against a real receiver on the internet, and no test reaches a real DNS rebinding service: the rebinding defence is tested with a name that resolves to loopback, which is refused after it is resolved.
PagerDuty
Mirror PagerDuty incidents as Wardn incidents, map services to deployments, let "Platform on-call" mean whoever PagerDuty has on call right now, and what happens when PagerDuty is down.
Opsgenie
Open and close Wardn incidents from Opsgenie alerts, say which tags and priorities count, fill on-call groups from Opsgenie schedules, optionally open an alert when Wardn opens an incident, and what happens when Opsgenie is down.