لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/entities/bookings.md فهرس التوثيق — /llms.txt
مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.
Bookings
Bookings reserve Bitrix24 account resources for a given time interval: create, get by ID, list and search by date range, update, and delete. Each booking is tied to one or more resources and stores a period with a start and an end.
Bitrix24 API: booking.v1.booking.*
Scope: booking
Create a booking
POST /v1/bookings
Creates a new booking on the Bitrix24 account. Fields are passed flat at the root of the JSON.
Request fields (body)
| Field | Type | Required | Description |
|---|---|---|---|
FieldresourceIds |
Typenumber[] | Requiredyes | DescriptionIds of the resources the booking reserves. The array cannot be empty. The identifiers come from List booking resources |
FielddatePeriod |
Typeobject | Requiredyes | DescriptionBooking period |
FielddatePeriod.from.timestamp |
Typenumber | Requiredyes | DescriptionPeriod start, Unix seconds |
FielddatePeriod.from.timezone |
Typestring | Requiredyes | DescriptionTime zone of the start in IANA format, e.g. UTC |
FielddatePeriod.to.timestamp |
Typenumber | Requiredyes | DescriptionPeriod end, Unix seconds |
FielddatePeriod.to.timezone |
Typestring | Requiredyes | DescriptionTime zone of the end in IANA format |
Fieldname |
Typestring | Requiredno | DescriptionBooking name. May be null |
Fielddescription |
Typestring | Requiredno | DescriptionBooking description. May be null |
Examples
curl — personal key
curl -X POST "https://vibecode.bitrix24.com/v1/bookings" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"resourceIds": [1],
"datePeriod": {
"from": { "timestamp": 1780132384, "timezone": "UTC" },
"to": { "timestamp": 1780135984, "timezone": "UTC" }
},
"name": "Meeting room for the demo",
"description": "Meeting room booking"
}'
curl — OAuth application
curl -X POST "https://vibecode.bitrix24.com/v1/bookings" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"resourceIds": [1],
"datePeriod": {
"from": { "timestamp": 1780132384, "timezone": "UTC" },
"to": { "timestamp": 1780135984, "timezone": "UTC" }
},
"name": "Meeting room for the demo",
"description": "Meeting room booking"
}'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/bookings', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
resourceIds: [1],
datePeriod: {
from: { timestamp: 1780132384, timezone: 'UTC' },
to: { timestamp: 1780135984, timezone: 'UTC' },
},
name: 'Meeting room for the demo',
description: 'Meeting room booking',
}),
})
const { success, data } = await res.json()
console.log('Booking ID:', data.id)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/bookings', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
resourceIds: [1],
datePeriod: {
from: { timestamp: 1780132384, timezone: 'UTC' },
to: { timestamp: 1780135984, timezone: 'UTC' },
},
name: 'Meeting room for the demo',
description: 'Meeting room booking',
}),
})
const { success, data } = await res.json()
Response fields
The full object of the created booking is returned.
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | DescriptionAlways true on success |
Fielddata.id |
Typenumber | DescriptionId of the created booking |
Fielddata.name |
Typestring | null | DescriptionBooking name |
Fielddata.description |
Typestring | null | DescriptionBooking description |
Fielddata.resourceIds |
Typenumber[] | DescriptionIds of the reserved resources |
Fielddata.datePeriod |
Typeobject | DescriptionBooking period: from and to are ISO 8601 date-time strings |
Response example
{
"success": true,
"data": {
"id": 27,
"name": "Meeting room for the demo",
"description": "Meeting room booking",
"resourceIds": [1],
"datePeriod": {
"from": "2026-05-30T09:13:04+00:00",
"to": "2026-05-30T10:13:04+00:00"
}
}
}
Error response example
422 — required fields not passed:
{
"success": false,
"error": {
"code": "BITRIX_ERROR",
"message": "Required fields: resourceIds, datePeriod"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP422 | CodeBITRIX_ERROR |
DescriptionRequired fields resourceIds and/or datePeriod not passed. Message: Required fields: resourceIds, datePeriod |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionAn empty resourceIds array was passed. Message: Empty resource collection |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe API key does not have the booking scope |
| HTTP401 | CodeMISSING_API_KEY |
DescriptionThe X-Api-Key header was not passed |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe API key has no configured tokens |
Full list of common API errors — Errors.