Skip to main content
For collections that use Bunny Stream, the plugin injects a hidden group field named bunnyData that holds stream metadata for each document.

Shape

For a video, the API returns:
For non-video documents in the same collection, bunnyData is omitted from the response.
  • videoId Stored — stored and indexed. An update that does not send bunnyData.stream.videoId, for example a REST PATCH with only alt, keeps the stored video, its status and its resolutions.
  • status Stored — stored and indexed. The encoding state of the video: processing, ready or failed. When you save a document with a new video, after an upload or when you replace the video, the plugin asks Bunny for the current state and stores it. Right after an upload, this is usually processing. The webhook, the media preview status check and status sync update it. With stream.status: false the field does not exist. It is read-only: create and update requests cannot set it. Documents uploaded before this field existed have no status until status sync or the preview checks them. The stored value is the last known state, not a live one: the status endpoint is authoritative.
  • type and libraryId Computed — computed on read from your plugin options, not stored in the database.
  • resolutions Stored — available lists the MP4 renditions Bunny reports (unordered); highest is the highest of them when the plugin stores them. The MP4 fallback checks that its file exists before it serves it, and stores a lower rendition that exists when it does not. Because Bunny encodes renditions asynchronously, highest can be lower than the top of available until the higher rendition finishes. A save that sets a new video clears the resolutions of the old video (null) until the new ones are known.
When the plugin writes the state, it writes bunnyData.stream as a whole object (videoId, status and resolutions), because MongoDB replaces the whole nested object on update. These writes go straight to the database. They do not run your collection hooks, do not create versions and do not change the document’s updatedAt. While stream.status or mp4Fallback is on, when you save a document in a collection with drafts, the plugin copies the stored status and resolutions from the main document, or from the version with the video when only a draft has it, so an older version does not bring back an old state. When you restore a version with stream.status on, the plugin asks Bunny for the current state of the restored video and stores it. If Bunny does not answer, the restore keeps the stored state of the main document when the video is the same, and the state of the version otherwise. When the main document has the video, the webhook and the status check change only the main document, not its versions. So a read with draft: true, the version history and the _<slug>_v table can show an older state than the main document until the next save. With status sync on, a run copies the state of the main document into its latest version when that version has the same video and has no state, or is processing and was saved in the last maxAge seconds. A video that only a draft has, for example after a draft save over a published document, gets its state in the latest version that has it. The webhook, the status check and status sync write it there. They change only bunnyData.stream of that version and keep its other fields and its updatedAt. The list view shows the main document, so it shows the state of the published video until you publish the draft. A save in the admin can race a webhook or status sync write to the same document. The save then can store processing again over a ready state that was written a moment earlier. The next preview status check or status sync run stores the right state again. A video or Storage file stays in Bunny while the document, a draft or a version references it. Draft saves, publishing and deletes follow this rule, so a video or file that only a draft has is also deleted when no document and no version references it any more. Payload 4 turns versions on by default. With versions: false on the collection, the old video or file is deleted when you replace it, as before. See Files, versions and rename and Replaced videos and versions. A webhook can also arrive before the document exists in the database. See When the webhook arrives before the document for what covers this case.

Database columns

On Postgres, SQLite and D1, bunnyData.stream is stored in these columns of each Stream collection’s table: A collection with versions also has version_bunny_data_stream_video_id, version_bunny_data_stream_status and version_bunny_data_stream_resolutions in its _<slug>_v table. Check your migration for this table: in our tests Payload 4 also created it for upload collections without versions. Image variants do not store a status. Payload shortens long index names, so the index names in your migration can differ from the column names.

Reset a stored status

