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

<ParamField body="key" type="string" required>
  The storage key of the file to delete (returned from the [upload](/api-reference/storage/upload-file) endpoint).
</ParamField>

## Response

<ResponseField name="key" type="string">
  The key of the deleted file.
</ResponseField>

## Example

<CodeGroup>
  ```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();
  ```
</CodeGroup>

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