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

# Add a file to a data lake

`POST /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`

Makes an existing file a member of the lake. Takes no body. Idempotent: adding a file that is already a member succeeds and changes nothing. Outside the restore window below, a caller can add only their own files (or, as the lake's owner, the owner's files); any other file is a 404. Membership alone does not ingest the file - poll `GET /api/v1/data-lakes/{id}/files/{file_id}` until it is `ready` before relying on it in search. Re-adding a file within about 30 minutes of removing it restores the membership it had.

## Path parameters

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

## Response `200`

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

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

## Other responses

- `400`: The file does not meet the lake's admission policy (for example, its passages were chunked to a size the lake does not accept). Reprocess the file to the required size, then add it again.
- `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 does not exist, was deleted, or is not one the caller may add. Reported as one 404 so file ids cannot be probed.
- `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/0de0bdb0d113?raw)
