Callback
When the video state changes, a JSON callback will be sent back to your URL as a POST request. Below is an example object that will be sent.Status list
Below are the possible status codes sent with the webhook:- 0 - Queued: The video has been queued for encoding.
- 1 - Processing: The video has begun processing the preview and format details.
- 2 - Encoding: The video is encoding.
- 3 - Finished: The video encoding has finished and the video is fully available.
- 4 - Resolution finished: The encoder has finished processing one of the resolutions. The first request also signals that the video is now playable.
- 5 - Failed: The video encoding failed. The video has finished processing.
- 6 - PresignedUploadStarted : A pre-signed upload has been initiated.
- 7 - PresignedUploadFinished : A pre-signed upload has been completed.
- 8 - PresignedUploadFailed : A pre-signed upload has failed.
- 9 - CaptionsGenerated : Automatic captions were generated.
- 10 - TitleOrDescriptionGenerated : Automatic generation of title or description has been completed.
Signature validation
Verify that an incoming webhook request was sent by Bunny Stream and has not been tampered with.Overview
Signed webhook POSTs use signature versionv1. Each signed request includes the following headers:
| Header | Value |
|---|---|
X-BunnyStream-Signature-Version | v1 |
X-BunnyStream-Signature-Algorithm | hmac-sha256 |
X-BunnyStream-Signature | Lowercase hex HMAC-SHA256 (64 characters) |
How the signature is built
- body: The exact raw HTTP request body bytes as received.
- signatureSecret: Your library’s Read-Only API key, encoded as UTF-8.
- Output: 64-character lowercase hexadecimal string.
- The URL, timestamp, HTTP method, and headers are not part of the
v1signature.
Validation steps
Read the raw request body
Capture the raw body from the HTTP request stream before any parsing. Do not parse to JSON and re-serialize.
Compute the expected signature
expectedSignature = lowercase_hex(HMAC-SHA256(rawBody, signatureSecret))Code examples
Important notes
- Constant-time comparison: Use
timingSafeEqual,hmac.compare_digest, orCryptographicOperations.FixedTimeEqualsso comparison time does not leak information about the secret. - Signing secret: Use your library’s Read-Only API key as the signing secret. Keep it server-side only; never expose it to the client.
- Version & algorithm headers: Always validate both
X-BunnyStream-Signature-VersionandX-BunnyStream-Signature-Algorithmbefore computing the signature.