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

Resource work hours

The work hours of a booking resource are the days of the week and the times when the resource accepts bookings. The methods in this subsection read a resource's work hours, set them as a whole, and remove them in a single call.

Bitrix24 API: booking.v1.resource.slots.list, booking.v1.resource.slots.set, booking.v1.resource.slots.unset Scope: booking

Get resource work hours

GET /v1/booking-resources/:id/slots

Returns the work hours of a booking resource — time intervals by day of the week when the resource accepts bookings.

Parameters

Parameter Type Required Description
Parameterid (path) Typenumber Requiredyes DescriptionBooking resource ID. List: GET /v1/booking-resources

Examples

curl — personal key

Terminal
curl "https://vibecode.bitrix24.com/v1/booking-resources/65/slots" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl "https://vibecode.bitrix24.com/v1/booking-resources/65/slots" \
  -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/booking-resources/65/slots', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data } = await res.json()
for (const slot of data.slots) {
  console.log(slot.weekDays.join(', '), `${slot.from}–${slot.to}`, slot.timezone)
}

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/booking-resources/65/slots', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { success, data } = await res.json()

Response fields

Field Type Description
Fieldsuccess Typeboolean Descriptiontrue on success
Fielddata.slots Typearray DescriptionWork hour intervals of the resource. For a resource without work hours — an empty array
Fielddata.slots[].id Typenumber DescriptionInterval ID. Changes every time the work hours are written
Fielddata.slots[].from Typenumber DescriptionStart of the interval in minutes from midnight: 600 is 10:00
Fielddata.slots[].to Typenumber DescriptionEnd of the interval in minutes from midnight: 1140 is 19:00
Fielddata.slots[].weekDays Typearray DescriptionDays of the week the interval applies to: Mon, Tue, Wed, Thu, Fri, Sat, Sun
Fielddata.slots[].slotSize Typenumber DescriptionLength of one booking slot in minutes
Fielddata.slots[].timezone Typestring DescriptionTime zone in which from and to are set — a name from the IANA time zone database

Response example

JSON
{
  "success": true,
  "data": {
    "slots": [
      {
        "id": 67,
        "from": 600,
        "to": 1140,
        "weekDays": ["Mon", "Tue", "Wed", "Thu", "Fri"],
        "slotSize": 30,
        "timezone": "Europe/London"
      },
      {
        "id": 69,
        "from": 600,
        "to": 840,
        "weekDays": ["Sat"],
        "slotSize": 60,
        "timezone": "Europe/London"
      }
    ]
  }
}

Error response example

404 — no resource with this id exists:

JSON
{
  "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 missing
HTTP401 CodeTOKEN_MISSING DescriptionThe key has no Bitrix24 tokens
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 returned work hours in an unexpected shape. Message Bitrix24 returned an invalid booking response

Full list of common API errors — Errors.

Known specifics

The interval id is not stable. Every write of the work hours via PUT /v1/booking-resources/:id/slots recreates the intervals with new id values. Match intervals by days of the week and time, not by id.

See also