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

# List Files

> List files.

- To list files within a workspace, the `prefix` (query parameter) must start with `workspaces/{workspace_id}/`
- Cannot list files across multiple workspaces, i.e., if the `prefix` does not start with `workspaces/{workspace_id}/`, it will return an empty list.



## OpenAPI

````yaml get /api/v1/files
openapi: 3.1.0
info:
  title: AskUI Workspaces API
  version: 0.2.15
servers: []
security: []
paths:
  /api/v1/files:
    get:
      tags:
        - files
      summary: List Files
      description: >-
        List files.


        - To list files within a workspace, the `prefix` (query parameter) must
        start with `workspaces/{workspace_id}/`

        - Cannot list files across multiple workspaces, i.e., if the `prefix`
        does not start with `workspaces/{workspace_id}/`, it will return an
        empty list.
      operationId: list_files_api_v1_files_get
      parameters:
        - name: prefix
          in: query
          required: false
          schema:
            type: string
            description: >-
              Prefix (path) to filter the files by. For folders it should end
              with `/`. Note that it is currently not possible to list files
              across workspaces but only within one workspace, i.e., which means
              that the prefix should start with `workspaces/{workspace_id}/`.
            default: ''
            title: Prefix
          description: >-
            Prefix (path) to filter the files by. For folders it should end with
            `/`. Note that it is currently not possible to list files across
            workspaces but only within one workspace, i.e., which means that the
            prefix should start with `workspaces/{workspace_id}/`.
        - name: delimiter
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Delimiter to group keys, e.g., `/` to group by folders, i.e., get
              files of the root folder or the folder identified by the prefix.
              If not provided, no folders are included in the response.
            title: Delimiter
          description: >-
            Delimiter to group keys, e.g., `/` to group by folders, i.e., get
            files of the root folder or the folder identified by the prefix. If
            not provided, no folders are included in the response.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            description: Maximum number of files to return per page
            default: 10
            title: Limit
          description: Maximum number of files to return per page
        - name: continuation_token
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Continuation token to get the next page of results (cursor-based
              pagination)
            title: Continuation Token
          description: >-
            Continuation token to get the next page of results (cursor-based
            pagination)
        - name: expand
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                uniqueItems: true
                items:
                  const: url
                  type: string
              - type: 'null'
            description: Expand the response with the signed URL to the file
            title: Expand
          description: Expand the response with the signed URL to the file
      responses:
        '200':
          description: Files listed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FilesListResponseDto'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringErrorResponse'
      security:
        - Bearer: []
        - Basic: []
components:
  schemas:
    FilesListResponseDto:
      properties:
        data:
          items:
            oneOf:
              - $ref: '#/components/schemas/FileDto'
              - $ref: '#/components/schemas/FolderDto'
            discriminator:
              propertyName: type
              mapping:
                file:
                  $ref: '#/components/schemas/FileDto'
                folder:
                  $ref: '#/components/schemas/FolderDto'
          type: array
          title: Data
        nextContinuationToken:
          anyOf:
            - type: string
            - type: 'null'
          title: Nextcontinuationtoken
      type: object
      required:
        - data
      title: FilesListResponseDto
    StringErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
      type: object
      required:
        - detail
      title: StringErrorResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    FileDto:
      properties:
        type:
          type: string
          const: file
          title: Type
          default: file
        name:
          type: string
          title: Name
        path:
          type: string
          title: Path
          description: Path to the file starting
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
          description: Signed URL to the file with a 1 hour TTL
        size:
          type: integer
          title: Size
          description: Size of the file in bytes
        lastModified:
          type: string
          format: date-time
          title: Lastmodified
      type: object
      required:
        - name
        - path
        - size
        - lastModified
      title: FileDto
    FolderDto:
      properties:
        type:
          type: string
          const: folder
          title: Type
          default: folder
        name:
          type: string
          title: Name
        path:
          type: string
          title: Path
      type: object
      required:
        - name
        - path
      title: FolderDto
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
    Basic:
      type: apiKey
      in: header
      name: Authorization

````