Webhooks
When an agent calls one of your flow functions, Talkif makes an HTTPS request to the URL you configured. Anything that takes action on such a request — creates a booking, updates a record — needs to know the request really came from Talkif and wasn’t altered in transit. Talkif signs each one; the signature travels in the Talkif-Signature header, and verifying it takes a dozen lines in any language.
Signing is per account and opt-in: requests are signed once you’ve created a signing secret. Until then they’re sent unsigned — fine for a prototype, not for anything that acts.
What your endpoint receives
Respond quickly: the caller is waiting in silence. A 2xx–3xx status is a success; the JSON body (or {"raw": "…"} for non-JSON) goes back to the model.
Get your signing secret
- Go to Developer → Credentials → Webhook signing.
- Click Create signing secret.
- Copy the secret. It’s shown once — it can’t be retrieved later.
The secret looks like whsec_ followed by 43 URL-safe characters (49 characters total).
Use the secret exactly as shown, including the whsec_ prefix, as the raw HMAC key. Do not strip the prefix and do not base64-decode it. Some providers (e.g. Svix) base64-decode the part after whsec_ — Talkif does not. A verifier that decodes the secret will fail every check.
The signature header
How the signature is computed
{t}is the timestamp from the header.{body}is the exact raw bytes of the request body as received — do not parse and re-serialize it (key order and whitespace must match byte-for-byte).secretis your fullwhsec_…value, used verbatim as the UTF-8 HMAC key.
Verifying a request
- Read the
Talkif-Signatureheader and parse outtand everyv1. - (Recommended) Reject the request if
tis too old — this limits replay. A 5-minute tolerance is typical. - Compute
HMAC_SHA256(secret, "{t}.{rawBody}")as lowercase hex. - Compare it against each
v1with a constant-time comparison. Accept if any matches.
Node.js
Python
Verify against the raw body bytes, not a re-encoded copy. Frameworks that auto-parse JSON and hand you a re-serialized string will change key order or spacing and break the signature. Capture the raw body before parsing.
Empty-body requests
For requests with no body — non-body methods (GET, HEAD) or a body that is an empty object {} — Talkif sends no body and signs over an empty body. The signed payload is "{t}." (the timestamp, a dot, then nothing), not "{t}.{}". The verifiers above handle this automatically when the raw body is an empty string/bytes.
Rotating the secret
Rotating issues a new secret while keeping the old one valid for an overlap window, so in-flight integrations don’t break.
- In Developer → Credentials → Webhook signing, click Rotate.
- Copy the new secret and deploy it to your endpoint.
During the overlap, Talkif signs each request with both secrets and includes a v1 for each:
Because a correct verifier accepts the request if any v1 matches, both your old and newly deployed code keep working until the window closes. After it closes, only the new secret is sent.