---
title: "Delete a file or directory from space storage"
method: POST
path: "/space/{spaceId}/storage/delete/{path}"
tags: ["Space Storage"]
---

# Delete a file or directory from space storage

`POST /space/{spaceId}/storage/delete/{path}`

## Request

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

Delete a file or directory from space storage. The path is specified
in the URL after /delete/. If recursive is true and the path is a
directory, all files within it will be deleted.

## Path parameters

- `spaceId` string, required: The ID of the space
- `path` string, required: The file or directory path

## Request body

- object
  - `recursive` boolean: Whether to delete directory contents recursively

## Response `200`

The file or directory was deleted successfully

- object
  - `path` string, required: The deleted file or directory path

## 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)
