## Remove clients from a wait list record

`DELETE /v1/booking-wait-list/:id/clients`

Removes all clients from a wait list record in one call. The contacts and companies stay in CRM.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|----------|
| `id` (path) | number | yes | Wait list record ID. List: [`GET /v1/booking-wait-list`](/docs/entities/booking-wait-list/list) |

## Examples

### curl — personal key

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/booking-wait-list/37/clients" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/booking-wait-list/37/clients" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/booking-wait-list/37/clients', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data } = await res.json()
console.log('Record clients after removal:', data)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/booking-wait-list/37/clients', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { success, data } = await res.json()
```

## Response fields

The response contains the clients of the wait list record, read again after the removal.

| Field | Type | Description |
|------|-----|----------|
| `success` | boolean | `true` on success |
| `data` | array | Record clients after the removal |
| `data[].id` | number | CRM contact or company ID |
| `data[].type.code` | string | Client type code: `CONTACT` — contact, `COMPANY` — company |
| `data[].type.module` | string | Client type module: `crm` |

## Response example

```json
{
  "success": true,
  "data": []
}
```

## Error response example

404 — no wait list record with this `id`:

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Booking record not found"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|----------|
| 404 | `ENTITY_NOT_FOUND` | No wait list record with this `id`. Message `Booking record not found` |
| 400 | `INVALID_PARAMS` | `id` is not a positive integer. Message `id must be a canonical positive safe integer` |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is not passed |
| 401 | `TOKEN_MISSING` | The key has no Bitrix24 tokens |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only. The request is rejected before any call to Bitrix24 |
| 403 | `SCOPE_DENIED` | The key does not have the `booking` scope |
| 429 | `RATE_LIMITED` | Request rate exceeded. The effective cap is in the `x-ratelimit-limit` header |
| 502 | `BITRIX_RESPONSE_INVALID` | `Bitrix24 did not confirm the booking operation` — Bitrix24 did not confirm the removal |
| 502 | `BITRIX_RESPONSE_INVALID` | `Bitrix24 returned an unexpected booking response` — Bitrix24 returned a client list of an unexpected shape |

Full list of common API errors — [Errors](/docs/errors).

## See also

- [Wait list clients](/docs/entities/booking-wait-list/clients)
- [List clients of a wait list record](/docs/entities/booking-wait-list/clients-list)
- [Replace clients of a wait list record](/docs/entities/booking-wait-list/clients-set)
- [Delete an entry](/docs/entities/booking-wait-list/delete)
