Skip to main content
POST
Create or resume a TUS upload session

Authorizations

payload-token
string
cookie
required

Payload authentication cookie. Each endpoint checks Payload access control for the signed-in user; see the endpoint for what it needs.

Body

application/json
collection
string
required

Target upload collection.

filename
string
required

Original file name.

filesize
number
required

File size in bytes. Bunny accepts only this number of bytes for the upload.

filetype
string
required

File MIME type.

renew
boolean

Renew mode, for an upload in progress. Returns new headers for the same upload, or uploaded when it has finished. Never creates a video: when the upload cannot be renewed, the endpoint answers 409.

title
string

Title of a new video. Defaults to filename.

videoId
string

Existing Bunny video GUID, to resume an upload or renew its headers. Used only with a matching videoToken and the same filesize.

videoToken
string

The videoToken returned with videoId.

Response

The upload URL and TUS headers for a new or resumed upload, or uploaded when the upload is complete or the video is already processed.

expiresIn
number

Returned with upload. Number of seconds the headers stay valid, counted from the response. Use it instead of AuthorizationExpire, so the client clock does not matter.

headers
object

Returned with upload. Send these headers with every TUS request: AuthorizationExpire, AuthorizationSignature, LibraryId and VideoId. They are valid for expiresIn seconds, at most 5 minutes. Before they expire, call this endpoint again with videoId, videoToken and renew: true to get new ones.

libraryId
number

Bunny Stream library the video lives in.

title
string

Returned with uploaded. Title of the video in Bunny, or filename.

type
enum<string>

upload returns the upload to send the file to; uploaded means the upload is complete or the video already exists.

Available options:
upload,
uploaded
uploadUrl
string

Returned with upload. TUS upload URL that the server created. Send only HEAD and PATCH requests to it.

videoId
string

Bunny video GUID.

videoToken
string

Token bound to videoId and the signed-in user, valid for 24 hours. Send it as bunnyData.stream.videoToken when saving the document, and with videoId to resume.