For AI agents: markdown of this page — /docs-content-en/entities/booking-resources/slots-delete.md documentation index — /llms.txt
Remove resource work hours
DELETE /v1/booking-resources/:id/slots
Removes all work hours of a booking resource in a single call. The resource remains; to set work hours again, use PUT /v1/booking-resources/:id/slots.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | DescriptionBooking resource ID. List: GET /v1/booking-resources |
Examples
curl — personal key
curl -X DELETE "https://vibecode.bitrix24.com/v1/booking-resources/65/slots" \
-H "X-Api-Key: YOUR_API_KEY" \
-w "%{http_code}\n"
curl — OAuth application
curl -X DELETE "https://vibecode.bitrix24.com/v1/booking-resources/65/slots" \
-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/65/slots', {
method: 'DELETE',
headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})
if (res.status === 204) {
console.log('Work hours removed')
} 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/65/slots', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
if (res.status === 204) {
console.log('Work hours removed')
} else {
const { error } = await res.json()
console.log(error.code, error.message)
}
Response
On successful removal, 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
404 — no resource with this id exists:
{
"success": false,
"error": {
"code": "ENTITY_NOT_FOUND",
"message": "Booking resource not found"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionNo resource with this id exists. Message Booking resource not found |
| 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 | CodeWRITE_BLOCKED_READONLY_KEY |
DescriptionThe key is in read-only mode. The request is rejected before it reaches Bitrix24 |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe key does not have the booking scope |
| 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 removal. Message Bitrix24 returned an invalid booking response |
Full list of common API errors — Errors.
Known specifics
A repeated removal also returns 204. For a resource without work hours, the call returns no error, so it can be repeated without checking the work hours first.