---
title: "Delete an uploaded file"
method: DELETE
path: "/api/fleet/agents/files/{fileId}"
tags: ["Elastic Agents"]
---

# Delete an uploaded file

`DELETE /api/fleet/agents/files/{fileId}`

**Spaces method and path for this operation:**

<div><span class="operation-verb delete">delete</span>&nbsp;<span class="operation-path">/s/{space_id}/api/fleet/agents/files/{fileId}</span></div>

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Delete a file uploaded by an agent.<br/><br/>[Required authorization] Route required privileges: fleet-agents-all.

## Path parameters

- `fileId` string, required

## Headers

- `kbn-xsrf` string, required

## Response `200`

Successful response

- object
  - `deleted` boolean, required
  - `id` string, required

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.net/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.net/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/kibana-apis/revisions/deb2e8b751e7/schema)
