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

# List Workspace Directory

> List one directory level, reachable from a session's workspace.

Paths are not confined to the workspace root: for a sandboxed
backend the reachable filesystem is the sandbox, and for a local
one the caller is already trusted with the host.



## OpenAPI

````yaml /versions/2.0.6dev/en/deploy/openapi.json get /workspace/directories
openapi: 3.1.0
info:
  title: AgentScope
  version: 2.0.6dev
servers: []
security: []
paths:
  /workspace/directories:
    get:
      tags:
        - workspace
      summary: List Workspace Directory
      description: |-
        List one directory level, reachable from a session's workspace.

        Paths are not confined to the workspace root: for a sandboxed
        backend the reachable filesystem is the sandbox, and for a local
        one the caller is already trusted with the host.
      operationId: list_workspace_directory_workspace_directories_get
      parameters:
        - name: agent_id
          in: query
          required: true
          schema:
            type: string
            title: Agent Id
        - name: session_id
          in: query
          required: true
          schema:
            type: string
            title: Session Id
        - name: path
          in: query
          required: false
          schema:
            type: string
            description: >-
              Absolute path, or one relative to the workspace root. Empty lists
              the workspace root itself.
            default: ''
            title: Path
          description: >-
            Absolute path, or one relative to the workspace root. Empty lists
            the workspace root itself.
        - name: x-user-id
          in: header
          required: true
          schema:
            type: string
            description: >-
              Caller's user ID. Temporary header-based identity; will be
              replaced by JWT auth.
            title: X-User-Id
          description: >-
            Caller's user ID. Temporary header-based identity; will be replaced
            by JWT auth.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DirectoryEntry'
                title: Response List Workspace Directory Workspace Directories Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    DirectoryEntry:
      properties:
        name:
          type: string
          title: Name
          description: The entry name, without any leading directory.
        is_dir:
          type: boolean
          title: Is Dir
          description: Whether the entry is itself a directory.
        size_bytes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Size Bytes
          description: >-
            File size in bytes. Always null for a directory, and null for a file
            the backend could not stat.
        updated_at:
          anyOf:
            - type: number
            - type: 'null'
          title: Updated At
          description: Last modification time as a Unix timestamp.
      type: object
      required:
        - name
        - is_dir
      title: DirectoryEntry
      description: One entry in a workspace directory listing.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````