Delivery and webhook signatures
A delivery is an HTTP POST from the platform to your endpoint. When the sending service account has
a signing secret the request is signed, so you can prove it came from the platform and was not
altered or replayed. This page is the exact algorithm. For the concepts (envelopes, retries,
acknowledgement) see Delivery; for a how-to see Receive deliveries and verify signatures.
Headers on a delivery
Section titled “Headers on a delivery”| Header | Value |
|---|---|
X-FlowCatalyst-Signature |
Lower-case hex of HMAC-SHA256(secret, timestamp + body), 64 characters. (The router writes it upper-case, X-FLOWCATALYST-SIGNATURE; header names are case-insensitive.) |
X-FlowCatalyst-Timestamp |
UTC time of signing, ISO 8601 with millisecond precision: 2026-05-24T08:30:00.123Z. |
Authorization |
Bearer <token>, when the signing account has a webhook bearer token. |
Content-Type |
application/json for an envelope. For a data-only delivery, the job’s own payload content type (application/json when it has none). |
X-Dispatch-Job-Id |
The dispatch job id. Sent on deliveries made by the platform’s dispatch-processing callback. |
X-Event-Type |
The dispatch job’s code (the event type for an event-raised job). Same deliveries. |
X-FlowCatalyst-Client |
{clientId}:{clientCode}, naming the tenant a multi-tenant endpoint is receiving a delivery for. Sent for every delivery whose job has a client that resolves to an identifier, including data-only deliveries. Omitted entirely (never half a pair) for platform-scoped jobs. It does not change what is signed. |
Scheduled-job firings and function webhooks are signed the same way.
Two details differ from the rest of the API: the timestamp has millisecond (not microsecond) precision, and it is an ISO string, not Unix seconds. A bare Unix-seconds value is still accepted by the SDK verifiers for backward compatibility.
The algorithm
Section titled “The algorithm”signing string = timestamp_header_value + raw_body_bytessignature = lower_hex( HMAC_SHA256( key = signing_secret, message = signing string ) )- The
timestampis the header value as a string, used byte for byte. No separator, no re-formatting. - The
bodyis the raw bytes received on the wire. The sender signs the bytes it sends and never re-serialises, so the JSON library on either side cannot change the result. Verify before you parse: read the raw body, check the signature, then decode JSON. A body that has been parsed and re-encoded will not verify. - For the router’s mediation call the body is
{"messageId":"<id>"}. For the dispatch-processing callback it is the delivery body: the envelope, or the raw payload when the subscription isdataOnly. The signature covers the body only; headers (includingX-FlowCatalyst-Client) are not signed. - Compare in constant time. Hex is compared case-insensitively by the SDKs.
Replay window
Section titled “Replay window”A verifier should also reject stale and future-dated deliveries, parsing the timestamp to whole seconds:
| Check | Default |
|---|---|
| Older than the tolerance | Reject. Tolerance 300 s (5 minutes). |
| More than 60 s in the future | Reject (clock skew allowance). |
Retries are re-signed with a fresh timestamp, so a legitimate retry always falls inside the window.
The Go Verifier applies one symmetric skew (default 5 minutes) instead of the 300 s / 60 s pair; the
Validator in the same package uses 300 s past and 60 s future like the other SDKs.
Which secret
Section titled “Which secret”The signing secret belongs to the service account that signs the delivery: the subscription’s own
account if it names one, else its connection’s account, else the application’s oldest active service
account (for a direct dispatch job, the application named by the job code). The first of these that
names an account decides, with no fall-through. If the named account is inactive or has no webhook
credentials, the delivery goes out unsigned and the reason is recorded on the attempt
((delivered unsigned: ...)); it is never signed by a different account. Treat an unsigned delivery
as untrusted. See Subscriptions and connections.
Test vectors
Section titled “Test vectors”All SDK verifiers are held to these. Secret, timestamp and body are exact strings; the signature is the expected output.
| Secret | Timestamp | Body | Signature |
|---|---|---|---|
secret |
2026-08-07T09:32:12.123Z |
hello |
a7d62aade7a79e88792f84e035b72788a3c78a30f46ad265ec8d6fb12a4e9f91 |
test-secret-do-not-use-in-prod |
2026-05-24T08:30:00.123Z |
{"messageId":"msg_TEST123456"} |
0278cfb47ccbf20a2356584cca6e076cbade089ccc961dbe553f0e768cbf9059 |
s3crét |
1786095132 (Unix seconds) |
{"name":"Zoë","emoji":"✓"} (UTF-8) |
b059d3518989f4f1fa649fe7295432f389337d7ade30f185684d013e1c07a3ca |
The timestamp in a vector is far outside any replay window; test the signature function directly, or inject a clock, rather than the full verifier. See also Conformance vectors.
Verification code
Section titled “Verification code”Every SDK ships a verifier. Pass the raw body and the two header values.
import "github.com/flowcatalyst/go-sdk/webhook"
verifier := webhook.NewVerifier(os.Getenv("FLOWCATALYST_SIGNING_SECRET"))
func handle(w http.ResponseWriter, r *http.Request) { body, err := io.ReadAll(r.Body) // raw bytes, before any JSON decoding if err != nil { http.Error(w, "bad request", http.StatusBadRequest) return } err = verifier.Verify(body, r.Header.Get(webhook.SignatureHeader), // X-FLOWCATALYST-SIGNATURE r.Header.Get(webhook.TimestampHeader)) // X-FLOWCATALYST-TIMESTAMP if err != nil { // webhook.ErrMissingSignature, ErrMissingTimestamp, ErrBadTimestamp, // ErrStaleTimestamp, ErrBadSignature http.Error(w, "invalid signature", http.StatusUnauthorized) return } // parse and handle body}webhook.NewValidator(secret, opts...) (or ValidatorFromEnv(), reading FLOWCATALYST_SIGNING_SECRET)
is the equivalent with a Validate(signature, timestamp, payload) method, WithTolerance and
WithClock options, and a ComputeSignature method for tests.
import io.flowcatalyst.sdk.webhook.WebhookSignature;import io.flowcatalyst.sdk.webhook.WebhookSignature.Invalid;import io.flowcatalyst.sdk.webhook.WebhookSignature.Verification;
byte[] rawBody = request.body(); // the bytes, not a parsed objectVerification result = WebhookSignature.check( rawBody, request.header("X-FlowCatalyst-Signature"), request.header("X-FlowCatalyst-Timestamp"), System.getenv("FLOWCATALYST_SIGNING_SECRET"));
if (result instanceof Invalid invalid) { // invalid.code(): MISSING_SIGNATURE, TIMESTAMP_EXPIRED, INVALID_SIGNATURE, ... return Response.status(401).build();}WebhookSignature.verify(...) is the throwing form (WebhookSignatureException with the same
code()). The longer overloads take a tolerance in seconds and an optional bearer token with the
Authorization header value.
import { verifyDeliverySignature, WebhookSignatureError } from "@flowcatalyst/sdk";
// rawBody: string | Uint8Array, exactly as received (not JSON.parse'd and re-stringified)try { verifyDeliverySignature({ rawBody, signature: req.headers["x-flowcatalyst-signature"], timestamp: req.headers["x-flowcatalyst-timestamp"], secret: process.env.FLOWCATALYST_SIGNING_SECRET!, // toleranceSeconds: 300, // expectedBearerToken, authorization: optional second gate, AND-ed with the signature });} catch (err) { if (err instanceof WebhookSignatureError) { // err.code: "missing_signature" | "timestamp_expired" | "invalid_signature" | ... return res.status(401).end(); } throw err;}use FlowCatalyst\Webhook\WebhookValidator;use FlowCatalyst\Exceptions\WebhookValidationException;
$validator = new WebhookValidator(config('flowcatalyst.signing_secret'));
try { $validator->validate( payload: $request->getContent(), // raw body signature: $request->header('X-FlowCatalyst-Signature'), timestamp: $request->header('X-FlowCatalyst-Timestamp'), tolerance: 300, );} catch (WebhookValidationException $e) { return response()->json(['error' => $e->getMessage()], 401);}In a Laravel app, route middleware does this for you:
Route::post('/webhooks/flowcatalyst', ...)->middleware('flowcatalyst.webhook');. It validates
the request with the configured flowcatalyst.signing_secret and, when flowcatalyst.webhook_auth_token
is set, also requires the Authorization: Bearer token.
The Rust SDK is not yet released; this is its API on main.
use flowcatalyst_sdk::webhook::WebhookVerifier;
let verifier = WebhookVerifier::from_env()?; // FLOWCATALYST_SIGNING_SECRET// or WebhookVerifier::new("secret").with_tolerance(300).with_bearer_token("...")
match verifier.verify( &raw_body, headers.get("x-flowcatalyst-signature").and_then(|v| v.to_str().ok()), headers.get("x-flowcatalyst-timestamp").and_then(|v| v.to_str().ok()),) { Ok(()) => { /* handle */ } Err(e) => { /* e.code(): "INVALID_SIGNATURE", ... ; answer 401 */ }}webhook::sign(secret, timestamp, body) computes the expected signature for tests.
If you do not use an SDK, the check is a few lines in any language:
import hashlib, hmac, timefrom datetime import datetime
def verify(secret: bytes, body: bytes, signature: str, timestamp: str) -> bool: sent = datetime.fromisoformat(timestamp.replace("Z", "+00:00")).timestamp() if sent < time.time() - 300 or sent > time.time() + 60: return False expected = hmac.new(secret, timestamp.encode() + body, hashlib.sha256).hexdigest() return hmac.compare_digest(expected, signature.lower())Mediation response
Section titled “Mediation response”A target answers a delivery with a 2xx and an optional JSON body. An absent or unparseable body on a 2xx is plain success.
| Field | Type | Meaning |
|---|---|---|
ack |
boolean | false means “not delivered; requeue with backoff”. Default true. |
delaySeconds |
integer | With ack:false, the minimum requeue delay. With flushGroup, the suppression window. |
notBefore |
string (RFC 3339) | With ack:false, the instant to redeliver at or after. Takes precedence over delaySeconds when it parses; an unparseable value is ignored. Send both for older routers. |
flushGroup |
boolean | true means delivered, and stop delivering the rest of this message’s group for delaySeconds (default 60, capped at 5 minutes). Only safe when the target already owns the records the messages point at. ack:false wins over it. |
A target can also end retries for good by answering 422 with the header FlowCatalyst-Outcome: reject; the attempt’s job then fails at once instead of spending its remaining retries.
A 429 response’s Retry-After header (delay-seconds or an HTTP date) is honoured as a delay without
spending a retry. See Delivery for the retry curve.
Other signing sites
Section titled “Other signing sites”Other uses of HMAC in the platform sign plain strings (for example the dispatch-job auth token signs the raw job id), and the rest are not HMAC at all (JWT RS256, Argon2id password hashes, AES-GCM at rest). None of them sign serialised JSON.