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

# Delete a file

> Delete a File.

`DELETE /api/v1/cloud/files/{file_id}`

Deletes a File and returns a deletion confirmation.

## Path parameters

| Parameter | Type   | Description                     |
| --------- | ------ | ------------------------------- |
| `file_id` | string | File ID with the `file_` prefix |

## Headers

| Header          | Required | Description         |
| --------------- | -------- | ------------------- |
| `Authorization` | Yes      | `Bearer $QODER_PAT` |

## Example request

```bash theme={null}
curl -X DELETE https://api.qoder.com/api/v1/cloud/files/file_019e3bb8c1387743bf4ef115aae5acb1 \
  -H "Authorization: Bearer $QODER_PAT"
```

## Example response

**HTTP 200 OK**

```json theme={null}
{
  "id": "file_019e3bb8c1387743bf4ef115aae5acb1",
  "type": "file_deleted"
}
```

Successful deletion is signalled by `"type": "file_deleted"` in the response body.

## Errors

| HTTP | Type                   | Trigger                                      |
| ---- | ---------------------- | -------------------------------------------- |
| 401  | `authentication_error` | Missing or invalid authentication token      |
| 404  | `not_found_error`      | File does not exist                          |
| 409  | `conflict_error`       | File is still referenced by active resources |

See [Errors](/cloud-agents/api/conventions/errors) for the full error envelope.

## Related

<CardGroup cols={2}>
  <Card title="Attach and download files" icon="paperclip" href="/cloud-agents/files">
    Upload files to give your agent context, and download files it produces.
  </Card>
</CardGroup>
