---
**📚 Main Documentation:** [Hoko API Documentation (llms.txt)](https://hoko.to/docs/llms.txt)
This is an individual endpoint documentation file. For the complete API reference, see the main documentation above.
---
# (DELETE) Delete collections
Delete one or more collections using soft delete.
**Category:** Collections
## Endpoint

DELETE /api/collections

Delete one or more collections using soft delete. Soft delete marks collections as deleted without permanently removing them from the database.

Accepts an array of collection IDs to delete. All specified collections must belong to your workspace.

**Endpoint**

```text
DELETE /api/collections
```

## Authentication

Requires authentication with an API key that has the collectionsWrite scope.

## Request Body

The request body must be an array of collection IDs (UUIDs) to delete.

You can delete up to 10,000 collections in a single request. Requests above 10,000 IDs are rejected.

| Parameter | Type | Required | Location | Description |
|---|---|---|---|---|
| body | array<string> | Yes | body | Array of collection IDs (UUIDs) to delete. All IDs must be valid and belong to your workspace. |

> **Warning: Request Size**
> Ensure the request body contains at least one valid collection ID.

## Status Codes

### 200

Collections deleted successfully.

**Request**

```bash
curl -X DELETE "https://hoko.to/api/collections" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '[
    "550e8400-e29b-41d4-a716-446655440000"
  ]'
```

**Request**

```javascript
const response = await fetch("https://hoko.to/api/collections", {
  method: "DELETE",
  headers: {
    "Authorization": "Bearer <API_KEY>",
    "Content-Type": "application/json"
  },
  body: JSON.stringify([
    "550e8400-e29b-41d4-a716-446655440000"
  ])
});
```

**Response**

```json
{
  "deletedIds": ["550e8400-e29b-41d4-a716-446655440000"]
}
```

### 400

Invalid request body (missing IDs, invalid UUIDs, or IDs not found in your workspace).

**Request**

```bash
curl -X DELETE "https://hoko.to/api/collections" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '[
    "invalid-id"
  ]'
```

**Request**

```javascript
const response = await fetch("https://hoko.to/api/collections", {
  method: "DELETE",
  headers: {
    "Authorization": "Bearer <API_KEY>",
    "Content-Type": "application/json"
  },
  body: JSON.stringify([
    "invalid-id"
  ])
});
```

**Response**

```json
{
  "error": {
    "en": "Invalid request",
    "ar": "طلب غير صالح"
  }
}
```

### 401

Invalid or missing API key.

**Request**

```bash
curl -X DELETE "https://hoko.to/api/collections" \
  -H "Authorization: Bearer invalid_key"
```

**Request**

```javascript
const response = await fetch("https://hoko.to/api/collections", {
  method: "DELETE",
  headers: {
    "Authorization": "Bearer invalid_key"
  }
});
```

**Response**

```json
{
  "error": {
    "en": "Invalid API key",
    "ar": "مفتاح API غير صالح"
  }
}
```

### 403

API key does not have the required collectionsWrite scope.

**Request**

```bash
curl -X DELETE "https://hoko.to/api/collections" \
  -H "Authorization: Bearer <API_KEY>"
```

**Request**

```javascript
const response = await fetch("https://hoko.to/api/collections", {
  method: "DELETE",
  headers: {
    "Authorization": "Bearer <API_KEY>"
  }
});
```

**Response**

```json
{
  "error": {
    "en": "Missing required scopes",
    "ar": "الصلاحيات المطلوبة مفقودة"
  },
  "missingScopes": ["collectionsWrite"]
}
```

### 429

Rate limit exceeded. Check X-RateLimit-* headers for details.

**Request**

```bash
curl -X DELETE "https://hoko.to/api/collections" \
  -H "Authorization: Bearer <API_KEY>"
```

**Request**

```javascript
const response = await fetch("https://hoko.to/api/collections", {
  method: "DELETE",
  headers: {
    "Authorization": "Bearer <API_KEY>"
  }
});
```

**Response**

```json
{
  "error": {
    "en": "Rate limit exceeded",
    "ar": "تم تجاوز حد المعدل"
  },
  "retryAfter": 60
}
```

## Examples

**Request**

```bash
curl -X DELETE "https://hoko.to/api/collections" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '[
    "550e8400-e29b-41d4-a716-446655440000"
  ]'
```

**Request**

```javascript
const response = await fetch("https://hoko.to/api/collections", {
  method: "DELETE",
  headers: {
    "Authorization": "Bearer <API_KEY>",
    "Content-Type": "application/json"
  },
  body: JSON.stringify([
    "550e8400-e29b-41d4-a716-446655440000"
  ])
});
const result = await response.json();
```

**Response**

```json
{
  "deletedIds": ["550e8400-e29b-41d4-a716-446655440000"]
}
```

> **Warning: Important Note**
> Deleted collections cannot be restored through the API. Links that belong to deleted collections will still exist but may need to be moved to active collections for proper organization.

---

**Back to main documentation:** [Hoko API Documentation (llms.txt)](https://hoko.to/docs/llms.txt)