---
title: "Delete a space"
---

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

Path: CloudRaker Paperwork API › Spaces

`DELETE /v1/spaces/{spaceId}`

Deletes every file in the space and closes it. Runs that already finished keep their results.

This is what expiry does when `expiresAt` passes — doing it by hand costs nothing extra. Only a space created with `POST /v1/spaces` can be deleted here; any other space answers `404`.

Repeating the call is safe: on a very large space it deletes the next batch of leftover files, so calling it until it stops finding files always finishes the job.

**Learn more:** [Spaces](https://docs.cloudraker.com/paperwork/developers/spaces)

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `spaceId` (`deleteApiSpace.path.spaceId`; string, required)
  - minLength 1

## Code samples

### cURL

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

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/v1/spaces/<spaceId>';
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/v1/spaces/<spaceId>"

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

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

print(response.text)
```

## Responses

### 204

Deleted.

### 400

Validation Error

#### Example

```json
{
  "success": false,
  "error": [
    null
  ],
  "data": null
}
```

- `success` (`deleteApiSpace.response.400.success`; boolean, required)
  - one of `false`
- `error` (`deleteApiSpace.response.400.error`; array<unknown>, required)
- `data` (`deleteApiSpace.response.400.data`; unknown, required)

### 404

Unknown space, or not an API-created space.

### 429

Rate limited. The `/v1` API allows at least **67 requests per minute per organization** (about 1,000 requests per 15 minutes) — a guaranteed floor, enforced per edge location, so a geographically spread caller may get more. Wait for the `Retry-After` interval and retry — the error is `retryable`.

#### Example

```json
{
  "code": "rate_limited",
  "message": "string",
  "retryable": true,
  "requestId": "string",
  "docUrl": "string"
}
```

- `code` (`deleteApiSpace.response.429.code`; string, required)
  - one of `"rate_limited"`
- `message` (`deleteApiSpace.response.429.message`; string, required)
- `retryable` (`deleteApiSpace.response.429.retryable`; boolean, required)
  - one of `true`
- `requestId` (`deleteApiSpace.response.429.requestId`; string, required)
- `docUrl` (`deleteApiSpace.response.429.docUrl`; string, optional)


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