# Delete a file from a session mount

**Documentation:** /reference/api-reference/tool-router/postToolRouterSessionBySessionIdMountsByMountIdDelete

Deletes a file from a workbench session storage mount. S3 delete is idempotent — deleting a non-existent file succeeds silently.

---

## POST `/api/v3/tool_router/session/{session_id}/mounts/{mount_id}/delete`

**Endpoint:** `https://backend.composio.dev/api/v3/tool_router/session/{session_id}/mounts/{mount_id}/delete`

**Summary:** Delete a file from a session mount

Deletes a file from a workbench session storage mount. S3 delete is idempotent — deleting a non-existent file succeeds silently.

### Authentication

**ApiKeyAuth** - API Key in `header` header `x-api-key` OR **UserApiKeyAuth** - API Key in `header` header `x-user-api-key`

### Path Parameters

- `session_id` (string (toolRouterSessionId)) *(required)*: The unique identifier of the tool router session
- `mount_id` (string) *(required)*: ID of the storage mount

### Request Body

**Schema:**

- `mount_relative_path` (string) *(required)*: Relative file path within the mount

**Example:**

```json
{
  "mount_relative_path": "string"
}
```

### Responses

#### 200 - File deleted successfully

**Response Schema:**

- `mount_relative_path` (string) *(required)*: Relative file path that was deleted
- `sandbox_mount_prefix` (string) *(required)*: Absolute mount path inside the sandbox (e.g. /mnt/files)

**Example Response:**

```json
{
  "mount_relative_path": "string",
  "sandbox_mount_prefix": "string"
}
```

#### 400 - Bad request

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 401 - Unauthorized

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 404 - Session or mount not found

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 500 - Internal server error

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

### Example cURL Request

```bash
curl -X POST "https://backend.composio.dev/api/v3/tool_router/session/string/mounts/string/delete" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mount_relative_path": "string"
  }'
```