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

# Download File

> Returns a time-limited signed URL that can be used to download the file. Verifies ownership through the form relationship.



## OpenAPI

````yaml GET /files/{id}
openapi: 3.1.0
info:
  title: FormBnB API
  version: 1.0.0
  description: API for FormBnB - Form backend as a service
servers:
  - url: https://api.formbnb.com
security: []
paths:
  /files/{id}:
    get:
      tags:
        - Files
      summary: Get a signed download URL for a file
      description: >-
        Returns a time-limited signed URL that can be used to download the file.
        Verifies ownership through the form relationship.
      parameters:
        - schema:
            type: string
            format: uuid
            description: File ID
          required: true
          name: id
          in: path
      responses:
        '200':
          description: File download information with signed URL
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileDownloadResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FilesErrorResponse'
        '403':
          description: Forbidden - no access to this file
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FilesErrorResponse'
        '404':
          description: File not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FilesErrorResponse'
        '500':
          description: Failed to generate download URL
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FilesErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    FileDownloadResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: File ID
        filename:
          type: string
          description: Original filename
        mime_type:
          type: string
          description: MIME type of the file
        size:
          type: number
          description: File size in bytes
        download_url:
          type: string
          format: uri
          description: Signed download URL
        expires_in:
          type: number
          description: URL expiration time in seconds
      required:
        - id
        - filename
        - mime_type
        - size
        - download_url
        - expires_in
    FilesErrorResponse:
      type: object
      properties:
        error:
          type: string
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT or API Key
      description: >-
        Authentication using either a FormBnB session JWT (issued by /auth) or
        an API key (prefixed with sk_). Both token types are passed as Bearer
        tokens in the Authorization header.

````