---
title: "Delete a file"
---

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

# Delete a file

Path: CloudRaker Paperwork API › Space Files

`DELETE /spaces/{spaceId}/files/{fileId}`

Deletes the file and its derived objects/artifacts; responds 204 with no body. Returns 404 if the file does not belong to :spaceId (cross-space deletes are hidden). Authorization: requires `space:contribute` on :spaceId (missing permission → 403; org admins bypass).

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `spaceId` (`deleteSpaceFile.path.spaceId`; string, required)
- `fileId` (`deleteSpaceFile.path.fileId`; string, required)

## Code samples

### cURL

```bash
curl --request DELETE \
  --url 'https://api.cloudraker.com/spaces/<spaceId>/files/<fileId>' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/spaces/<spaceId>/files/<fileId>';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.cloudraker.com/spaces/<spaceId>/files/<fileId>"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.text)
```

## Responses

### 204

File and its derived objects deleted (no body)


Source: https://docs.cloudraker.com/paperwork/api/space-files/delete-space-file/index.md
