# List booking wait list records

`GET /v1/booking-wait-list`

Returns all wait list records — the queue of clients for whom no free booking slot was found.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|----------|
| `filter[createdWithin][from]` (query) | string | no | Start of the record creation date range. Passed together with `filter[createdWithin][to]`. Bitrix24 rejects the filter with `422 BITRIX_ERROR` — see "Known specifics" |
| `filter[createdWithin][to]` (query) | string | no | End of the record creation date range. Passed together with `filter[createdWithin][from]`. Bitrix24 rejects the filter with `422 BITRIX_ERROR` — see "Known specifics" |

**Pagination.** There is no paging: the list returns all records in one response, up to 5000. The `limit`, `offset` and `order` parameters are not accepted — a request with them is rejected with `400 INVALID_PARAMS`.

## Examples

### curl — personal key

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

### curl — OAuth application

```bash
curl "https://vibecode.bitrix24.com/v1/booking-wait-list" \
  -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', {
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})

const { data, meta } = await res.json()
console.log(meta.total, data.map((item) => item.note))
```

### JavaScript — OAuth application

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

const { data, meta } = await res.json()
console.log(meta.total, data.map((item) => item.note))
```

## Response fields

| Field | Type | Description |
|------|-----|----------|
| `success` | boolean | `true` on success |
| `data` | array | Array of wait list records |
| `data[].id` | number | Record identifier |
| `data[].note` | string \| null | Note on the record. `null` — no note |
| `meta.total` | number | Number of records in the response |
| `meta.hasMore` | boolean | Always `false`: the list is returned in full |

## Response example

```json
{
  "success": true,
  "data": [
    {
      "id": 5,
      "note": null
    },
    {
      "id": 27,
      "note": "Call back after 16:00"
    },
    {
      "id": 29,
      "note": null
    }
  ],
  "meta": {
    "total": 3,
    "hasMore": false
  }
}
```

## Error response example

400 — the request contains the `limit` parameter:

```json
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "Only filter is supported; Bitrix24 ignores order"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|----------|
| 400 | `INVALID_PARAMS` | A parameter other than `filter` is passed, for example `limit`, `offset` or `order`. Message `Only filter is supported; Bitrix24 ignores order` |
| 400 | `INVALID_PARAMS` | `filter` contains a field other than `createdWithin`. Message `Only createdWithin is supported; Bitrix24 ignores other wait list filters` |
| 400 | `INVALID_PARAMS` | `filter` is neither an object nor a JSON-encoded object. Message `filter must be an object` |
| 400 | `INVALID_PARAMS` | `filter[createdWithin]` lacks `from` or `to`. Message `createdWithin requires from and to date strings` |
| 422 | `BITRIX_ERROR` | `filter[createdWithin]` is passed. Message `Invalid date` — see "Known specifics" |
| 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_RESULT_TOO_LARGE` | The wait list holds more than 5000 records. Message `Narrow the wait list filter; more than 5000 records matched` |
| 502 | `BITRIX_PAGINATION_INCOMPLETE` | While the list was being collected, the wait list records shifted and one record was returned twice. Message `Bitrix24 wait list pagination did not progress`. Retry the request |
| 502 | `BITRIX_RESPONSE_INVALID` | Bitrix24 returned a list of an unexpected shape |

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

## Known specifics

**Filtering by creation date does not work.** Bitrix24 rejects `filter[createdWithin]` with `422 BITRIX_ERROR` and the message `Invalid date` for any date format. Request the list without `filter`: the response contains all wait list records.

**Record clients come from a separate request.** The list does not include the clients of the records. They are returned by [`GET /v1/booking-wait-list/:id/clients`](/docs/entities/booking-wait-list/clients).

## See also

- [Get a wait list record](/docs/entities/booking-wait-list/get)
- [Create a wait list record](/docs/entities/booking-wait-list/create)
- [Wait list clients](/docs/entities/booking-wait-list/clients)
- [Booking wait list](/docs/entities/booking-wait-list)
- [Errors](/docs/errors)
