---
title: "Detach dataset file"
method: POST
path: "/dataset/{datasetId}/file/{fileId}/detach"
tags: ["Dataset File"]
---

# Detach dataset file

`POST /dataset/{datasetId}/file/{fileId}/detach`

## Request

- Base URL: `https://api.chatbotkit.com/api/v1`
- URL: `https://api.chatbotkit.com/api/v1/dataset/{datasetId}/file/{fileId}/detach`
- Auth: HTTP bearer

## Path parameters

- `datasetId` string, required: The ID of the dataset
- `fileId` string, required: The ID of the file

## Request body

- object
  - `deleteRecords` boolean: Delete records associated with the file

## Response `200`

The dataset file that was detached successfully

- object
  - `id` string, required: The ID of the dataset file

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