
## Update a booking

`PATCH /v1/bookings/:id`

Updates the fields of an existing booking. Pass only the fields you want to change, at the top level of the JSON body.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `id` (path) | number | yes | Booking ID. List: [`GET /v1/bookings`](/docs/entities/bookings/list) with the required `dateFrom` and `dateTo` |

## Request fields (body)

| Field | Type | Description |
|------|-----|---------|
| `resourceIds` | number[] | IDs of the resources the booking reserves. The array cannot be empty. The identifiers come from [List booking resources](/docs/entities/booking-resources/list) |
| `datePeriod` | object | Booking period |
| `datePeriod.from.timestamp` | number | Period start, Unix seconds |
| `datePeriod.from.timezone` | string | Time zone of the start in IANA format, e.g. `UTC` |
| `datePeriod.to.timestamp` | number | Period end, Unix seconds |
| `datePeriod.to.timezone` | string | Time zone of the end in IANA format |
| `name` | string | Booking name. May be `null` |
| `description` | string | Booking description. May be `null` |

## Examples

### curl — personal key

```bash
curl -X PATCH "https://vibecode.bitrix24.com/v1/bookings/27" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Meeting room (updated)",
    "description": "Changed description"
  }'
```

### curl — OAuth application

```bash
curl -X PATCH "https://vibecode.bitrix24.com/v1/bookings/27" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Meeting room (updated)",
    "description": "Changed description"
  }'
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/bookings/27', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Meeting room (updated)',
    description: 'Changed description',
  }),
})

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

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/bookings/27', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Meeting room (updated)',
    description: 'Changed description',
  }),
})

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data` | object | The updated booking |
| `data.id` | number | Booking ID |
| `data.name` | string \| null | Booking name |
| `data.description` | string \| null | Booking description |
| `data.resourceIds` | number[] | IDs of the reserved resources |
| `data.datePeriod` | object | Booking period: `from` and `to` are ISO 8601 date-time strings |

## Response example

```json
{
  "success": true,
  "data": {
    "id": 27,
    "name": "Meeting room (updated)",
    "description": "Changed description",
    "resourceIds": [1],
    "datePeriod": {
      "from": "2026-05-30T09:13:04+00:00",
      "to": "2026-05-30T10:13:04+00:00"
    }
  }
}
```

## Error response example

404 — booking not found:

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

## Errors

| HTTP | Code | Description |
|------|--------------|---------|
| 404 | `ENTITY_NOT_FOUND` | The booking with the given `id` does not exist. Message: `Booking not found` |
| 400 | `EMPTY_UPDATE_BODY` | The request body is empty: there are no fields to change |
| 422 | `BITRIX_ERROR` | An empty `resourceIds` array was passed. Message: `Empty resource collection` |
| 403 | `SCOPE_DENIED` | The API key does not have the `booking` scope |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only — see [access rights](/docs/access-rights) |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header was not passed |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |

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

## See also

- [Bookings](/docs/entities/bookings)
- [Create a booking](/docs/entities/bookings/create)
- [Get a booking](/docs/entities/bookings/get)
- [Delete a booking](/docs/entities/bookings/delete)
- [Batch](/docs/batch)
