For developers
Webhook receiver guide
Receive PODFY events on your own server and check that every request is genuine: signature, retries and code samples.
What a webhook is here
A webhook is a request that PODFY sends to your server when something happens: a proof of delivery or a report arrives, a work status changes, or a refund is approved. You do not have to poll the API. Every request is signed, so your server can check that it really comes from PODFY and was not changed on the way.
This page explains how to receive webhooks. The events and the format of the body are listed in the reference below, in English like the API reference. The REST API is described in the API reference.
Set up and test a webhook
A brand admin adds a webhook in the portal under Settings → Integrations → Webhooks (Add webhook). Enter the HTTPS address of your receiver and choose the events. The secret PODFY signs with is shown once, so store it in your secrets manager. With New secret you create a new one: the old secret keeps working for 24 hours, so you can switch your receiver without missing a request.
Send test sends a webhook.test event with the real headers and signature to your address, so you can test your verification before real events arrive. The delivery log in the portal shows the response code of every attempt, and Resend sends a delivery again.
If you have no receiver yet, ask PODFY support for a test inbox address. It accepts the signed requests and shows what arrived. A webhook receives either production records or only test records from qa.podfy.app, depending on its QA setting.
Where PODFY sends
PODFY only sends to HTTPS addresses with a public host name on port 443. IP addresses, addresses with a user name or password, hosts of PODFY itself and hosts under workers.dev or pages.dev are refused when you save the webhook. PODFY does not follow redirects, so enter the final address.
A webhook can also use GET with its own query string (custom payload). The signature then covers the full URL, see the reference.
Reference
Receiving webhooks
The reference below is in English in every language, like the API reference.
Events
A webhook subscribes to the events it lists, or to all standard events with *. * never matches the refund events: list refund.approved and refund.updated by name.
| Event | Sent when | Notes |
|---|---|---|
pod.created | A new record of a brand in delivery mode (a proof of delivery was uploaded). | |
report.created | A new record of a brand in report mode (a QR report was submitted). | |
record.status_changed | The work status of a record changed (portal, bulk change or API). | Adds change. |
record.updated | Another field of a record changed: assignee, priority or duplicate_of. One event per changed field. A comment alone sends nothing. | Adds change. |
webhook.test | A brand admin pressed Send test in the portal. | A sample or the latest record, with the real headers and signature. |
refund.approved | A refund request was approved. PODFY records and forwards the request; it never pays out. | Only when the webhook lists it by name. Adds record.refund. |
refund.updated | A refund was rejected, or its payout result (paid or failed) was recorded through the API. | Only when the webhook lists it by name. Adds record.refund. |
The request
PODFY sends a signed request to your URL for every event (POST with a JSON body, or GET for a custom webhook).
| Header | Value |
|---|---|
Podfy-Signature | t=<unix seconds>,v1=<hex>,v2=<hex>. See Verify the signature. |
Podfy-Delivery | Unique delivery id (dlv_…). Identical on every retry of the same delivery. |
Podfy-Event | The event name, as in the body. |
Content-Type | application/json for the standard payload. A custom webhook sends the content type you chose. |
User-Agent | PODFY-Webhooks/1.0 |
The payload
This is the standard body. A custom webhook sends the body you built from the template.
| Field | Type | Description |
|---|---|---|
id | string | Event id (evt_…). Use it as an idempotency key. |
version | integer | Payload format version, 1. Bumped only for a breaking change; new fields do not bump it. |
event | string | One of the events above. |
created_at | string | ISO 8601 time of the event. |
brand | string | The brand slug. |
record | object | The record: podfy_id, mode, reference, asset, category, priority, work_status, note, fields, group_id, files, location, duplicate_of, url and updated_at (time of the last change of the record). |
change | object | Only on record.status_changed and record.updated: {field, from, to}. |
record.refund | object | Only on refund.approved and refund.updated: {id, amount, currency, pay_ref, status, decided_at, result}. Use refund.id as your idempotency key. The approver's e-mail is never included. |
Example: report.created
{
"id": "evt_5d1e8a07b3c94f2a61d0e7f8",
"version": 1,
"event": "report.created",
"created_at": "2026-11-16T09:24:00Z",
"brand": "acme",
"record": {
"podfy_id": "PFY-7Q4K2-1",
"mode": "report",
"reference": "COFFEE-1",
"asset": {
"name": "Coffee machine",
"location": "Floor 2",
"group": "B"
},
"category": "NOT_WORKING",
"priority": "high",
"work_status": "new",
"note": "Makes a grinding noise",
"fields": {
"floor": "2"
},
"group_id": "PFY-7Q4K2",
"files": [
{
"name": "photo.jpg",
"url": "https://portal.podfy.net/api/public/pod/3f9a0c1d2e4b5a69/file"
}
],
"location": null,
"duplicate_of": null,
"url": "https://portal.podfy.net/pod/3f9a0c1d2e4b5a69",
"updated_at": "2026-11-16T09:24:00Z"
}
}
Verify the signature
Check every request before you trust it. You need the secret of the webhook, the Podfy-Signature and Podfy-Delivery headers and the raw request body.
- Split
Podfy-Signatureat the commas. Taketand everyv1andv2value. - Reject the request when
tis more than 5 minutes (300 seconds) away from your clock. - Compute
v2= HMAC-SHA256 (hex) with your secret oft + "." + delivery id + "." + raw body, where the delivery id is thePodfy-Deliveryheader. This is recommended: it also binds the delivery id, so a captured request cannot be replayed under another one. v1= HMAC-SHA256 (hex) oft + "." + raw body. It stays valid and is what you check when you do not use the delivery id.- Compare your value with the received one in constant time. Accept the request when any received pair matches (during a rotation there are two pairs).
- Answer with a 2xx status. A request that fails verification should get a 4xx and no further processing.
Sign the raw bytes. Parsing the JSON and serialising it again changes spacing and key order, and the signature will not match. A GET webhook has no body: the signed content is the full request URL as sent, including the query string.
Worked example
Secret, delivery id and body below are an example you can run your code against. The body is the exact string that was signed. Every character counts, so use the raw bytes you receive.
| Part | Value |
|---|---|
| Secret | whsec_0123456789abcdef0123456789abcdef0123456789abcdef |
t | 1795000000 |
Podfy-Delivery | dlv_3f9a0c1d2e4b5a69c0de |
Body
{"id":"evt_5d1e8a07b3c94f2a61d0e7f8","version":1,"event":"report.created","created_at":"2026-11-16T09:24:00Z","brand":"acme","record":{"podfy_id":"PFY-7Q4K2-1","mode":"report","reference":"COFFEE-1","asset":{"name":"Coffee machine","location":"Floor 2","group":"B"},"category":"NOT_WORKING","priority":"high","work_status":"new","note":"Makes a grinding noise","fields":{"floor":"2"},"group_id":"PFY-7Q4K2","files":[{"name":"photo.jpg","url":"https://portal.podfy.net/api/public/pod/3f9a0c1d2e4b5a69/file"}],"location":null,"duplicate_of":null,"url":"https://portal.podfy.net/pod/3f9a0c1d2e4b5a69","updated_at":"2026-11-16T09:24:00Z"}}Podfy-Signature
t=1795000000,v1=7a4613e656dc09602ed02650fc2439d25640c0e0af5e7964446ac850feb81a0d,v2=32cb0d5cef76e5d988b540c71b54aea8047766be7cc9eb761a950c0deab398a9With a rotation in progress the header holds a second v1/v2 pair made with the previous secret, for example t=…,v1=A,v2=A,v1=B,v2=B.
Code samples
Both samples use only the standard library of the language. They check the timestamp, compare in constant time, prefer v2 when the delivery id is available and accept any matching pair.
Node.js: verify.js
const crypto = require("node:crypto");
// rawBody: the request body exactly as received (Buffer), never re-serialised JSON.
// For a GET webhook pass the full request URL instead of a body.
function verifyPodfyWebhook(secret, signatureHeader, deliveryId, rawBody, nowSeconds = Math.floor(Date.now() / 1000)) {
let t = null;
const v1 = [];
const v2 = [];
for (const part of String(signatureHeader || "").split(",")) {
const i = part.indexOf("=");
if (i < 1) continue;
const key = part.slice(0, i).trim();
const value = part.slice(i + 1).trim();
if (key === "t") t = value;
else if (key === "v1") v1.push(value);
else if (key === "v2") v2.push(value);
}
const timestamp = Number(t);
if (!t || !Number.isFinite(timestamp)) return false;
if (Math.abs(nowSeconds - timestamp) > 300) return false; // older (or newer) than 5 minutes
const body = Buffer.isBuffer(rawBody) ? rawBody : Buffer.from(String(rawBody), "utf8");
const sign = (prefix) =>
crypto.createHmac("sha256", secret).update(prefix).update(body).digest("hex");
const equal = (a, b) =>
a.length === b.length && crypto.timingSafeEqual(Buffer.from(a), Buffer.from(b));
// v2 also binds the delivery id (recommended). During a secret rotation the header holds two pairs:
// accept the request when any of them matches.
if (deliveryId && v2.length) {
const expected = sign(`${t}.${deliveryId}.`);
return v2.some((candidate) => equal(expected, candidate));
}
const expected = sign(`${t}.`);
return v1.some((candidate) => equal(expected, candidate));
}
module.exports = { verifyPodfyWebhook };
Node.js: a receiver
const http = require("node:http");
const { verifyPodfyWebhook } = require("./verify");
const secret = process.env.PODFY_WEBHOOK_SECRET;
const seen = new Set(); // use a database or cache with an expiry in production
http.createServer((req, res) => {
const chunks = [];
req.on("data", (chunk) => chunks.push(chunk));
req.on("end", () => {
const rawBody = Buffer.concat(chunks);
const ok = verifyPodfyWebhook(secret, req.headers["podfy-signature"], req.headers["podfy-delivery"], rawBody);
if (!ok) { res.writeHead(400).end(); return; }
res.writeHead(200).end("ok"); // answer within 10 seconds, then process
const event = JSON.parse(rawBody.toString("utf8"));
if (seen.has(event.id)) return; // a retry of an event you already handled
seen.add(event.id);
console.log(event.event, event.record.podfy_id);
});
}).listen(3000);
Python: verify.py
import hashlib
import hmac
import time
def verify_podfy_webhook(secret, signature_header, delivery_id, raw_body, now=None):
"""raw_body: the request body as bytes, exactly as received (for a GET webhook: the full URL as bytes)."""
t, v1, v2 = None, [], []
for part in (signature_header or "").split(","):
key, _, value = part.strip().partition("=")
if key == "t":
t = value
elif key == "v1":
v1.append(value)
elif key == "v2":
v2.append(value)
try:
timestamp = int(t)
except (TypeError, ValueError):
return False
if abs((time.time() if now is None else now) - timestamp) > 300: # older (or newer) than 5 minutes
return False
def sign(prefix):
return hmac.new(secret.encode(), prefix.encode() + raw_body, hashlib.sha256).hexdigest()
# v2 also binds the delivery id (recommended). During a secret rotation the header holds two pairs:
# accept the request when any of them matches.
if delivery_id and v2:
expected, candidates = sign(f"{t}.{delivery_id}."), v2
else:
expected, candidates = sign(f"{t}."), v1
return any(hmac.compare_digest(expected, c) for c in candidates)
Python: a receiver
from http.server import BaseHTTPRequestHandler, HTTPServer
import json
import os
SECRET = os.environ["PODFY_WEBHOOK_SECRET"]
seen = set() # use a database or cache with an expiry in production
class Handler(BaseHTTPRequestHandler):
def do_POST(self):
raw_body = self.rfile.read(int(self.headers.get("Content-Length", 0)))
ok = verify_podfy_webhook(SECRET, self.headers.get("Podfy-Signature"), self.headers.get("Podfy-Delivery"), raw_body)
self.send_response(200 if ok else 400)
self.end_headers()
if not ok:
return
event = json.loads(raw_body) # answered first in real code: queue the work
if event["id"] in seen: # a retry of an event you already handled
return
seen.add(event["id"])
print(event["event"], event["record"]["podfy_id"])
HTTPServer(("", 3000), Handler).serve_forever()
Secret rotation
When a brand admin creates a new secret (New secret in the portal), the previous secret stays valid for 24 hours. During that time every request carries a second v1/v2 pair signed with the previous secret. Accept the request when any pair matches: a receiver that still has the old secret and one that already has the new secret both verify. After 24 hours only the new secret signs.
Delivery, retries and idempotency
- Answer with any 2xx status within 10 seconds. Anything else, a timeout or a network error counts as a failure. Redirects are not followed. Answer first and process afterwards.
- A failed delivery is tried again after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 12 hours. After that it is marked
failed. A delivery that stayspendingis put back in the queue automatically. The delivery log in the portal shows every attempt, and Resend sends a delivery again by hand. - A delivery can arrive more than once (a retry after a timeout, or a resend). Treat the event
id(and thePodfy-Deliveryheader) as the idempotency key: store the ids you handled and ignore a repeat. For refunds userecord.refund.id. - Events of one record can arrive out of order. Use
record.updated_atto ignore an older event. - Receivers must tolerate new fields. New fields are added without a new
version; only a breaking change raisesversion. - A webhook with a custom payload sends your own body and content type. The headers and the signature are the same, and the signature covers the body as sent.
Allowed targets
- HTTPS only, on port 443, with a public host name. No IP addresses, no user name or password in the URL, no
podfy.apporpodfy.nethosts (except a PODFY test inbox address), noworkers.devorpages.dev, no local or internal host names. - The address is checked when you save the webhook. Variables of a custom payload are allowed in the query string and the body only, never in the scheme, host or path.