For AI agents: markdown of this page — /docs-content-en/entities/booking-resource-types/update.md documentation index — /llms.txt

Update: Booking resource types

PATCH /v1/booking-resource-types/:id

Changes the fields of a booking resource type 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. Every request needs a new code — see "Known specifics".

Parameters

Parameter Type Required Description
Parameterid (path) Typenumber Requiredyes DescriptionType identifier. List: GET /v1/booking-resource-types

Request fields (body)

Field Type Required Description
Fieldcode Typestring Requiredyes DescriptionNew symbolic code of the type. Must differ from the current code and from the codes of other types
Fieldname Typestring Requiredno DescriptionType name
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 message template: inanimate, animate, inanimate_long. Saved, but not returned in the type card
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

Terminal
curl -X PATCH "https://vibecode.bitrix24.com/v1/booking-resource-types/31" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Nail technicians",
    "code": "master-2"
  }'

curl — OAuth application

Terminal
curl -X PATCH "https://vibecode.bitrix24.com/v1/booking-resource-types/31" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Nail technicians",
    "code": "master-2"
  }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/booking-resource-types/31', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Nail technicians',
    code: 'master-2',
  }),
})

const { data } = await res.json()
console.log(data.name, data.code)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/booking-resource-types/31', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Nail technicians',
    code: 'master-2',
  }),
})

const { data } = await res.json()
console.log(data.name, data.code)

Response fields

Field Type Description
Fieldsuccess Typeboolean Descriptiontrue on success
Fielddata Typeobject DescriptionCard of the type after the change. The card fields are listed in the "Response fields" section of the Get a booking resource type page

Response example

JSON
{
  "success": true,
  "data": {
    "id": 31,
    "code": "master-2",
    "name": "Nail technicians",
    "senderCode": null,
    "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,
    "templateTypeConfirmation": "inanimate",
    "templateTypeReminder": "base",
    "templateTypeFeedback": "inanimate",
    "templateTypeDelayed": "inanimate"
  }
}

Error response example

422 — the current code is passed in the body:

JSON
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "Resource type with code \"master\" already exists",
    "b24Code": "1011"
  }
}

Errors

HTTP Code Description
HTTP404 CodeENTITY_NOT_FOUND DescriptionNo type with this id. Message Booking record not found
HTTP422 CodeBITRIX_ERROR Descriptioncode matches the current code or the code of another type, b24Code 1011
HTTP422 CodeBITRIX_ERROR DescriptionThe body has no code. Message Internal server error.
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 type with a get request before retrying

Full list of common API errors — Errors.

Known specifics

An update requires a new code. A request without code is rejected with 422 BITRIX_ERROR and the message Internal server error.; a request with the current code is rejected with 422 BITRIX_ERROR saying that this code already exists. To change other fields and keep the original code, make two requests: the first with a temporary code, the second with the original one.

See also