For AI agents: markdown of this page — /docs-content-en/entities/bookings/update.md documentation index — /llms.txt
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 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 Booking resources |
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
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
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
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
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, each with timestamp and timezone |
Response example
{
"success": true,
"data": {
"id": 27,
"name": "Meeting room (updated)",
"description": "Changed description",
"resourceIds": [1],
"datePeriod": {
"from": { "timestamp": 1780132384, "timezone": "UTC" },
"to": { "timestamp": 1780135984, "timezone": "UTC" }
}
}
}
Error response example
404 — booking not found:
{
"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 |
| 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.