---
title: "List files and directories in space storage"
method: GET
path: "/space/{spaceId}/storage/list/{path}"
tags: ["Space Storage"]
---

# List files and directories in space storage

`GET /space/{spaceId}/storage/list/{path}`

## Request

- Base URL: `https://api.chatbotkit.com/api/v1`
- URL: `https://api.chatbotkit.com/api/v1/space/{spaceId}/storage/list/{path}`
- Auth: HTTP bearer

List files and directories in the space's storage. Supports both flat
and recursive listing. The path is specified in the URL after /list/.
Omit the path to list the root directory.

## Path parameters

- `spaceId` string, required: The ID of the space
- `path` string: The directory path (defaults to root)

## Query parameters

- `recursive` boolean: Whether to list files recursively

## Response `200`

The list of files was retrieved successfully

- object
  - `items` object[], required
    - `id` string: The ID of the file or directory
    - `path` string: The relative path of the file or directory
    - `size` number: The size of the file in bytes (0 for directories)
    - `updatedAt` number: The timestamp (ms) when the file was last modified
    - `isDirectory` boolean: Whether this is a directory
  - `nextToken` string: Token to use for next page of results

## Other responses

- `default`: An error response

---

[API](https://skmtc.dev/chatbotkit/apis/cbk-api.md) · [All operations](https://skmtc.dev/chatbotkit/apis/cbk-api/llms.txt) · [OpenAPI document](https://skmtc.dev/chatbotkit/apis/cbk-api/revisions/13d250576136?raw)
