Creates the video and its TUS upload in Bunny Stream with the declared filesize, and returns the upload URL with short-lived TUS headers so the browser can send the file directly to Bunny. Call it again with videoId and videoToken to resume the upload, or also with renew: true to get new headers for it. Access is gated by stream.tus.access or the built-in rule. See TUS uploads.
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.
Show child attributes
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.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Bunny.net Storage for Payload CMS","description":"Bunny.net storage adapter for Payload","colors":{"primary":"#ef6126","light":"#f49067","dark":"#be420e"},"logo":{"light":"https://mintcdn.com/payload-storage-bunny/fAicIcOW-53Dy2QI/logo.svg?fit=max\u0026auto=format\u0026n=fAicIcOW-53Dy2QI\u0026q=85\u0026s=fd70722cbd3ccf2782012c33367cf1a2","dark":"https://mintcdn.com/payload-storage-bunny/fAicIcOW-53Dy2QI/logo.svg?fit=max\u0026auto=format\u0026n=fAicIcOW-53Dy2QI\u0026q=85\u0026s=fd70722cbd3ccf2782012c33367cf1a2"},"favicon":"https://mintcdn.com/payload-storage-bunny/QZzvvP4NI4oNDeN_/favicon.svg?fit=max\u0026auto=format\u0026n=QZzvvP4NI4oNDeN_\u0026q=85\u0026s=1b19c50bfb85920869e2c1f04ced1d09","navbar":{"links":[{"href":"https://github.com/maximseshuk/payload-storage-bunny/releases","label":"Releases"},{"href":"https://ko-fi.com/seshuk","label":"Donate"},{"href":"https://bunny.net?ref=fndfoymy0j","label":"bunny.net"}],"primary":{"type":"github","href":"https://github.com/maximseshuk/payload-storage-bunny"}},"footer":{"socials":{"github":"https://github.com/maximseshuk/payload-storage-bunny"}},"fonts":{"family":"Geist"},"contextual":{"options":["copy","view","assistant","chatgpt","claude","perplexity","grok","aistudio","devin","windsurf","mcp","add-mcp","cursor","vscode","devin-mcp","download-pdf","download-spec"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"payload-storage-bunny","hasAudioNarration":false,"actualSubdomain":"payload-storage-bunny","customDomains":["payload-storage-bunny.seshuk.im"],"gitSource":{"type":"github","owner":"maximseshuk","repo":"payload-storage-bunny","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":"","_id":"6b10f6dc9ffae5051c419ce5"},"feedback":{"agentFeedback":false},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae055dc7b2b510f51833179","clientVersion":"0.0.4453","searchFilterCounts":[{"language":"default","tag":"Documentation","count":54},{"language":"default","tag":"Configuration","count":25},{"language":"default","tag":"API reference","count":14},{"language":"default","tag":"Guides","count":10},{"language":"default","tag":"Stream","count":6},{"language":"default","tag":"CLI","count":5},{"language":"default","tag":"Storage","count":4}],"searchSettings":{"maxResults":10}},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":true},"customCss":[{"filePath":"custom.css","content":"body:has(.sb-home) #navbar,body:has(.sb-home) #navbar-transition,body:has(.sb-home) #topbar{display:none!important}body:has(.sb-home) #content-area,body:has(.sb-home) :has(>#content-area),body:has(.sb-home) main{padding-top:0!important;margin-top:0!important}.sb-home{--sb-bg: rgb(var(--background-light));--sb-text: rgb(var(--gray-900));--sb-muted: rgb(var(--gray-700));--sb-line: rgb(var(--gray-950) / 0.1);--sb-cross: rgb(var(--gray-950) / 0.35);--sb-l: linear-gradient(transparent, var(--sb-line) 96px, var(--sb-line) calc(100% - 64px), transparent);display:grid;max-width:92rem;margin:0 auto;padding:0 48px;background:var(--sb-l) 0 100% / 1px calc(100% - 80px),\n var(--sb-l) calc(25% + 0.25px) 100% / 1px calc(100% - 160px),\n var(--sb-l) calc(50% + 0.5px) 100% / 1px calc(100% - 200px),\n var(--sb-l) calc(75% + 0.75px) 100% / 1px calc(100% - 160px),\n var(--sb-l) 100% 100% / 1px calc(100% - 80px);background-repeat:no-repeat;background-origin:content-box;background-clip:content-box}.dark .sb-home{--sb-bg: rgb(var(--background-dark));--sb-text: rgb(var(--gray-200));--sb-muted: rgb(var(--gray-400));--sb-line: rgb(255 255 255 / 0.1);--sb-cross: rgb(255 255 255 / 0.35)}.sb-hero{position:relative;display:grid;grid-template-columns:repeat(4, 1fr);grid-template-rows:1fr auto;padding:232px 0 0;margin-bottom:96px}.sb-hero::before,.sb-hero::after{content:'';position:absolute;bottom:-5px;left:calc(25% - 4px);width:9px;height:9px;background:linear-gradient(var(--sb-cross) 0 0) center / 9px 1px no-repeat,\n linear-gradient(var(--sb-cross) 0 0) center / 1px 9px no-repeat}.sb-hero::after{left:calc(75% - 4px)}.sb-copy{grid-column:1 / 3;align-self:end;padding:24px 24px 40px;box-shadow:inset 1px 0 var(--sb-line);background:var(--sb-bg)}.sb-title{margin:0;font-size:clamp(2.5rem, 1.5rem + 2.8vw, 4rem);font-weight:600;line-height:1.05;letter-spacing:-0.035em;color:var(--sb-text);text-wrap:balance}.sb-title span{color:rgb(var(--primary))}.sb-sub{max-width:34rem;margin:20px 0 0;font-size:1.125rem;line-height:1.75rem;color:var(--sb-muted);text-wrap:pretty}.sb-actions{grid-column:1 / 3;display:grid;grid-template-columns:1fr 1fr;border-top:1px solid var(--sb-line);box-shadow:inset 1px 0 var(--sb-line);background:var(--sb-bg)}.sb-row{display:flex;align-items:center;justify-content:space-between;gap:16px;min-width:0;height:64px;padding:0 24px;border:0;border-bottom:1px solid var(--sb-line);font:inherit;font-weight:500;color:var(--sb-text);text-align:left;text-decoration:none;background:none;cursor:pointer;transition:background-color 0.15s ease}.sb-row:hover{background:color-mix(in srgb, var(--sb-text) 4%, transparent)}.sb-row:focus-visible{outline:2px solid rgb(var(--primary));outline-offset:-2px}.sb-actions a+a{border-left:1px solid var(--sb-line)}.sb-row-install{grid-column:1 / -1}.sb-row code{overflow:hidden;padding:0;border:0;font-family:var(--font-paper-mono), ui-monospace, monospace;font-size:0.875rem;font-weight:400;color:inherit;white-space:nowrap;text-overflow:ellipsis;background:none}.sb-row code span{color:var(--sb-muted)}.sb-row-icon{flex:none;width:16px;height:16px;color:var(--sb-muted);transition:color 0.15s ease,\n transform 0.15s ease}.sb-row-icon svg{display:block;width:100%;height:100%}.sb-row:hover .sb-row-icon{color:rgb(var(--primary))}a.sb-row:hover .sb-row-icon{transform:translate(2px, -2px)}.sb-mark{grid-column:3 / 5;grid-row:1 / 3;display:grid;place-items:center;border:1px solid var(--sb-line);background:var(--sb-bg)}.sb-mark img{display:block;width:min(64%, 320px);height:auto;margin:0}.sb-mark [data-rmiz],.sb-mark [data-rmiz] *,.sb-mark img{pointer-events:none}@media (max-width: 1199px){.sb-home{background:var(--sb-l) 0 100% / 1px calc(100% - 48px),\n var(--sb-l) calc(50% + 0.5px) 100% / 1px calc(100% - 96px),\n var(--sb-l) 100% 100% / 1px calc(100% - 48px);background-repeat:no-repeat;background-origin:content-box;background-clip:content-box}.sb-hero{grid-template-columns:repeat(2, 1fr);padding-top:128px}.sb-hero::before{left:calc(50% - 4px)}.sb-hero::after{display:none}.sb-copy,.sb-actions{grid-column:1 / 2}.sb-actions{grid-template-columns:1fr}.sb-actions a+a{border-left:0}.sb-mark{grid-column:2 / 3}}@media (max-width: 1023px){.sb-home{padding:0 16px}.sb-hero{grid-template-rows:auto;padding:96px 0 0;margin-bottom:64px}.sb-copy,.sb-actions,.sb-mark{grid-column:1 / -1;grid-row:auto}.sb-copy,.sb-actions{box-shadow:inset 1px 0 var(--sb-line),\n inset -1px 0 var(--sb-line)}.sb-copy{padding:32px 20px}.sb-row{padding:0 20px}.sb-mark{order:-1;height:240px;border-bottom:0}.sb-mark img{width:auto;height:168px}}@media (max-width: 767px){.sb-row code{font-size:0.7rem}.sb-row code span{display:none}.sb-home{background:var(--sb-l) 0 100% / 1px calc(100% - 32px),\n var(--sb-l) 100% 100% / 1px calc(100% - 32px);background-repeat:no-repeat;background-origin:content-box;background-clip:content-box}.sb-hero{padding-top:64px}.sb-hero::before{left:-4px}.sb-hero::after{display:block;left:calc(100% - 5px)}}.sb-bunny-card{display:block;margin-bottom:24px;border-radius:12px;overflow:hidden}.sb-bunny-card img{display:block;width:100%;height:auto}.sb-bunny-card-dark,.dark .sb-bunny-card-light{display:none!important}.dark .sb-bunny-card-dark{display:block!important}"}]}
{"page":{"pagePath":"v4/api-reference/bunny-stream/create-or-resume-a-tus-upload-session","slug":"/v4/api-reference/bunny-stream/create-or-resume-a-tus-upload-session","pageMetadata":{"title":"Create or resume a TUS upload session","description":"Creates the video and its TUS upload in Bunny Stream with the declared `filesize`, and returns the upload URL with short-lived TUS headers so the browser can send the file directly to Bunny. Call it again with `videoId` and `videoToken` to resume the upload, or also with `renew: true` to get new headers for it. Access is gated by `stream.tus.access` or the built-in rule. See [TUS uploads](/v4/configuration/stream/tus).","deprecated":null,"version":null,"openapi":"/v4/api-reference/openapi.json post /api/storage-bunny/stream/tus-auth","href":"/v4/api-reference/bunny-stream/create-or-resume-a-tus-upload-session","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n a: \"a\",\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_components.p, {\n children: [\"Creates the video and its TUS upload in Bunny Stream with the declared \", _jsx(_components.code, {\n children: \"filesize\"\n }), \", and returns the upload URL with short-lived TUS headers so the browser can send the file directly to Bunny. Call it again with \", _jsx(_components.code, {\n children: \"videoId\"\n }), \" and \", _jsx(_components.code, {\n children: \"videoToken\"\n }), \" to resume the upload, or also with \", _jsx(_components.code, {\n children: \"renew: true\"\n }), \" to get new headers for it. Access is gated by \", _jsx(_components.code, {\n children: \"stream.tus.access\"\n }), \" or the built-in rule. See \", _jsx(_components.a, {\n href: \"/v4/configuration/stream/tus\",\n children: \"TUS uploads\"\n }), \".\"]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Create or resume a TUS upload session","description":"Creates the video and its TUS upload in Bunny Stream with the declared `filesize`, and returns the upload URL with short-lived TUS headers so the browser can send the file directly to Bunny. Call it again with `videoId` and `videoToken` to resume the upload, or also with `renew: true` to get new headers for it. Access is gated by `stream.tus.access` or the built-in rule. See [TUS uploads](/v4/configuration/stream/tus).","deprecated":null,"version":null,"openapi":"/v4/api-reference/openapi.json post /api/storage-bunny/stream/tus-auth","href":"/v4/api-reference/bunny-stream/create-or-resume-a-tus-upload-session","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":["/_mintlify/custom/payload-storage-bunny/bd1bb114550c4e7f/bunny-toc.js"],"openApiReferenceData":{"operation":{"description":"Creates the video and its TUS upload in Bunny Stream with the declared `filesize`, and returns the upload URL with short-lived TUS headers so the browser can send the file directly to Bunny. Call it again with `videoId` and `videoToken` to resume the upload, or also with `renew: true` to get new headers for it. Access is gated by `stream.tus.access` or the built-in rule. See [TUS uploads](/v4/configuration/stream/tus).","requestBody":"5477daf7-5075-4a28-b712-e7ef77217fad","responses":{"200":"b2521b97-278d-4b58-90a0-0fc14d678eec","400":"0face6b3-2591-474d-81f0-57d93d531a62","403":"26a0b907-5895-45c3-860c-96106b593aef","404":"ad620d25-a3a4-4028-987d-8970160bac74","409":"1ace276b-de30-4f6a-9245-14db3bdcc32c","413":"891bc6bd-0eee-480a-bd84-e7f6ae9b7ad3","415":"d05878a2-4315-4147-af66-0c0a3a85006d","500":"25f338ba-3f08-4f17-9ce2-e95e3c066ce8"},"summary":"Create or resume a TUS upload session","tags":["Bunny Stream"],"method":"post","type":"path","servers":["fa8c5689-ff60-4b84-b934-f37c1d2dbe0e"],"security":["a22fb579-acd1-40b0-88c9-094612aec45b"],"path":"/api/storage-bunny/stream/tus-auth","baseUrlOptions":["https://your-site.com"],"title":"Create or resume a TUS upload session","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"content":{"application/json":{"schema":{"properties":{"collection":{"description":"Target upload collection.","type":"string","isRequired":true,"uniqueKey":"collection","typeLabel":"string"},"filename":{"description":"Original file name.","type":"string","isRequired":true,"uniqueKey":"filename","typeLabel":"string"},"filesize":{"description":"File size in bytes. Bunny accepts only this number of bytes for the upload.","type":"number","isRequired":true,"uniqueKey":"filesize","typeLabel":"number"},"filetype":{"description":"File MIME type.","type":"string","isRequired":true,"uniqueKey":"filetype","typeLabel":"string"},"renew":{"description":"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.","type":"boolean","uniqueKey":"renew","typeLabel":"boolean"},"title":{"description":"Title of a new video. Defaults to `filename`.","type":"string","uniqueKey":"title","typeLabel":"string"},"videoId":{"description":"Existing Bunny video GUID, to resume an upload or renew its headers. Used only with a matching `videoToken` and the same `filesize`.","type":"string","uniqueKey":"videoId","typeLabel":"string"},"videoToken":{"description":"The `videoToken` returned with `videoId`.","type":"string","uniqueKey":"videoToken","typeLabel":"string"}},"required":["collection","filename","filesize","filetype"],"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"collection":"\u003cstring>","filename":"\u003cstring>","filesize":123,"filetype":"\u003cstring>","renew":true,"title":"\u003cstring>","videoId":"\u003cstring>","videoToken":"\u003cstring>"}}},"exampleType":"generated"}},"required":true,"exampleType":"generated"},"responses":{"b2521b97-278d-4b58-90a0-0fc14d678eec":{"content":{"application/json":{"schema":{"properties":{"expiresIn":{"description":"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.","type":"number","uniqueKey":"expiresIn","typeLabel":"number"},"headers":{"additionalProperties":{"type":"string","uniqueKey":"headers.additionalProperties","typeLabel":"string"},"description":"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.","type":"object","uniqueKey":"headers","typeLabel":"object"},"libraryId":{"description":"Bunny Stream library the video lives in.","type":"number","uniqueKey":"libraryId","typeLabel":"number"},"title":{"description":"Returned with `uploaded`. Title of the video in Bunny, or `filename`.","type":"string","uniqueKey":"title","typeLabel":"string"},"type":{"description":"`upload` returns the upload to send the file to; `uploaded` means the upload is complete or the video already exists.","enum":["upload","uploaded"],"type":"string","uniqueKey":"type","typeLabel":"enum\u003cstring>"},"uploadUrl":{"description":"Returned with `upload`. TUS upload URL that the server created. Send only `HEAD` and `PATCH` requests to it.","type":"string","uniqueKey":"uploadUrl","typeLabel":"string"},"videoId":{"description":"Bunny video GUID.","type":"string","uniqueKey":"videoId","typeLabel":"string"},"videoToken":{"description":"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.","type":"string","uniqueKey":"videoToken","typeLabel":"string"}},"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"expiresIn":123,"headers":{},"libraryId":123,"title":"\u003cstring>","type":"upload","uploadUrl":"\u003cstring>","videoId":"\u003cstring>","videoToken":"\u003cstring>"}}},"exampleType":"generated"}},"description":"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.","exampleType":"generated"},"0face6b3-2591-474d-81f0-57d93d531a62":{"description":"Missing required fields, an invalid file name, MIME type or size, an SVG or XML file, a missing title for a new video, or Stream TUS uploads not enabled for the collection.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"26a0b907-5895-45c3-860c-96106b593aef":{"description":"Access denied.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"ad620d25-a3a4-4028-987d-8970160bac74":{"description":"The collection does not exist or is not managed by the plugin.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"1ace276b-de30-4f6a-9245-14db3bdcc32c":{"description":"Renew mode only: the upload cannot be renewed. The video token is invalid, the video or its upload is gone, or `filesize` differs from the upload. Start a new upload without `renew`.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"891bc6bd-0eee-480a-bd84-e7f6ae9b7ad3":{"description":"The file exceeds `upload.limits.fileSize`.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"d05878a2-4315-4147-af66-0c0a3a85006d":{"description":"The file type is restricted or not accepted by the collection or the Stream options.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"25f338ba-3f08-4f17-9ce2-e95e3c066ce8":{"description":"Unexpected failure, such as a Bunny Stream API error. Details are hidden from the response.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}}},"security":{"a22fb579-acd1-40b0-88c9-094612aec45b":{"payloadToken":{"description":"Payload authentication cookie. Each endpoint checks Payload access control for the signed-in user; see the endpoint for what it needs.","in":"cookie","name":"payload-token","type":"apiKey","scopes":[],"schemeName":"payloadToken"}}},"servers":{"fa8c5689-ff60-4b84-b934-f37c1d2dbe0e":{"description":"Your Payload app origin","url":"https://your-site.com"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"description":"Payload authentication cookie. Each endpoint checks Payload access control for the signed-in user; see the endpoint for what it needs.","in":"cookie","name":"payload-token","type":"apiKey","scopes":[],"schemeName":"payloadToken"},"schema":{"title":"payload-token","type":"string","description":"Payload authentication cookie. Each endpoint checks Payload access control for the signed-in user; see the endpoint for what it needs.","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"payloadToken","name":"payload-token"}],"title":"payloadToken"}]},"originalFileLocation":"v4/api-reference/openapi.json"},"subdomain":"payload-storage-bunny","siteName":"Bunny.net Storage for Payload CMS","title":"Create or resume a TUS upload session - Bunny.net Storage for Payload CMS","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{"v3":{"href":"/api-reference/bunny-stream/create-or-resume-a-tus-upload-session","matchLevel":1},"v4":{"href":"/v4/api-reference/bunny-stream/create-or-resume-a-tus-upload-session","matchLevel":0}},"firstHrefInLanguage":{}},"lastModified":"2026-10-15T07:25:08.143Z","originalFileLocation":"v4/api-reference/bunny-stream/create-or-resume-a-tus-upload-session.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Creates the video and its TUS upload in Bunny Stream with the declared filesize, and returns the upload URL with short-lived TUS headers so the browser can send the file directly to Bunny. Call it again with videoId and videoToken to resume the upload, or also with renew: true to get new headers for it. Access is gated by stream.tus.access or the built-in rule. See TUS uploads.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Bunny.net Storage for Payload CMS\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/payload-storage-bunny/kOlEVKJ6LOdQAYNc/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/payload-storage-bunny/kOlEVKJ6LOdQAYNc/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/payload-storage-bunny/kOlEVKJ6LOdQAYNc/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/payload-storage-bunny/kOlEVKJ6LOdQAYNc/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/payload-storage-bunny/kOlEVKJ6LOdQAYNc/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/payload-storage-bunny/kOlEVKJ6LOdQAYNc/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/payload-storage-bunny/kOlEVKJ6LOdQAYNc/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/payload-storage-bunny/kOlEVKJ6LOdQAYNc/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/payload-storage-bunny/kOlEVKJ6LOdQAYNc/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create or resume a TUS upload session - Bunny.net Storage for Payload CMS\">\u003cmeta data-mint-head property=\"og:description\" content=\"Creates the video and its TUS upload in Bunny Stream with the declared filesize, and returns the upload URL with short-lived TUS headers so the browser can send the file directly to Bunny. Call it again with videoId and videoToken to resume the upload, or also with renew: true to get new headers for it. Access is gated by stream.tus.access or the built-in rule. See TUS uploads.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Bunny.net Storage for Payload CMS\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://payload-storage-bunny.seshuk.im/v4/api-reference/bunny-stream/create-or-resume-a-tus-upload-session\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://payload-storage-bunny.mintlify.site/_mintlify/api/og/v2?division=API+reference\u0026amp;title=Create+or+resume+a+TUS+upload+session\u0026amp;description=Creates+the+video+and+its+TUS+upload+in+Bunny+Stream+with+the+declared+%60filesize%60%2C+and+returns+the+upload+URL+with+short-lived+TUS+headers+so+the+browser+can+se\u0026amp;theme=160341f1c557e303dc544b11\u0026amp;signature=2f4735580eb9fd2b72bab708c8b24c034cedeafbccde6ef1e29041192c7e159a\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Create or resume a TUS upload session - Bunny.net Storage for Payload CMS\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Creates the video and its TUS upload in Bunny Stream with the declared filesize, and returns the upload URL with short-lived TUS headers so the browser can send the file directly to Bunny. Call it again with videoId and videoToken to resume the upload, or also with renew: true to get new headers for it. Access is gated by stream.tus.access or the built-in rule. See TUS uploads.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://payload-storage-bunny.mintlify.site/_mintlify/api/og/v2?division=API+reference\u0026amp;title=Create+or+resume+a+TUS+upload+session\u0026amp;description=Creates+the+video+and+its+TUS+upload+in+Bunny+Stream+with+the+declared+%60filesize%60%2C+and+returns+the+upload+URL+with+short-lived+TUS+headers+so+the+browser+can+se\u0026amp;theme=160341f1c557e303dc544b11\u0026amp;signature=2f4735580eb9fd2b72bab708c8b24c034cedeafbccde6ef1e29041192c7e159a\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/payload-storage-bunny/kOlEVKJ6LOdQAYNc/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Bunny.net Storage for Payload CMS\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#ef6126\">\u003clink data-mint-head rel=\"canonical\" href=\"https://payload-storage-bunny.seshuk.im/v4/api-reference/bunny-stream/create-or-resume-a-tus-upload-session\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/v4/api-reference/bunny-stream/create-or-resume-a-tus-upload-session.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://payload-storage-bunny.seshuk.im/#organization\",\"name\":\"Bunny.net Storage for Payload CMS\",\"url\":\"https://payload-storage-bunny.seshuk.im\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/payload-storage-bunny/fAicIcOW-53Dy2QI/logo.svg?fit=max\u0026auto=format\u0026n=fAicIcOW-53Dy2QI\u0026q=85\u0026s=fd70722cbd3ccf2782012c33367cf1a2\"}},{\"@type\":\"WebSite\",\"@id\":\"https://payload-storage-bunny.seshuk.im#website\",\"name\":\"Bunny.net Storage for Payload CMS\",\"url\":\"https://payload-storage-bunny.seshuk.im\",\"publisher\":{\"@id\":\"https://payload-storage-bunny.seshuk.im/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://payload-storage-bunny.seshuk.im/v4/api-reference/bunny-stream/create-or-resume-a-tus-upload-session#webpage\",\"url\":\"https://payload-storage-bunny.seshuk.im/v4/api-reference/bunny-stream/create-or-resume-a-tus-upload-session\",\"name\":\"Create or resume a TUS upload session\",\"description\":\"Creates the video and its TUS upload in Bunny Stream with the declared filesize, and returns the upload URL with short-lived TUS headers so the browser can send the file directly to Bunny. Call it again with videoId and videoToken to resume the upload, or also with renew: true to get new headers for it. Access is gated by stream.tus.access or the built-in rule. See TUS uploads.\",\"dateModified\":\"2026-10-15T07:25:08.143Z\",\"isPartOf\":{\"@id\":\"https://payload-storage-bunny.seshuk.im#website\"},\"breadcrumb\":{\"@id\":\"https://payload-storage-bunny.seshuk.im/v4/api-reference/bunny-stream/create-or-resume-a-tus-upload-session#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://payload-storage-bunny.seshuk.im/v4/api-reference/bunny-stream/create-or-resume-a-tus-upload-session#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API reference\",\"item\":\"https://payload-storage-bunny.seshuk.im/v4/api-reference/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create or resume a TUS upload session\",\"item\":\"https://payload-storage-bunny.seshuk.im/v4/api-reference/bunny-stream/create-or-resume-a-tus-upload-session\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://payload-storage-bunny.seshuk.im/v4/api-reference/bunny-stream/create-or-resume-a-tus-upload-session#apireference\",\"headline\":\"Create or resume a TUS upload session\",\"name\":\"Create or resume a TUS upload session\",\"description\":\"Creates the video and its TUS upload in Bunny Stream with the declared filesize, and returns the upload URL with short-lived TUS headers so the browser can send the file directly to Bunny. Call it again with videoId and videoToken to resume the upload, or also with renew: true to get new headers for it. Access is gated by stream.tus.access or the built-in rule. See TUS uploads.\",\"url\":\"https://payload-storage-bunny.seshuk.im/v4/api-reference/bunny-stream/create-or-resume-a-tus-upload-session\",\"mainEntityOfPage\":{\"@id\":\"https://payload-storage-bunny.seshuk.im/v4/api-reference/bunny-stream/create-or-resume-a-tus-upload-session#webpage\"},\"dateModified\":\"2026-10-15T07:25:08.143Z\",\"publisher\":{\"@id\":\"https://payload-storage-bunny.seshuk.im/#organization\"},\"isPartOf\":{\"@id\":\"https://payload-storage-bunny.seshuk.im#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Bunny.net Storage for Payload CMS\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Bunny.net Storage for Payload CMS\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/v4/api-reference/bunny-stream/create-or-resume-a-tus-upload-session.md","siteName":"Bunny.net Storage for Payload CMS","nav":{"global":null,"versions":[{"version":"v3","default":true,"pages":[{"title":"v3","href":"/api-reference/bunny-stream/create-or-resume-a-tus-upload-session"}]},{"version":"v4","tag":"Beta","tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/v4/introduction"}]},{"tab":"API reference","groups":[{"group":"API reference","pages":[{"title":"API reference","sidebarTitle":"Overview","description":"HTTP endpoints for client uploads, TUS authorization, the Stream webhook, the Stream video state and thumbnail, and the background tasks.","href":"/v4/api-reference/overview"},{"title":"Create or resume a TUS upload session","deprecated":null,"version":null,"openapi":"/v4/api-reference/openapi.json post /api/storage-bunny/stream/tus-auth","href":"/v4/api-reference/bunny-stream/create-or-resume-a-tus-upload-session"},{"title":"Bunny Stream encoding-status webhook","description":"Receives encoding-status callbacks from Bunny Stream. The plugin maps `Status` to the stored encoding state in `bunnyData.stream.status` and writes it only when it changes: 0, 1, 2, 4, 6 and 7 mean `processing`, 3 means `ready`, 5 and 8 mean `failed`, other codes change nothing. A `processing` status never replaces a stored `ready` or `failed` state. On completion (status 3, with `mp4Fallback` enabled) the plugin also fills in `bunnyData.stream.resolutions`. Authenticated by an HMAC signature, not a Payload session. Set the webhook URL in your Bunny Stream library to this path. See [Webhooks](/v4/configuration/stream/webhooks).","deprecated":null,"version":null,"openapi":"/v4/api-reference/openapi.json post /api/storage-bunny/stream/webhook","href":"/v4/api-reference/bunny-stream/bunny-stream-encoding-status-webhook"}]}]}]}]},"basePath":"","title":"Create or resume a TUS upload session - Bunny.net Storage for Payload CMS","deploymentId":"dpl_BLZw3QngerHodH9E8mGgC4v752y3","buildId":"dpl_BLZw3QngerHodH9E8mGgC4v752y3","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CaRkHcld.js","snippetPresets-CbOVSLWB.js","utils-cjri0g4r.js","style-to-object-BY3JEAdk.js","utils-DINdUa17.js","v4-DIgz8zy6.js","addTypeLabelsToSchema-B6z-PJGf.js","conditional-requirements-CFM0id0Q.js","cloneDeep-BldndzCM.js","_Uint8Array-BFUkDgJK.js","isObject-FP1Yky1u.js","ApiExamples-gah5G0c1.js","usePlaygroundInputsStore-DMbftGRK.js","shallow-BPuQ-dV8.js","isEqual-Du6c450V.js","CodeSnippets-BSVM0Ibi.js","CodeSnippet-BtGQRZnK.js","use-playground-group-access-98JyaSW7.js","Page-DuvGhd6e.js","api-description-markdown-ja0XM5Ae.js","DynamicMarkdown-DgKZ4_wp.js","SectionHeading-S4Jc_qPe.js","MethodPill-HIsDH_bI.js","getPastedJson-BKEmMYEO.js","Check2Icon-CRFAnWm9.js","axios-CsQoIw0U.js","Markdown-CexXCNoj.js","AssistantPageLink-C2AZnMAs.js","dist-CjxLTLs9.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}