VideohatiDocs
API reference

Events

Webhook event names, the delivery envelope, and signature verification.

Register an endpoint under Webhooks and Videohati sends an HTTP POST to it each time one of the MVP events fires. You receive these deliveries — you never call the delivery endpoint yourself. For the end-to-end setup — registering an endpoint, verifying signatures, and handling retries in your own server — see the webhooks guide.

Event names

EventFires when
video.upload.completedA multipart upload finished and the source object landed in storage.
video.encoding.readyEncoding finished; the video can be played.
video.encoding.failedEncoding failed for the video.
video.deletedA video was soft-deleted.
playback.startedA playback session began playing.
playback.completedA playback session reached the end of the video.
payment.succeededA payment for the account succeeded.
payment.failedA payment for the account failed.

Envelope

Every delivery body is a JSON object with this shape:

{
  "id": "01JZ9WV3N8GQ5T2M7K4C6XBARM",
  "type": "video.encoding.ready",
  "created_at": "2026-06-11T11:00:00.000Z",
  "project_id": "01JZ9WV3N8GQ5T2M7K4C6XBARF",
  "data": {
    "videoId": "01JZ9WV3N8GQ5T2M7K4C6XBARH"
  }
}
  • id — ULID of this event. Use it to deduplicate retries.
  • type — one of the event names above.
  • created_at — ISO-8601 timestamp.
  • project_id — the project the event belongs to.
  • data — event-specific payload.

Signature verification

Each delivery carries the header:

Videohati-Signature: t=<unix_ts>,v1=<hex_sha256>

The HMAC-SHA256 covers the string <unix_ts>.<raw_body> using the endpoint's signing secret (returned once at registration or rotation). To verify:

  1. Read t and v1 from the header.
  2. Reject if t is too old (a 5-minute tolerance keeps replays out).
  3. Compute HMAC_SHA256(secret, t + "." + rawBody) as lowercase hex.
  4. Compare against v1 with a constant-time comparison.

The official SDKs ship a webhooks.verify helper that does all four steps. Always verify against the raw request body — not a re-serialized object.

Acknowledging a delivery

Return any 2xx within 10 seconds to acknowledge. Non-2xx responses (or timeouts) are retried on the delivery schedule.