> ## 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 Session File

> Delete a file from the session's uploads directory.

## Overview

Removes a file previously uploaded via `POST /browser/sessions/{id}/files`. The `filename` path segment must be URL-encoded and cannot contain path separators. Deleting a non-existent file returns `404`.

## Path Parameters

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

<ParamField path="filename" type="string" required={true}>
  File name to delete. Must match exactly the `filename` used at upload time, URL-encoded.
</ParamField>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE "https://api.scrapengine.io/api/v1/browser/sessions/baa3f390-fa6e-4a24-b84a-a575a5f3a9c7/files/resume.pdf" \
    -H "Authorization: Bearer $SCRAPENGINE_API_KEY"
  ```
</CodeGroup>

## Response

### Success Response (204)

No content.

### Error Responses

| Status | Description                                                      |
| ------ | ---------------------------------------------------------------- |
| `400`  | Invalid `filename` — contains a path separator or is `.` / `..`. |
| `401`  | Unauthorized — invalid or missing API key.                       |
| `404`  | Session not found, or no such file in the uploads directory.     |