A video that Bunny no longer has is stored as failed. The plugin does this only when the same library still answers, so an expired API key or a Bunny outage does not mark your videos as failed. If a video shows failed by mistake, for example after you restored it in Bunny, set the status back to processing. The next status check, preview or status sync run then asks Bunny again:
Write the whole bunnyData.stream object, because MongoDB replaces it as a whole. The Local API (payload.update) cannot change the status: when you save a document that keeps its video, the plugin puts the stored status back.
Encoding is asynchronousresolutions only appears on the field when stream.mp4Fallback is enabled. It stays empty until Bunny finishes encoding the video and calls your webhook — encoding happens asynchronously, so it won’t be present right after upload. With stream.status on, the plugin also stores resolutions at save time, and when the preview status check or status sync stores ready, but only if Bunny has already finished encoding the video at that moment. Otherwise the webhook or the first MP4 fallback request fills them.

Querying

Because videoId is stored, you can query it directly:

Bunny Stream status in the admin

Stream collections get a read-only field named bunnyStream. It is a virtual select field that points at bunnyData.stream.status (processing, ready or failed), so it adds no database column.
  • List view. Add the Stream Status column with the column picker. It shows the state as a colored badge: Processing, Ready or Failed. A video with no stored state shows a gray Unknown badge. Documents without a Stream video show nothing. The cell never asks Bunny for the state: it shows the stored value. So a new video shows Processing in the list until Bunny’s webhook stores the new state, status sync runs, or someone opens the document in the edit view. Without a webhook or status sync, the badge can stay Processing after Bunny has finished.
  • Dashboard link. Each badge in the list has a small new-tab icon, and the whole badge is a link to the video in the Bunny Stream dashboard. It opens in a new tab. When you point at the badge or move to it with the keyboard, a tooltip says Open in Bunny Stream dashboard. Clicking the badge does not open the document. Set stream.status.link: false to show a plain badge without the icon, the link and the tooltip. This does not hide the library ID: the admin still gets it in the collection config (admin.custom), in the virtual bunnyData.stream.libraryId field of each document and in the player’s embed URL.
  • Filter and sort. You can filter the list by Stream Status, for example to find all videos that failed, and sort by it. Payload turns where[bunnyStream][equals]=failed into a query on bunnyData.stream.status, which is indexed.
  • Edit view. The sidebar shows a Bunny Stream card with the stored video data:
    • Status: the same badge as in the list, without the link. While the video is processing or has no stored state, the card checks the state on the same schedule as the media preview. The badge and the MP4 row change when the state changes, so you do not need to reload the page. Screen readers announce the new state.
    • Check status now: the round button next to the badge checks the state right away. It spins while the check runs. If the check fails, the card shows Could not check the video status. If the check finds the video still processing, screen readers hear The video is still processing. Check the status again later. The button shows only on a saved document while the video is processing or has no stored state. When the state changes to Ready or Failed, the button goes away. After you upload a new video, the card shows Processing and does not check until you save. The server may answer from its short cache: it asks Bunny at most once per video every 10 seconds, or 60 seconds when the library has a webhook.
    • Video ID: the Bunny Stream video ID. A long ID is cut short, and you can see the full ID when you point at it. The copy button next to it copies the ID, and screen readers announce Copied. If the browser blocks the clipboard, the button says Unable to copy.
    • MP4: the MP4 renditions Bunny made, for example 720p, 1080p. This row shows only when the plugin stored renditions, which needs mp4Fallback.
    • Open in Bunny dashboard: a link to the video in the Bunny Stream dashboard. It opens in a new tab. It shows only when stream.status.link is on.
  • API. Read responses include bunnyStream with the same value as bunnyData.stream.status. Create and update requests cannot set it.
Only Bunny Stream videos get a dashboard link. Files in Bunny Storage do not: the plugin knows the storage zone name, but a dashboard link needs the numeric zone ID. Payload loads only the active list columns. So the plugin adds a collection select function that also loads bunnyData.stream.status and bunnyData.stream.videoId when a query selects specific fields and one of them is bunnyStream. Your own collection select function still runs first, and the plugin adds the two fields to its result. A query that excludes fields, or that does not select bunnyStream, stays as it is. So a REST or Local API query with select: { bunnyStream: true } returns these two fields too.

Upgrading from v2

In v2 this data lived in flat bunnyVideoId and bunnyVideoMeta fields. See the migration guide to move existing documents into bunnyData.