> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tetherai.ca/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload one or more files to R2 storage

> Accepts up to 10 files as `multipart/form-data` under the `files` field. Each file is uploaded to R2 under a per-organization storage key and returned with a freshly generated signed URL.



## OpenAPI

````yaml /api-reference/openapi.yaml post /api/upload
openapi: 3.0.3
info:
  title: Tether Relay and Tether API
  version: 1.0.0
  description: >-
    Route-derived OpenAPI contract generated from tether-relay backend sources.
    Regenerate with scripts/sync-openapi-from-backend.mjs.
servers:
  - url: https://your-instance.example.com
    description: Production
  - url: http://localhost:2212
    description: Local API service
security: []
tags:
  - name: AI
  - name: Applications
  - name: Approval
  - name: Auth
  - name: Automations
  - name: Calls
  - name: Campaigns
  - name: Contact Analytics
  - name: Contact Metrics
  - name: Contact Notes
  - name: Contacts
  - name: Conversation Monitor
  - name: Conversations
  - name: Departments
  - name: Email
  - name: Escalation Dashboard
  - name: Event Logs
  - name: Google Sheets
  - name: Marketplace
  - name: Messages
  - name: Notification Sounds
  - name: Notifications
  - name: Org Snapshots
  - name: Organizations
  - name: Outreach
  - name: Outreach Metrics
  - name: Outreach Sources
  - name: Pipelines
  - name: Processes
  - name: Prompts
  - name: Reminders
  - name: Sms
  - name: Templates
  - name: Traces
  - name: Training
  - name: Upload
  - name: User Snapshots
  - name: Users
  - name: Vertical
  - name: Webchats
  - name: Webhook
paths:
  /api/upload:
    post:
      tags:
        - Upload
      summary: Upload one or more files to R2 storage
      description: >-
        Accepts up to 10 files as `multipart/form-data` under the `files` field.
        Each file is uploaded to R2 under a per-organization storage key and
        returned with a freshly generated signed URL.
      operationId: post_upload
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  maxItems: 10
                  items:
                    type: string
                    format: binary
                  description: >-
                    Up to 10 binary files, each ≤50 MB. Field name must be
                    exactly `files`.
              required:
                - files
              description: >-
                Multipart form. Send each file as a separate `files` part.
                Example with curl: `curl -F "files=@invoice.pdf" -F
                "files=@receipt.png" -H "Authorization: Bearer $TOKEN"
                /api/upload`.
              example:
                files:
                  - '<binary: invoice.pdf>'
                  - '<binary: receipt.png>'
      responses:
        '200':
          description: Files uploaded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadFilesResponse'
        '400':
          description: No files uploaded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadErrorResponse'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadErrorResponse'
        '500':
          description: Failed to upload files
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadErrorResponse'
        '503':
          description: File upload service not configured
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    UploadFilesResponse:
      type: object
      properties:
        files:
          type: array
          items:
            $ref: '#/components/schemas/UploadFileDto'
      required:
        - files
      additionalProperties: true
      example:
        files:
          - key: orgs/65b1f0a2c3d4e5f6a7b8c9d0/uploads/2026-05-18/invoice.pdf
            type: application/pdf
            name: invoice.pdf
            size: 184221
            signedUrl: https://r2.example.com/orgs/65b1.../invoice.pdf?token=...
            bucket: tether-uploads
    UploadErrorResponse:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
      additionalProperties: true
      example:
        error: NO_FILES
        message: No files uploaded
    UploadFileDto:
      type: object
      properties:
        key:
          type: string
          description: R2 storage key
        type:
          type: string
          description: MIME type
        name:
          type: string
          description: Original filename
        size:
          type: integer
        signedUrl:
          type: string
          description: Short-lived signed URL for immediate access
        bucket:
          type: string
      required:
        - key
        - type
        - name
        - size
        - signedUrl
        - bucket
      additionalProperties: true
      example:
        key: orgs/65b1f0a2c3d4e5f6a7b8c9d0/uploads/2026-05-18/invoice.pdf
        type: application/pdf
        name: invoice.pdf
        size: 184221
        signedUrl: https://r2.example.com/orgs/65b1.../invoice.pdf?token=...
        bucket: tether-uploads
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````