---
title: "Remove a file from a folder"
method: DELETE
path: "/workspaces/{id}/files/{file_id}"
tags: ["Folders"]
---

# Remove a file from a folder

`DELETE /workspaces/{id}/files/{file_id}`

## Request

- Base URL: `https://api.varg.ai/v2`
- URL: `https://api.varg.ai/v2/workspaces/{id}/files/{file_id}`
- Auth: HTTP bearer

Removes the file from this folder only. The file itself is kept and stays in any other folder. To delete the file, use `DELETE /files/{id}`.

## Path parameters

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

## Response `200`

File removed from the folder

- FolderFileRemoved
  - `unlinked` true, required
  - `file_id` string, required
  - `workspace_id` string, uuid, required: Resolved folder id.

## Other responses

- `401`: Missing or invalid API key / JWT
- `404`: Unknown folder (`workspace_not_found`) or the file is not in this folder (`file_not_in_workspace`)

## Changes

- **2026-10-20** `43bcf5ea398d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/varg/apis/varg-api/changes/workspaces/:id/files/:file_id/delete.md)

---

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