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

Delete: Booking resource types

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

Deletes a booking resource type that has never had resources. A deleted type cannot be restored through the API — create a new one if needed.

Parameters

Parameter Type Required Description
id (path) number yes Type identifier. List: GET /v1/booking-resource-types

Examples

curl — personal key

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/booking-resource-types/33" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -w "%{http_code}\n"

curl — OAuth application

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/booking-resource-types/33" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -w "%{http_code}\n"

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/booking-resource-types/33', {
  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

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/booking-resource-types/33', {
  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 — resources are bound to the type:

JSON
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "The type can not be deleted. There are resources of type",
    "b24Code": "1012"
  }
}

Errors

HTTP Code Description
404 ENTITY_NOT_FOUND The type with this id does not exist or was already deleted. Message Booking record not found
422 BITRIX_ERROR Resources are bound to the type. Message The type can not be deleted. There are resources of type, b24Code 1012
422 BITRIX_ERROR The type's resources have been deleted, but the type has had resources before. Message The field TYPE_ID is required., b24Code 1012
400 INVALID_PARAMS id is not a positive integer. Message id must be a positive safe integer
401 MISSING_API_KEY The X-Api-Key header is not passed
401 TOKEN_MISSING The key has no Bitrix24 tokens
403 SCOPE_DENIED The key does not have the booking scope
403 WRITE_BLOCKED_READONLY_KEY The key is in read-only mode
429 RATE_LIMITED Request rate exceeded. The effective cap is in the x-ratelimit-limit header
502 BITRIX_RESPONSE_INVALID Bitrix24 did not confirm the deletion

Full list of common API errors — Errors.

Known specifics

Deleting resources does not free the type. If the type has had at least one resource, it cannot be deleted even after all its resources are deleted. Before binding test resources to a type, keep in mind that the type itself will stay in the Bitrix24 account.

See also