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

# Delete file or directory

> Delete a file or directory



## OpenAPI

````yaml /reference/sandbox-api/openapi.json delete /filesystem/{path}
openapi: 3.0.0
info:
  description: API for manipulating filesystem, processes and network.
  title: Sandbox API
  contact: {}
  version: 0.0.1
servers:
  - url: https://{sandbox_host}
    description: >-
      Host from the sandbox's returned url, without the scheme or trailing
      slash.
    variables:
      sandbox_host:
        default: sandbox.example.com
security:
  - BearerAuth: []
paths:
  /filesystem/{path}:
    delete:
      tags:
        - filesystem
      summary: Delete file or directory
      description: Delete a file or directory
      parameters:
        - description: File or directory path
          name: path
          in: path
          required: true
          schema:
            type: string
        - description: Delete directory recursively
          name: recursive
          in: query
          schema:
            type: boolean
      responses:
        '200':
          description: Success message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
        '404':
          description: File or directory not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unprocessable entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SuccessResponse:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          example: File created successfully
        path:
          type: string
          example: /path/to/file
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          example: Error message
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Sandbox access token created through POST /v1/token.

````