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

# Delete File

> Delete a file from storage.

Delete a file from the room's R2 object storage by its key.

## Endpoint

```
DELETE /v1/accounts/:accountId/upload
```

## Authentication

**Bearer token** required.

## Request Body

**key** `string` *required*

The storage key of the file to delete (returned from the [upload](https://docs.collab-kit.com/api-reference/storage/upload-file.md) endpoint).

## Response

**key** `string`

The key of the deleted file.

## Example

```bash curl theme={null}
curl -X DELETE https://api.collab-kit.com/v1/accounts/${ACCOUNT_ID}/upload \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{"key": "c3003c93/uploads/screenshot.png"}'
```

```typescript JavaScript theme={null}
const res = await fetch(`https://api.collab-kit.com/v1/accounts/${accountId}/upload`, {
  method: 'DELETE',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ key: 'c3003c93/uploads/screenshot.png' }),
});
const { data } = await res.json();
```

```json Response theme={null}
{
  "type": "response",
  "success": true,
  "description": "File deleted",
  "data": {
    "key": "c3003c93/uploads/screenshot.png"
  },
  "error": null
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.