/api/storage-bunny prefix. Client uploads use Payload’s own POST /api/upload-instructions endpoint. The admin UI calls them for you. You only need this reference if you build a custom upload flow, for example a headless front end that uploads directly to Bunny, if you set up the Stream webhook, or if you call the tasks endpoint from a cron service.
Endpoints
stream/status and stream/thumbnail read the document with Payload access control, including drafts and trashed documents. :videoId must be the video of the document or of its latest draft. Any other video ID returns 404. The paths start with the API route of your Payload config (routes.api, /api by default).
upload-instructions returns Bunny upload URLs only when storage.clientUploads is on:
- For a Stream file type in a collection where bulk uploads and form saves go to Stream over TUS, it returns
type: 'dispatch'with a TUS authorization for the admin UI. - Without client uploads, it answers
403, also for collections that store files only in Stream. - For any other Stream file type with client uploads, it answers
400. Custom clients upload videos withtus-authinstead.
bunnyData.stream.videoId and bunnyData.stream.videoToken, not with a file. See Custom TUS clients.
The other endpoints need these options:
stream/tus-authneedsstream.tus.stream/webhookneedsstream.webhook.stream/statusneedsstream.status(on by default).stream/thumbnailneedsthumbnailon a Stream collection with Payload access control.tasksneedstasks.secret.
{ "errors": [{ "message": "..." }] }. stream/webhook and tasks return { "error": "..." } instead, and stream/thumbnail passes on CDN errors as plain text.
Authentication
upload-instructionsandstream/tus-authrun through Payload’s access control. Send them with an authenticated session, for example thepayload-tokencookie.clientUploads.accesscan only narrow Payload’s check.stream.tus.accessreplaces the default check.stream/statusneeds a signed-in user of your admin user collection who passes itsaccess.admin, and reads the document with Payload access control. It returns{ "state": "processing" | "ready" | "failed", "resolutions"?: { "available", "highest" } }.resolutionsis the same value asbunnyData.stream.resolutions. It is left out when none are stored. A storedreadyorfailedstate comes from the document. Otherwise the server asks the Bunny API, at most once per video every 10 seconds (60 seconds when the library has a webhook), and stores a changed state.stream/thumbnailreads the document with Payload access control. It needs no admin access, and no sign-in when the collection allows public reads, because list views show the thumbnail to anyone who can read the document. It fetches the image from the Stream CDN and passes query parameters on, or redirects to a signed CDN URL whensignedUrls.staticHandler.redirectis set (302by default, or307). A proxied thumbnail is sent withCache-Control: private, so shared caches do not store it. See Thumbnails.tasksneedsAuthorization: Bearer <tasks.secret>.POSTalso accepts a signed-in user of your admin user collection who passes itsaccess.admin.GETnever accepts a session, so a link or an image tag cannot start a task. The plugin compares the secret in constant time.stream/webhookis not a Payload-authenticated route. Bunny signs each call, and the plugin verifies an HMAC-SHA256X-BunnyStream-Signatureheader against the library’s Read-Only API key (stream.webhook.secret).
Base your requests on your own app’s origin. The
https://your-site.com server shown on each endpoint is a
placeholder — replace it with where your Payload app runs.Plugin options accessors
Looking for the plugin’s server-side helper functions (getBunnyStreamForCollection, getBunnyStorageForCollection, and friends) rather than HTTP endpoints? Those are documented under Accessing the resolved options.