> ## 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.

# Delete File

> Deletes the file from both storage and database. Verifies ownership through the form relationship.



## OpenAPI

````yaml DELETE /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}:
    delete:
      tags:
        - Files
      summary: Delete a file
      description: >-
        Deletes the file from both storage and database. 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 deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FilesSuccessResponse'
        '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'
      security:
        - bearerAuth: []
components:
  schemas:
    FilesSuccessResponse:
      type: object
      properties:
        success:
          type: boolean
      required:
        - success
    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.

````