# Update an entry

`PATCH /v1/booking-wait-list/:id`

Changes the note of a wait list record. The wait list is 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.

## Parameters

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

## Request fields (body)

| Field | Type | Required | Description |
|------|-----|:-----:|----------|
| `note` | string \| null | no | New note. An empty string `""` removes the note. `null` or omitting the field keeps the current note |

The body accepts no other fields. To change the record's clients, use [`PUT /v1/booking-wait-list/:id/clients`](/docs/entities/booking-wait-list/clients).

## Examples

### curl — personal key

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

### curl — OAuth application

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

### JavaScript — personal key

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

const { data } = await res.json()
console.log(data.note)
```

### JavaScript — OAuth application

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

const { data } = await res.json()
console.log(data.note)
```

## Response fields

| Field | Type | Description |
|------|-----|----------|
| `success` | boolean | `true` on success |
| `data.id` | number | Record identifier |
| `data.note` | string \| null | Note after the update. `null` — no note |

## Response example

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

## Error response example

404 — there is no 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` | There is no record with this `id`. Message `Booking record not found` |
| 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` |
| 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 |
| 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 did not confirm the update. Message `Bitrix24 did not confirm the booking operation` |
| 502 | `BITRIX_RESPONSE_INVALID` | Bitrix24 returned the record in an unexpected shape when it was re-read after the update. The update is already saved — check the record with a [get request](/docs/entities/booking-wait-list/get) before retrying |

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

## See also

- [Get a wait list record](/docs/entities/booking-wait-list/get)
- [List wait list records](/docs/entities/booking-wait-list/list)
- [Wait list clients](/docs/entities/booking-wait-list/clients)
- [Errors](/docs/errors)
