# Create an entry

`POST /v1/booking-wait-list`

Adds a record to the wait list — the queue of clients for whom no free time slot was available to book.

Fields go at the root of the JSON, without a `fields` wrapper.

## Request fields (body)

| Field | Type | Required | Description |
|------|-----|:-----:|----------|
| `note` | string \| null | no | Note on the record. If the field is omitted or `null`, the record is created without a note |

The body accepts no other fields. The record's clients are set by a separate [`PUT /v1/booking-wait-list/:id/clients`](/docs/entities/booking-wait-list/clients) request after creation.

## Examples

### curl — personal key

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/booking-wait-list" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"note": "Call back after 15:00"}'
```

### curl — OAuth application

```bash
curl -X POST "https://vibecode.bitrix24.com/v1/booking-wait-list" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"note": "Call back after 15:00"}'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/booking-wait-list', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ note: 'Call back after 15:00' }),
})

const { data } = await res.json()
console.log('Record ID:', data.id)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/booking-wait-list', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ note: 'Call back after 15:00' }),
})

const { data } = await res.json()
console.log('Record ID:', data.id)
```

## Response fields

On success, the HTTP status is `201 Created`.

| Field | Type | Description |
|------|-----|----------|
| `success` | boolean | `true` on success |
| `data.id` | number | Identifier of the created record. Pass it in the path of requests to the record, for example [`PUT /v1/booking-wait-list/:id/clients`](/docs/entities/booking-wait-list/clients) |
| `data.note` | string \| null | Note on the record. `null` — no note |

## Response example

```json
{
  "success": true,
  "data": {
    "id": 27,
    "note": "Call back after 15:00"
  }
}
```

## Error response example

400 — the body contains a field other than `note`:

```json
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "Only note can be written"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|----------|
| 400 | `INVALID_PARAMS` | The body contains a field other than `note`. Message `Only note can be written` |
| 400 | `INVALID_PARAMS` | `note` is neither a string nor `null`. Message `note must be a string or null` |
| 400 | `INVALID_PARAMS` | The body is not a JSON object, for example an array. Message `Body must be an object` |
| 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 |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is in read-only mode |
| 429 | `RATE_LIMITED` | Request rate exceeded. The effective cap is in the `x-ratelimit-limit` header |
| 502 | `BITRIX_RESPONSE_INVALID` | Bitrix24 returned a response of an unexpected shape. If this happened while re-reading the record after creation, the record has already been created — find it in the [list](/docs/entities/booking-wait-list/list) before retrying |

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

## See also

- [List wait list records](/docs/entities/booking-wait-list/list)
- [Update a wait list record](/docs/entities/booking-wait-list/update)
- [Wait list clients](/docs/entities/booking-wait-list/clients)
- [Book from the wait list](/docs/entities/booking-wait-list/booking)
- [Errors](/docs/errors)
