---
title: "Remove a file from a data lake"
method: DELETE
path: "/api/v1/data-lakes/{id}/files/{file_id}"
tags: ["Data Lakes"]
---

# Remove a file from a data lake

`DELETE /api/v1/data-lakes/{id}/files/{file_id}`

## Request

- Base URL: `https://your-deployment.example.com`
- URL: `https://your-deployment.example.com/api/v1/data-lakes/{id}/files/{file_id}`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Drops the file from the lake. Only membership changes: the file itself and its indexed passages are untouched, and the file's owner still finds it in their own library. Re-adding it within about 30 minutes (`POST` on the same path) restores the membership it had.

## Path parameters

- `id` string, required
- `file_id` string, required

## Response `200`

The file is no longer a member; the lake's updated totals.

- RemoveDataLakeFileResponse200
  - `lake_id` string, required
  - `file_id` string, required
  - `file_count` integer, required
  - `total_size_bytes` number, required

## Other responses

- `401`: Missing or invalid credentials.
- `403`: The API key lacks `datalake:write`, the caller can read this lake but may not change its membership (including every built-in lake, which is read-only), or Data Lakes are disabled on this deployment.
- `404`: The lake is not visible to the caller, or the file is not a current member of it.
- `405`: The path does not serve this HTTP method.
- `422`: Request failed validation.
- `429`: Per-user rate limit exceeded.

---

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