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

# List a directory

> List the files and directories in one sandbox directory, with size, permissions and modification time.



## OpenAPI

````yaml openapi/boat-v1.yaml GET /sandboxes/{sandboxId}/files/list
openapi: 3.1.0
info:
  title: Boat Public API v1
  version: 1.0.0
  description: >
    Public JSON API for creating, operating, prompting, observing, and exposing
    sandboxes from backend services, CI jobs, hosted workers, and Boat
    automation products.


    The v1 reference intentionally documents the developer integration surface
    only. Dashboard billing actions are not part of v1.
servers:
  - url: https://boat.dev/api/v1
security:
  - BoatBearerAuth: []
tags:
  - name: Boat
    description: >-
      Unified Boat account, setup, lifecycle, prompting, event history, desktop
      access, and SSH operations.
paths:
  /sandboxes/{sandboxId}/files/list:
    get:
      tags:
        - Boat
      summary: List a directory in a sandbox
      description: >-
        One level, sorted by name. A symlink is listed as a symlink, not
        followed. Defaults to /home/user. Needs `file.read`.
      operationId: listFiles
      parameters:
        - $ref: '#/components/parameters/SandboxId'
        - name: path
          in: query
          schema:
            type: string
            default: /home/user
      responses:
        '200':
          description: Directory entries.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileListResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
components:
  parameters:
    SandboxId:
      name: sandboxId
      in: path
      required: true
      schema:
        type: string
        pattern: ^bx_[23456789abcdefghjkmnpqrstuvwxyz]{8}$
      description: Public Sandbox id returned by create/list/get sandbox calls.
  schemas:
    FileListResponse:
      allOf:
        - $ref: '#/components/schemas/SuccessBase'
        - type: object
          required:
            - path
            - files
            - truncated
          properties:
            type:
              type: string
              const: file.list
            success:
              type: boolean
            path:
              type: string
            files:
              type: array
              items:
                $ref: '#/components/schemas/FileEntry'
            truncated:
              type: boolean
              description: True when the directory holds more than 10
              000 entries.: null
    SuccessBase:
      type: object
      required:
        - ok
        - type
      properties:
        ok:
          type: boolean
          examples:
            - true
        type:
          type: string
          description: Stable success envelope discriminator added by v1.
    FileEntry:
      type: object
      required:
        - name
        - path
        - isDir
        - isSymlink
        - size
        - mode
        - modifiedAt
      properties:
        name:
          type: string
        path:
          type: string
          description: Absolute path on the sandbox.
        isDir:
          type: boolean
        isSymlink:
          type: boolean
        size:
          type: integer
        mode:
          type: string
          description: Octal permission bits, for example "0644".
        modifiedAt:
          type: string
          format: date-time
    ErrorEnvelope:
      type: object
      required:
        - ok
        - type
        - status
        - code
        - message
        - error
        - requestId
      properties:
        ok:
          type: boolean
          examples:
            - false
        type:
          type: string
          examples:
            - sandbox.error
        status:
          type: integer
          examples:
            - 409
        code:
          type: string
          examples:
            - provider_not_configured
        message:
          type: string
          examples:
            - Prompting is locked until Codex is configured on the Agents page.
        requestId:
          type: string
          examples:
            - req_01HX...
        error:
          type: object
          required:
            - code
            - message
            - status
          properties:
            code:
              type: string
            message:
              type: string
            status:
              type: integer
            details:
              type: object
              additionalProperties: true
  responses:
    BadRequest:
      description: Invalid request body or parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            invalid:
              value:
                ok: false
                type: sandbox.error
                status: 400
                code: invalid_json
                message: Request body must be valid JSON.
                error:
                  code: invalid_json
                  message: Request body must be valid JSON.
                  status: 400
                requestId: req_01HX...
  securitySchemes:
    BoatBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: sandbox_api_key
      description: >-
        Boat bearer token in the form `boat_...`. Service API keys authenticate
        sandbox operations.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.