---
title: "Permanently delete objects"
---

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

# Permanently delete objects

Path: CloudRaker Workspace API › Data Objects

`POST /spaces/{spaceId}/objects/{definitionId}/batch-delete`

Permanently deletes up to 200 objects of a definition in a space. The objects cannot be restored. Authorization: requires `space:contribute` on `:spaceId`. Lacking it gives **403** (no `space:read` gives 404). Body: `{ ids }` (1 to 200). An unknown id is ignored, so a retry is safe. Returns `{ deleted, ids }`: the count and the ids of the deleted objects.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `spaceId` (`batchDeleteObjects.path.spaceId`; string, required)
- `definitionId` (`batchDeleteObjects.path.definitionId`; string, required)

## Request body

_Required._

- `ids` (`batchDeleteObjects.ids`; array<string>, required) — The ids of the objects to delete permanently. An unknown id is ignored.
  - minLength 1

## Example request

```json
{
  "ids": [
    "string"
  ]
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.cloudraker.com/spaces/<spaceId>/objects/<definitionId>/batch-delete' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "ids": [
    "string"
  ]
}
'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/spaces/<spaceId>/objects/<definitionId>/batch-delete';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({ids: ['string']})
};

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>/objects/<definitionId>/batch-delete"

payload = { "ids": ["string"] }
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

The deleted count.

#### Example

```json
{
  "deleted": 0,
  "ids": [
    "string"
  ]
}
```

- `deleted` (`batchDeleteObjects.response.200.deleted`; number, required) — How many objects the request deleted.
- `ids` (`batchDeleteObjects.response.200.ids`; array<string>, required) — The ids of the deleted objects. An unknown id is not in this list.

### 403

Missing `space:contribute`.


Source: https://docs.cloudraker.com/workspace/api/data-objects/batch-delete-objects/index.md
