Agent skill

Bunny Stream Webhooks Skill

Receive and verify Bunny Stream webhooks. Use when setting up Bunny Stream webhook handlers, debugging X-BunnyStream-Signature verification, or handling video encoding events like Status 3 (Finished / encoding done), Status 5 (Failed), or captions and title/description generation.

Install this skill

npx skills add hookdeck/webhook-skills --skill bunny-stream-webhooks


When to Use This Skill

  • Setting up Bunny Stream webhook handlers
  • How do I verify Bunny Stream webhook signatures?
  • Debugging X-BunnyStream-Signature verification failures
  • Handling video state changes (encoding finished, encoding failed)
  • Reacting to Status 3 (Finished), Status 5 (Failed), captions, or title/description events

Verification (core)

Bunny Stream signs the exact raw request body with HMAC-SHA256, keyed on your video library's Read-Only API key, and sends the digest as lowercase hex in the X-BunnyStream-Signature header. Verify against the unparsed raw body (do NOT re-serialize the JSON — whitespace or key-order changes break the digest) and compare timing-safe.

This is a custom scheme, not Standard Webhooks (no webhook-id / webhook-timestamp / webhook-signature). Bunny's own steps also check that X-BunnyStream-Signature-Version is v1 and X-BunnyStream-Signature-Algorithm is hmac-sha256 before computing the digest. There is no official SDK, so verify manually.

Node:

const crypto = require('crypto');

function verifyBunnyStream(rawBody, signatureHeader, secret) {
  if (!signatureHeader) return false;
  const expected = crypto.createHmac('sha256', secret).update(rawBody).digest('hex');
  try {
    return crypto.timingSafeEqual(
      Buffer.from(signatureHeader, 'hex'),
      Buffer.from(expected, 'hex')
    );
  } catch {
    return false; // malformed hex / length mismatch
  }
}

Python:

import hmac, hashlib

def verify_bunny_stream(raw_body: bytes, signature_header: str, secret: str) -> bool:
    if not signature_header:
        return False
    expected = hmac.new(secret.encode(), raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(signature_header, expected)

For complete handlers with route wiring, event dispatch, and tests, see:

The Payload Is Thin — Fetch Back

The callback body identifies the video and the event, and nothing more (Bunny's documented example):

{
  "IsLiveStreamWebhook": false,
  "VideoLibraryId": 133,
  "VideoGuid": "657bb740-a71b-4529-a012-528021c31a92",
  "Status": 3,
  "EventId": "0f8e2c52-6a3e-4c1f-9d55-2b8c4f6c2a10",
  "Timestamp": "2026-10-01T12:30:15.1234567Z"
}

EventId is unique per event and stays the same on retries, so deduplicate on it. Timestamp is when the event happened (UTC); deliveries can arrive out of order, so compare it before updating state. Reason is added for SmartGenerationFailed and left out otherwise. Ignore fields you don't know: Bunny added the last four to an existing payload.

There is no title, duration, or resolution in the payload. When you need full metadata, call the Stream API GET /library/{libraryId}/videos/{videoGuid} with the library's read-write API key, using VideoGuid from the webhook. Verify the signature before making any fetch-back call.

Status Codes (the event type lives in Status)

StatusMeaningCommon Use
0QueuedUpload accepted, awaiting processing
1ProcessingIngest started
2EncodingTranscoding in progress
3FinishedEncoding done — video ready to play
4Resolution finishedOne resolution finished; sent once per resolution, the first means playable
5FailedEncoding failed — alert / retry
6PresignedUploadStartedTUS/presigned upload began
7PresignedUploadFinishedPresigned upload completed
8PresignedUploadFailedPresigned upload failed
9CaptionsGeneratedAuto-captions ready
10TitleOrDescriptionGeneratedAI title/description ready
11CaptionGenerationFailedAuto-captions failed
12ChaptersGeneratedAI chapters ready
13MomentsGeneratedAI moments ready
32VideoDeletedVideo deleted (once per video, including collection deletes)
33SmartGenerationFailedA smart feature failed; Reason is Title, Description, Chapters or Moments

Switch on the numeric Status, not the name, as Bunny advises.

For the full event reference, see Bunny Stream Webhooks.

Important Headers

HeaderDescription
X-BunnyStream-SignatureHMAC-SHA256 of the raw body, lowercase hex — verify this
X-BunnyStream-Signature-VersionSignature scheme version, v1
X-BunnyStream-Signature-AlgorithmAlgorithm identifier, hmac-sha256

Retries

Any 2xx acknowledges a delivery. A network error, timeout, 408, 429 or 5xx is retried after 30 seconds, 2 minutes, 10 minutes, 30 minutes, 1 hour and 2 hours, then dropped (about four hours after the event). Other 4xx responses are not retried. Retries resend the same body and are signed with the library's current Read-Only API key.

Environment Variables

# The signing secret IS your video library's Read-Only API key
BUNNY_STREAM_WEBHOOK_SECRET=your_library_read_only_api_key

Local Development

# Start tunnel (no account needed)
npx hookdeck-cli listen 3000 bunny-stream --path /webhooks/bunny-stream

Reference Materials


Repository

hookdeck/webhook-skills

v0.1.0 · MIT · Updated Aug 5, 2026

View on GitHub →