Callbacks
Pass callback_url (https, public) with the quote and the create call, and the video is POSTed to you when it completes, fails or is cancelled.
Delivery
| Body | The video, exactly as GET /videos/{id} returns it |
| Headers | Kinetune-Event (video.completed, video.failed, video.cancelled) · Kinetune-Delivery (unique id) · Kinetune-Signature |
| Retries | Any 2xx within 10 seconds counts. Otherwise it retries after 30 s, 2 min, 10 min, 30 min and 2 h. |
| Signing secret | On the API page in the app (whsec_…); rotate it there. |
The callback is described in the API reference as A video is finished.
Verify the signature
import { createHmac, timingSafeEqual } from "node:crypto";
// header: "t=1760000000,v1=5f2c…" body: the raw request body
export function verified(header, body, secret) {
const { t, v1 } = Object.fromEntries(header.split(",").map(p => p.split("=")));
if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false; // replay window
const expected = createHmac("sha256", secret).update(`${t}.${body}`).digest("hex");
return v1?.length === expected.length && timingSafeEqual(Buffer.from(v1), Buffer.from(expected));
}