curl --request POST \
--url https://your-site.com/api/storage-bunny/stream/tus-auth \
--header 'Content-Type: application/json' \
--cookie payload-token= \
--data '
{
"collection": "<string>",
"filename": "<string>",
"filesize": 123,
"filetype": "<string>",
"head": "<string>",
"title": "<string>",
"videoId": "<string>",
"videoToken": "<string>"
}
'import requests
url = "https://your-site.com/api/storage-bunny/stream/tus-auth"
payload = {
"collection": "<string>",
"filename": "<string>",
"filesize": 123,
"filetype": "<string>",
"head": "<string>",
"title": "<string>",
"videoId": "<string>",
"videoToken": "<string>"
}
headers = {
"cookie": "payload-token=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'payload-token=', 'Content-Type': 'application/json'},
body: JSON.stringify({
collection: '<string>',
filename: '<string>',
filesize: 123,
filetype: '<string>',
head: '<string>',
title: '<string>',
videoId: '<string>',
videoToken: '<string>'
})
};
fetch('https://your-site.com/api/storage-bunny/stream/tus-auth', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://your-site.com/api/storage-bunny/stream/tus-auth",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'collection' => '<string>',
'filename' => '<string>',
'filesize' => 123,
'filetype' => '<string>',
'head' => '<string>',
'title' => '<string>',
'videoId' => '<string>',
'videoToken' => '<string>'
]),
CURLOPT_COOKIE => "payload-token=",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your-site.com/api/storage-bunny/stream/tus-auth"
payload := strings.NewReader("{\n \"collection\": \"<string>\",\n \"filename\": \"<string>\",\n \"filesize\": 123,\n \"filetype\": \"<string>\",\n \"head\": \"<string>\",\n \"title\": \"<string>\",\n \"videoId\": \"<string>\",\n \"videoToken\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "payload-token=")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://your-site.com/api/storage-bunny/stream/tus-auth")
.header("cookie", "payload-token=")
.header("Content-Type", "application/json")
.body("{\n \"collection\": \"<string>\",\n \"filename\": \"<string>\",\n \"filesize\": 123,\n \"filetype\": \"<string>\",\n \"head\": \"<string>\",\n \"title\": \"<string>\",\n \"videoId\": \"<string>\",\n \"videoToken\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-site.com/api/storage-bunny/stream/tus-auth")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'payload-token='
request["Content-Type"] = 'application/json'
request.body = "{\n \"collection\": \"<string>\",\n \"filename\": \"<string>\",\n \"filesize\": 123,\n \"filetype\": \"<string>\",\n \"head\": \"<string>\",\n \"title\": \"<string>\",\n \"videoId\": \"<string>\",\n \"videoToken\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"authorizationExpire": 123,
"authorizationSignature": "<string>",
"clientUploadContext": {
"head": "<string>",
"signedReceipt": "<string>",
"videoId": "<string>",
"videoToken": "<string>"
},
"libraryId": 123,
"thumbnailTime": 123,
"type": "upload",
"videoId": "<string>",
"videoToken": "<string>"
}Create or resume a TUS upload session
Creates the video in Bunny Stream (if needed) and returns a signed TUS authorization so the browser can upload directly to Bunny. Access is gated by stream.tus.checkAccess or the built-in rule. See TUS uploads.
curl --request POST \
--url https://your-site.com/api/storage-bunny/stream/tus-auth \
--header 'Content-Type: application/json' \
--cookie payload-token= \
--data '
{
"collection": "<string>",
"filename": "<string>",
"filesize": 123,
"filetype": "<string>",
"head": "<string>",
"title": "<string>",
"videoId": "<string>",
"videoToken": "<string>"
}
'import requests
url = "https://your-site.com/api/storage-bunny/stream/tus-auth"
payload = {
"collection": "<string>",
"filename": "<string>",
"filesize": 123,
"filetype": "<string>",
"head": "<string>",
"title": "<string>",
"videoId": "<string>",
"videoToken": "<string>"
}
headers = {
"cookie": "payload-token=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'payload-token=', 'Content-Type': 'application/json'},
body: JSON.stringify({
collection: '<string>',
filename: '<string>',
filesize: 123,
filetype: '<string>',
head: '<string>',
title: '<string>',
videoId: '<string>',
videoToken: '<string>'
})
};
fetch('https://your-site.com/api/storage-bunny/stream/tus-auth', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://your-site.com/api/storage-bunny/stream/tus-auth",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'collection' => '<string>',
'filename' => '<string>',
'filesize' => 123,
'filetype' => '<string>',
'head' => '<string>',
'title' => '<string>',
'videoId' => '<string>',
'videoToken' => '<string>'
]),
CURLOPT_COOKIE => "payload-token=",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your-site.com/api/storage-bunny/stream/tus-auth"
payload := strings.NewReader("{\n \"collection\": \"<string>\",\n \"filename\": \"<string>\",\n \"filesize\": 123,\n \"filetype\": \"<string>\",\n \"head\": \"<string>\",\n \"title\": \"<string>\",\n \"videoId\": \"<string>\",\n \"videoToken\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "payload-token=")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://your-site.com/api/storage-bunny/stream/tus-auth")
.header("cookie", "payload-token=")
.header("Content-Type", "application/json")
.body("{\n \"collection\": \"<string>\",\n \"filename\": \"<string>\",\n \"filesize\": 123,\n \"filetype\": \"<string>\",\n \"head\": \"<string>\",\n \"title\": \"<string>\",\n \"videoId\": \"<string>\",\n \"videoToken\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-site.com/api/storage-bunny/stream/tus-auth")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'payload-token='
request["Content-Type"] = 'application/json'
request.body = "{\n \"collection\": \"<string>\",\n \"filename\": \"<string>\",\n \"filesize\": 123,\n \"filetype\": \"<string>\",\n \"head\": \"<string>\",\n \"title\": \"<string>\",\n \"videoId\": \"<string>\",\n \"videoToken\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"authorizationExpire": 123,
"authorizationSignature": "<string>",
"clientUploadContext": {
"head": "<string>",
"signedReceipt": "<string>",
"videoId": "<string>",
"videoToken": "<string>"
},
"libraryId": 123,
"thumbnailTime": 123,
"type": "upload",
"videoId": "<string>",
"videoToken": "<string>"
}Authorizations
Payload authentication cookie. These endpoints run Payload access control; an authenticated admin session is required.
Body
Target upload collection.
Original file name.
File size in bytes.
File MIME type.
Base64 of the first bytes of the file (at most 8192 characters). When sent, the response includes a clientUploadContext for a client-direct upload.
Video title. Required when creating a new video.
Existing Bunny video GUID, to resume an upload. Used only with a matching videoToken.
The videoToken returned with videoId.
Response
TUS authorization for a new/resumed upload, or an uploaded short-circuit when the video is already processed.
Signature expiry as a UNIX timestamp (seconds).
SHA-256 TUS authorization signature.
Returned when the request includes head. Send it unchanged as the clientUploadContext of the Payload upload.
Show child attributes
Show child attributes
Bunny Stream library the video lives in.
Thumbnail capture time (ms), when configured.
upload returns a signature to proceed; uploaded means the video already exists.
upload, uploaded Bunny video GUID.
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.