Skip to content
Videokr Start free

Webhooks and API keys

Webhooks deliver play, complete, cta_click and lead events to any HTTPS endpoint as JSON, signed with HMAC-SHA256 in an x-videokr-signature header so you can verify the payload. API keys authenticate read access to your account, library and insights — that is how the WordPress plugin connects.

Webhooks

Add an endpoint under Integrations, choose which events it receives, and Videokr POSTs JSON to it. A test delivery button proves the endpoint before a real lead depends on it, and the last status and error are shown so a silently broken endpoint does not stay broken.

Events:

Verifying a delivery

Each request carries x-videokr-signature: the hex HMAC-SHA256 of the exact request body, keyed with the endpoint's secret. Compare it against your own computation on the raw body before trusting the payload.

const expected = crypto.createHmac('sha256', secret).update(rawBody).digest('hex');
if (!crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(header))) return res.sendStatus(401);

Verify the raw body, not a re-serialised object — re-encoding JSON changes the bytes and breaks the signature.

API keys

Create a key under Integrations. Send it as Authorization: Bearer vk_... to the /api/v1 endpoints, which return your account and plan usage, your video and playlist library, insights and leads. Keys are read-only, shown once, and revocable — revoking a key cuts off whatever was using it immediately, including a WordPress site.

Keep keys server-side. A key pasted into front-end JavaScript is a public key.

Rate and scope

One key per integration is the sane pattern: it means you can revoke the WordPress site without breaking your internal dashboard. Keys are scoped to your account and cannot read another account's data.

Frequently asked questions

How do I verify a webhook is really from Videokr?

Recompute HMAC-SHA256 of the raw request body with the endpoint secret and compare it to the x-videokr-signature header using a timing-safe comparison.

Are API keys read-only?

Yes. They authenticate reads of your account, library, insights and leads — they cannot change or delete anything.