> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blaxel.ai/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 https://raw.githubusercontent.com/blaxel-ai/sandbox/refs/heads/main/sandbox-api/docs/openapi.yml get /filesystem/{path}
openapi: 3.0.0
info:
  contact: {}
  description: API for manipulating filesystem, processes and network.
  title: Sandbox API
  version: 0.0.1
servers:
  - url: https://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run
    variables:
      sandbox_id:
        default: unknown
      workspace_id:
        default: unknown
      region:
        default: unknown
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
          in: path
          name: path
          required: true
          schema:
            type: string
        - description: Force download mode for files
          in: query
          name: download
          schema:
            type: boolean
      responses:
        '200':
          description: Directory listing
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Directory'
                  - $ref: '#/components/schemas/FileWithContent'
                  - type: string
                    format: binary
            application/octet-stream:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Directory'
                  - $ref: '#/components/schemas/FileWithContent'
                  - 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:
      properties:
        files:
          items:
            $ref: '#/components/schemas/File'
          type: array
        name:
          type: string
        path:
          type: string
        subdirectories:
          description: '@name Subdirectories'
          items:
            $ref: '#/components/schemas/Subdirectory'
          type: array
      required:
        - files
        - name
        - path
        - subdirectories
      type: object
    FileWithContent:
      properties:
        content:
          type: string
        group:
          type: string
        lastModified:
          type: string
        name:
          type: string
        owner:
          type: string
        path:
          type: string
        permissions:
          type: string
        size:
          type: integer
      required:
        - content
        - group
        - lastModified
        - name
        - owner
        - path
        - permissions
        - size
      type: object
    ErrorResponse:
      properties:
        error:
          example: Error message
          type: string
      required:
        - error
      type: object
    File:
      properties:
        group:
          type: string
        lastModified:
          type: string
        name:
          type: string
        owner:
          type: string
        path:
          type: string
        permissions:
          type: string
        size:
          type: integer
      required:
        - group
        - lastModified
        - name
        - owner
        - path
        - permissions
        - size
      type: object
    Subdirectory:
      properties:
        name:
          type: string
        path:
          type: string
      required:
        - name
        - path
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````