## List clients of a wait list record

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

Returns the CRM contacts and companies assigned as clients of a wait list record.

## 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 "https://vibecode.bitrix24.com/v1/booking-wait-list/37/clients" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl "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', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data } = await res.json()
const contacts = data.filter((client) => client.type.code === 'CONTACT')
console.log('Record contacts:', contacts.map((client) => client.id))
```

### JavaScript — OAuth application

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

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

## Response fields

| Field | Type | Description |
|------|-----|----------|
| `success` | boolean | `true` on success |
| `data` | array | Clients of the wait list record. A record without clients returns an empty array |
| `data[].id` | number | CRM contact or company ID. Get: [`GET /v1/contacts/:id`](/docs/entities/contacts/get), [`GET /v1/companies/:id`](/docs/entities/companies/get) |
| `data[].type.code` | string | Client type code: `CONTACT` — contact, `COMPANY` — company. Dictionary: [`GET /v1/booking-client-types`](/docs/entities/booking-client-types) |
| `data[].type.module` | string | Client type module: `crm` |

## Response example

```json
{
  "success": true,
  "data": [
    {
      "id": 3013,
      "type": {
        "code": "CONTACT",
        "module": "crm"
      }
    },
    {
      "id": 3149,
      "type": {
        "code": "COMPANY",
        "module": "crm"
      }
    }
  ]
}
```

## 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 | `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 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)
- [Replace clients of a wait list record](/docs/entities/booking-wait-list/clients-set)
- [Remove clients from a wait list record](/docs/entities/booking-wait-list/clients-delete)
- [Get an entry](/docs/entities/booking-wait-list/get)
- [Booking client types](/docs/entities/booking-client-types)
