> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scrapengine.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete File

> Delete a file from the session workspace.

## Overview

Removes a single file from the session's workspace. To delete a directory use `DELETE /browser/sessions/{id}/fs/dir` with `recursive=true`. Path must be relative to the workspace root.

## Path Parameters

<ParamField path="id" type="string" required={true}>
  Browser session ID (UUID).
</ParamField>

## Query Parameters

<ParamField query="path" type="string" required={true}>
  Workspace-relative file path to delete.
</ParamField>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE -G "https://api.scrapengine.io/api/v1/browser/sessions/baa3f390-fa6e-4a24-b84a-a575a5f3a9c7/fs/file" \
    -H "Authorization: Bearer $SCRAPENGINE_API_KEY" \
    --data-urlencode "path=notes/todo.txt"
  ```
</CodeGroup>

## Response

### Success Response (204)

No content.

### Error Responses

| Status | Description                                                     |
| ------ | --------------------------------------------------------------- |
| `400`  | Invalid path.                                                   |
| `401`  | Unauthorized — invalid or missing API key.                      |
| `404`  | Session or file not found.                                      |
| `409`  | Target exists but is a directory. Use `DELETE /fs/dir` instead. |
