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

# Get file or directory information

> Get content of a file or listing of a directory. Use Accept header to control response format for files.



## OpenAPI

````yaml /reference/sandbox-api/openapi.json get /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}:
    get:
      tags:
        - filesystem
      summary: Get file or directory information
      description: >-
        Get content of a file or listing of a directory. Use Accept header to
        control response format for files.
      parameters:
        - description: >-
            File or directory path. Relative paths are resolved against the
            filesystem working directory. For example, with a working directory
            of /app, GET /filesystem/workspace resolves to /app/workspace. To
            access the absolute path /workspace over HTTP, encode its leading
            slash as %2F: GET /filesystem/%2Fworkspace. The double-slash form
            GET /filesystem//workspace also addresses /workspace.
          name: path
          in: path
          required: true
          schema:
            type: string
        - description: Force download mode for files
          name: download
          in: query
          schema:
            type: boolean
      responses:
        '200':
          description: Directory listing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Directory'
            application/octet-stream:
              schema:
                type: string
                format: binary
        '404':
          description: File or directory not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
            application/octet-stream:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unprocessable entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
            application/octet-stream:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
            application/octet-stream:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    Directory:
      type: object
      required:
        - files
        - name
        - path
        - subdirectories
      properties:
        files:
          type: array
          items:
            $ref: '#/components/schemas/File'
        name:
          type: string
        path:
          type: string
        subdirectories:
          description: '@name Subdirectories'
          type: array
          items:
            $ref: '#/components/schemas/Subdirectory'
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          example: Error message
    File:
      type: object
      required:
        - group
        - lastModified
        - name
        - owner
        - path
        - permissions
        - size
      properties:
        group:
          type: string
        lastModified:
          type: string
        name:
          type: string
        owner:
          type: string
        path:
          type: string
        permissions:
          type: string
        size:
          type: integer
    Subdirectory:
      type: object
      required:
        - name
        - path
      properties:
        name:
          type: string
        path:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Sandbox access token created through POST /v1/token.

````