Skip to content

Webhooks

The platform signs the deliveries it sends to your endpoints and the scheduled-job firings it sends to your application. WebhookSignature verifies them before you trust the request. The algorithm and headers are in delivery and webhook signatures; the concepts are in delivery, and the how-to is receive webhooks.

The signature is hex(HMAC-SHA256(secret, timestamp + rawBody)) in X-FlowCatalyst-Signature, beside the X-FlowCatalyst-Timestamp it covers. The secret is the signing secret of the service account that signs: the subscription’s connection for a delivery, the owning application for a firing.

There are two forms of the same check. Use check where you want to branch, verify where your framework turns an exception into a 401.

// Throws WebhookSignatureException on any failure.
WebhookSignature.verify(rawBodyBytes,
request.header("X-FlowCatalyst-Signature"),
request.header("X-FlowCatalyst-Timestamp"),
signingSecret);
// Returns a result; no exception.
switch (WebhookSignature.check(rawBodyBytes, signature, timestamp, signingSecret)) {
case WebhookSignature.Valid v -> handle(rawBodyBytes);
case WebhookSignature.Invalid i -> reject(401, i.code()); // i.message() is for logs
}

The body must be the raw bytes as received. Do not parse and re-serialise it first: key order and spacing would change the bytes and break the signature. Verify first, then parse.

Both forms take optional arguments for a longer form: check(rawBody, signature, timestamp, secret, toleranceSeconds, expectedBearerToken, authorization).

Check Detail
Secret An empty or null secret is MISSING_SECRET, never a bypass: the check fails closed.
Headers An empty or null signature is MISSING_SIGNATURE; an empty or null timestamp is MISSING_TIMESTAMP.
Timestamp ISO 8601 with milliseconds (2026-08-07T09:32:12.123Z) as the platform sends it; a bare Unix-seconds integer is accepted too. Anything else is INVALID_TIMESTAMP.
Replay window Older than the tolerance (default DEFAULT_TOLERANCE_SECONDS, 300) is TIMESTAMP_EXPIRED. More than 60 seconds in the future is TIMESTAMP_IN_FUTURE (check clock sync).
Signature Recomputed over the raw timestamp header string plus the raw body, and compared in constant time, ignoring the case of the hex. A mismatch is INVALID_SIGNATURE.
Bearer (optional) If you pass expectedBearerToken, the Authorization header must be exactly Bearer <token>: MISSING_BEARER or INVALID_BEARER otherwise.

The bearer gate runs after the signature and is added to it, never a substitute: the signature is the real proof, because it binds the secret to this body at this time.

WebhookSignature.ErrorCode is MISSING_SECRET, MISSING_SIGNATURE, MISSING_TIMESTAMP, INVALID_TIMESTAMP, TIMESTAMP_EXPIRED, TIMESTAMP_IN_FUTURE, INVALID_SIGNATURE, MISSING_BEARER and INVALID_BEARER. WebhookSignatureException.code() and Invalid.code() carry it. A suggested mapping:

Codes Status
MISSING_SIGNATURE, MISSING_TIMESTAMP, INVALID_TIMESTAMP 400
TIMESTAMP_EXPIRED, TIMESTAMP_IN_FUTURE, MISSING_BEARER, INVALID_BEARER 401
INVALID_SIGNATURE 401 or 403
MISSING_SECRET 500: your configuration is wrong

WebhookSignature.hmacHex(secret, timestamp, body) computes the signature with the same algorithm, for tests or for signing outbound requests that must verify the same way.

  • Duplicates. The window limits replay but does not remove it, and the platform delivers at least once. Key your handling on the delivery’s job id.
  • The answer. The Java SDK has no type for the mediation response (ack, notBefore, delaySeconds). Return 2xx to acknowledge; the shapes that defer a delivery are in delivery.
  • A scheduled-job runner. The Java SDK verifies a firing’s signature but does not run the job or report completion. Receive the firing, verify it, run your work, and report with client.scheduledJobs().logForInstance(...) and completeInstance(...). See scheduled jobs. The Go and TypeScript SDKs have a runner.