> ## Documentation Index
> Fetch the complete documentation index at: https://payload-storage-bunny.seshuk.im/llms.txt
> Use this file to discover all available pages before exploring further.

# 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](/configuration/stream/tus).



## OpenAPI

````yaml /api-reference/openapi.json post /api/storage-bunny/stream/tus-auth
openapi: 3.1.0
info:
  description: >-
    HTTP endpoints the plugin registers on your Payload app under `/api`. The
    admin UI calls these for you; document and drive them yourself only if you
    build a custom upload flow.
  title: Payload Storage Bunny — Plugin API
  version: 3.0.0
servers:
  - description: Your Payload app origin
    url: https://your-site.com
security:
  - payloadToken: []
paths:
  /api/storage-bunny/stream/tus-auth:
    post:
      tags:
        - Bunny Stream
      summary: Create or resume a TUS upload session
      description: >-
        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](/configuration/stream/tus).
      requestBody:
        content:
          application/json:
            schema:
              properties:
                collection:
                  description: Target upload collection.
                  type: string
                filename:
                  description: Original file name.
                  type: string
                filesize:
                  description: File size in bytes.
                  type: number
                filetype:
                  description: File MIME type.
                  type: string
                title:
                  description: Video title. Required when creating a new video.
                  type: string
                videoId:
                  description: Existing Bunny video GUID, to resume an upload.
                  type: string
              required:
                - collection
                - filename
                - filesize
                - filetype
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  authorizationExpire:
                    description: Signature expiry as a UNIX timestamp (seconds).
                    type: number
                  authorizationSignature:
                    description: SHA-256 TUS authorization signature.
                    type: string
                  libraryId:
                    description: Bunny Stream library the video lives in.
                    type: number
                  thumbnailTime:
                    description: Thumbnail capture time (ms), when configured.
                    type: number
                  type:
                    description: >-
                      `upload` returns a signature to proceed; `uploaded` means
                      the video already exists.
                    enum:
                      - upload
                      - uploaded
                    type: string
                  videoId:
                    description: Bunny video GUID.
                    type: string
                type: object
          description: >-
            TUS authorization for a new/resumed upload, or an `uploaded`
            short-circuit when the video is already processed.
        '400':
          description: Missing required fields, or a missing title for a new video.
        '403':
          description: Access denied.
        '500':
          description: Bunny Stream is not configured for the collection.
components:
  securitySchemes:
    payloadToken:
      description: >-
        Payload authentication cookie. These endpoints run Payload access
        control; an authenticated admin session is required.
      in: cookie
      name: payload-token
      type: apiKey

````