For AI agents: markdown of this page — /docs-content-en/entities/booking-resources/update.md documentation index — /llms.txt
Update: Booking resources
PATCH /v1/booking-resources/:id
Changes the fields of a booking resource that are passed in the request. Fields missing from the request body keep their previous values.
Fields go at the root of the JSON, without a fields wrapper. A resource with work hours set is not changed — see "Known specifics".
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | DescriptionResource identifier. List: GET /v1/booking-resources |
Request fields (body)
All fields are optional, but the body cannot be empty.
| Field | Type | Required | Description |
|---|---|---|---|
Fieldname |
Typestring | Requiredno | DescriptionResource name |
Fielddescription |
Typestring | null | Requiredno | DescriptionResource description |
FieldtypeId |
Typenumber | Requiredno | DescriptionResource type identifier. List: GET /v1/booking-resource-types |
FieldisMain |
Typeboolean | string | Requiredno | DescriptionMain resource. true / false or "Y" / "N" |
FieldisInfoNotificationOn |
Typeboolean | string | Requiredno | DescriptionBooking info message to the client. true / false or "Y" / "N" |
FieldisConfirmationNotificationOn |
Typeboolean | string | Requiredno | DescriptionBooking confirmation request |
FieldisReminderNotificationOn |
Typeboolean | string | Requiredno | DescriptionBooking reminder |
FieldisFeedbackNotificationOn |
Typeboolean | string | Requiredno | DescriptionFeedback request |
FieldisDelayedNotificationOn |
Typeboolean | string | Requiredno | DescriptionMessage to a client who is running late |
FieldisCancellationNotificationOn |
Typeboolean | string | Requiredno | DescriptionBooking cancellation message to the client |
FieldsenderCode |
Typestring | null | Requiredno | DescriptionService that sends messages to the client, for example bitrix24 |
FieldinfoNotificationDelay |
Typenumber | null | Requiredno | DescriptionHow many seconds after the booking is made to send the booking info message |
FieldconfirmationNotificationDelay |
Typenumber | null | Requiredno | DescriptionHow many seconds before the booking to send the first confirmation request |
FieldconfirmationNotificationRepetitions |
Typenumber | null | Requiredno | DescriptionHow many times to repeat the confirmation request, not counting the first one |
FieldconfirmationNotificationRepetitionsInterval |
Typenumber | null | Requiredno | DescriptionInterval between repeats of the confirmation request, in seconds |
FieldconfirmationCounterDelay |
Typenumber | null | Requiredno | DescriptionHow many seconds before the booking an unconfirmed booking enters the counter |
FieldreminderNotificationDelay |
Typenumber | null | Requiredno | DescriptionHow many seconds before the booking to send the reminder. -1 — on the morning of the booking day |
FielddelayedNotificationDelay |
Typenumber | null | Requiredno | DescriptionAfter how many seconds of lateness to send the message to the client |
FielddelayedCounterDelay |
Typenumber | null | Requiredno | DescriptionAfter how many seconds of lateness the booking enters the calendar counter |
FieldcancellationNotificationDelay |
Typenumber | null | Requiredno | DescriptionDelay of the booking cancellation message, in seconds |
FieldtemplateTypeInfo |
Typestring | Requiredno | DescriptionBooking info message template: inanimate, animate, inanimate_long |
FieldtemplateTypeConfirmation |
Typestring | Requiredno | DescriptionConfirmation request template: inanimate, animate, inanimate_long |
FieldtemplateTypeReminder |
Typestring | Requiredno | DescriptionReminder template. The only value is base |
FieldtemplateTypeFeedback |
Typestring | Requiredno | DescriptionFeedback request template: inanimate, animate |
FieldtemplateTypeDelayed |
Typestring | Requiredno | DescriptionLate-arrival message template: inanimate, animate |
Examples
curl — personal key
curl -X PATCH "https://vibecode.bitrix24.com/v1/booking-resources/51" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"description": "Appointments by prior booking"}'
curl — OAuth application
curl -X PATCH "https://vibecode.bitrix24.com/v1/booking-resources/51" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"description": "Appointments by prior booking"}'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/booking-resources/51', {
method: 'PATCH',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ description: 'Appointments by prior booking' }),
})
const { data } = await res.json()
console.log(data.description)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/booking-resources/51', {
method: 'PATCH',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({ description: 'Appointments by prior booking' }),
})
const { data } = await res.json()
console.log(data.description)
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | Descriptiontrue on success |
Fielddata |
Typeobject | DescriptionCard of the resource after the change. The card fields are listed in the "Response fields" section of the Get a booking resource page |
Response example
{
"success": true,
"data": {
"id": 51,
"description": "Appointments by prior booking",
"typeId": 1,
"isMain": true,
"name": "Room 3",
"senderCode": "bitrix24",
"isInfoNotificationOn": false,
"isConfirmationNotificationOn": false,
"isReminderNotificationOn": false,
"isFeedbackNotificationOn": false,
"isDelayedNotificationOn": false,
"isCancellationNotificationOn": false,
"infoNotificationDelay": null,
"confirmationNotificationDelay": 86400,
"confirmationNotificationRepetitions": null,
"confirmationNotificationRepetitionsInterval": 10800,
"confirmationCounterDelay": 10800,
"reminderNotificationDelay": -1,
"delayedNotificationDelay": 300,
"delayedCounterDelay": 300,
"cancellationNotificationDelay": 600,
"templateTypeInfo": "inanimate",
"templateTypeConfirmation": "inanimate",
"templateTypeReminder": "base",
"templateTypeFeedback": "inanimate",
"templateTypeDelayed": "inanimate"
}
}
Error response example
422 — the resource has work hours set:
{
"success": false,
"error": {
"code": "BOOKING_RESOURCE_SCHEDULE_CONFLICT",
"message": "Bitrix24 resource.update removes work-hour slots. Explicitly remove the slots before editing this resource, then set the intended schedule again."
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionNo resource with this id. Message Booking record not found |
| HTTP422 | CodeBOOKING_RESOURCE_SCHEDULE_CONFLICT |
DescriptionThe resource has work hours set. The resource is not changed |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionNo resource type with this typeId, b24Code 1013 |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionInvalid template value, for example in templateTypeInfo. Message Invalid value of the templateTypeInfo field |
| HTTP400 | CodeINVALID_PARAMS |
Descriptionid is not a positive integer. Message id must be a positive safe integer |
| HTTP400 | CodeINVALID_PARAMS |
DescriptionEmpty body. Message Provide a non-empty object of fields |
| HTTP400 | CodeINVALID_PARAMS |
DescriptionA field not listed in the "Request fields (body)" table. Message Unknown booking field |
| HTTP400 | CodeINVALID_PARAMS |
DescriptionA field value is an object or an array. Message Fields must contain scalar values |
| HTTP400 | CodeREADONLY_FIELD |
Descriptionid is passed in the body. Message id is read-only |
| HTTP401 | CodeMISSING_API_KEY |
DescriptionThe X-Api-Key header is not passed |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe key has no Bitrix24 tokens |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe key does not have the booking scope |
| HTTP403 | CodeWRITE_BLOCKED_READONLY_KEY |
DescriptionThe key is in read-only mode |
| HTTP429 | CodeRATE_LIMITED |
DescriptionRequest rate limit exceeded. The effective cap is in the x-ratelimit-limit header |
| HTTP502 | CodeBITRIX_RESPONSE_INVALID |
DescriptionBitrix24 returned a response of an unexpected shape. If this happened while re-reading the card after the write, the changes are already saved — check the resource with a get request before retrying |
Full list of common API errors — Errors.
Known specifics
Remove the schedule from a resource with work hours first. Editing a resource erases its work hours, so when work hours are set, the request is rejected with 422 BOOKING_RESOURCE_SCHEDULE_CONFLICT and the resource is not changed. The order is: remove the work hours with DELETE /v1/booking-resources/:id/slots, change the resource, then set the work hours again with PUT /v1/booking-resources/:id/slots. Work hours are checked by a separate request before the edit. If work hours are set by a concurrent request in the gap between the check and the edit, the edit erases them, and both requests respond with success. Do not set work hours while editing the resource, and after the edit verify the schedule with GET /v1/booking-resources/:id/slots.