For AI agents: markdown of this page — /docs-content-en/entities/booking-resources/delete.md documentation index — /llms.txt
Delete: Booking resources
DELETE /v1/booking-resources/:id
Deletes a booking resource that has no future bookings. A deleted resource cannot be restored through the API — create a new one if needed.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | DescriptionResource identifier. List: GET /v1/booking-resources |
Examples
curl — personal key
curl -X DELETE "https://vibecode.bitrix24.com/v1/booking-resources/51" \
-H "X-Api-Key: YOUR_API_KEY" \
-w "%{http_code}\n"
curl — OAuth application
curl -X DELETE "https://vibecode.bitrix24.com/v1/booking-resources/51" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-w "%{http_code}\n"
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/booking-resources/51', {
method: 'DELETE',
headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})
if (res.status === 204) {
console.log('Deleted')
} else {
const { error } = await res.json()
console.log(error.code, error.message)
}
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/booking-resources/51', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
if (res.status === 204) {
console.log('Deleted')
} else {
const { error } = await res.json()
console.log(error.code, error.message)
}
Response
On successful deletion, the HTTP status is 204 No Content with an empty body. The status code signals success, not the body.
Response example
HTTP/1.1 204 No Content
Error response example
422 — the resource has future bookings:
{
"success": false,
"error": {
"code": "BITRIX_ERROR",
"message": "The resource can not be deleted. There are future bookings with that resource.",
"b24Code": "1008"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionNo resource with this id exists, including on a repeated deletion. Message Booking record not found |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionThe resource has future bookings. Message The resource can not be deleted. There are future bookings with that resource., b24Code 1008 |
| HTTP400 | CodeINVALID_PARAMS |
Descriptionid is not a positive integer. Message id must be a positive safe integer |
| 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 exceeded. The effective cap is in the x-ratelimit-limit header |
| HTTP502 | CodeBITRIX_RESPONSE_INVALID |
DescriptionBitrix24 did not confirm the deletion |
Full list of common API errors — Errors.
Known specifics
Future bookings are not deleted together with the resource. While the resource has a booking in the future, deletion is refused with 422 BITRIX_ERROR. First delete those bookings via DELETE /v1/bookings/:id, then delete the resource.