For AI agents: markdown of this page — /docs-content-en/entities/bookings/delete.md documentation index — /llms.txt

Delete a booking

DELETE /v1/bookings/:id

Deletes a booking by ID. A deleted booking cannot be restored through the API — create a new one if needed.

Parameters

Parameter Type Required Description
Parameterid (path) Typenumber Requiredyes DescriptionBooking ID

Examples

curl — personal key

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/bookings/27" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/bookings/27" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/bookings/27', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

if (res.status === 204) {
  console.log('Booking deleted')
}

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/bookings/27', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

if (res.status === 204) {
  console.log('Booking deleted')
}

Response

On successful deletion, the API returns HTTP status 204 No Content with an empty body. The success indicator is the response code, not the body.

Response example

http
HTTP/1.1 204 No Content

Error response example

404 — the booking is already deleted or does not exist:

JSON
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "booking not found"
  }
}

Errors

HTTP Code Description
HTTP404 CodeENTITY_NOT_FOUND DescriptionThe booking with the given id was not found or is already deleted. Message: booking not found
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the booking scope
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is read-only — see access rights
HTTP401 CodeMISSING_API_KEY DescriptionThe request was sent without the X-Api-Key header
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no configured tokens

Full list of common API errors — Errors.

See also