DocsApps and developers
Verify requests
Every command, button press and event Kinnlo sends is signed with the app’s signing secret. Check it before you act.
On this page
| Header | Holds |
|---|---|
X-Kinnlo-Timestamp | When it was sent, in Unix seconds |
X-Kinnlo-Signature | v1= and the signature |
The signature is an HMAC-SHA256, in lowercase hex, of v1:, the timestamp, : and the raw body, keyed with the whole signing secret.
Read the body exactly as it arrived
Before any JSON parsing: a body parsed and written out again will not match.
Refuse old requests
Refuse a timestamp more than five minutes from your clock, so a captured request can’t be sent again later.
Compare in constant time
Compute
v1=+ HMAC-SHA256 ofv1:<timestamp>:<body>and compare it with the header.
import {createHmac, timingSafeEqual} from 'node:crypto';
/** True when rawBody, exactly as received, was signed with the app's signing secret. */
export function verify(rawBody: string, timestamp: string | null, signature: string | null, secret: string) {
if (!timestamp || !signature || !/^\d{1,12}$/.test(timestamp)) return false;
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;
const mac = createHmac('sha256', secret).update(`v1:${timestamp}:${rawBody}`).digest('hex');
const expected = Buffer.from(`v1=${mac}`);
const given = Buffer.from(signature.trim());
return expected.length === given.length && timingSafeEqual(expected, given);
}The signing secret
It is shown once, when the app is made. Make a new secret on Events and buttons shows a new one, and the old one stops working at once: update your server straight away.
Retries
An event that fails is tried again after 1 minute, 5 minutes, 30 minutes and 2 hours, then marked failed. A failure is any answer outside 2xx, a redirect, no answer in time, or an answer over 64 KB.
Deliveries
The app’s Deliveries tab lists the last 50 events sent to it: Delivered, Sending, Retrying with its next try, or Failed, with what your server answered. Refresh reloads the list.