# Booking resource types

A booking resource type is a category of online booking resources, such as specialists, equipment or rooms. The type stores the settings for client messages about bookings: which messages to send, when, and with which template.

Bitrix24 API: `booking.v1.resourceType.*`
Scope: `booking`

## Operations

- [Create a resource type](./booking-resource-types/create.md) — `POST /v1/booking-resource-types`
- [List resource types](./booking-resource-types/list.md) — `GET /v1/booking-resource-types`
- [Get a resource type](./booking-resource-types/get.md) — `GET /v1/booking-resource-types/:id`
- [Update a resource type](./booking-resource-types/update.md) — `PATCH /v1/booking-resource-types/:id`
- [Delete a resource type](./booking-resource-types/delete.md) — `DELETE /v1/booking-resource-types/:id`

## Key fields

| Field | Description |
|------|----------|
| `id` | Type identifier. List: [`GET /v1/booking-resource-types`](./booking-resource-types/list.md). Pass it in `typeId` when [creating a booking resource](/docs/entities/booking-resources/create) |
| `code` | Symbolic code, unique among the types of the Bitrix24 account. Required on create and in every update |
| `name` | Type name. Required on create |
| `is*NotificationOn` | Six switches for client messages: booking info, confirmation request, reminder, feedback request, late-arrival message, cancellation message |
| `senderCode` | Service that sends messages to the client, for example `bitrix24` |

For the full field list, see [Get a resource type](./booking-resource-types/get.md).

## What to know before you start

1. **Client messages are on by default.** A type created without the `is*NotificationOn` switches gets all six set to `true`. To turn client messages off, pass all six set to `false` on create.
2. **The request body is flat.** Fields go at the root of the JSON, without a `fields` wrapper. The switches accept `true` / `false` or the strings `"Y"` / `"N"`; the response always returns `true` or `false`.
3. **An update requires a new `code`.** A `PATCH` without `code` or with the current code is rejected with `422 BITRIX_ERROR`. To keep the code, change fields in two requests: first with a temporary `code`, then with the original one.
4. **A type that has ever had a resource cannot be deleted.** The API still returns `422 BITRIX_ERROR` even after all resources of this type are deleted.
5. **The full list is returned.** The list has no pagination: all resource types in the Bitrix24 account, up to 500, are returned in a single response. A filter by `id` does not narrow the list — for a single type, use [get by `id`](./booking-resource-types/get.md).

## Typical scenario

1. Find a suitable type: [`GET /v1/booking-resource-types`](./booking-resource-types/list.md). The Bitrix24 account already has built-in types, for example `equipment` and `room`.
2. If none fits, create your own: [`POST /v1/booking-resource-types`](./booking-resource-types/create.md).
3. Create a resource of this type, passing the type `id` in `typeId`: [`POST /v1/booking-resources`](/docs/entities/booking-resources/create).
4. Set the resource's working hours: [`PUT /v1/booking-resources/:id/slots`](/docs/entities/booking-resources/slots).
5. Book clients: [`POST /v1/bookings`](/docs/entities/bookings/create).

## Limits

| Limit | Value |
|-------|----------|
| Types in a list response | up to 500. If the Bitrix24 account has more, the list responds with `502 BITRIX_RESPONSE_INVALID` |
| Pagination | none, `limit` and `offset` are not accepted |
| Request rate | list — up to 20 requests per minute per Bitrix24 account, other operations — up to 60. The current limit for the key is returned in the `x-ratelimit-limit` header |
| General API limit | see [Limits and optimization](/docs/optimization) |

## See also

- [Booking resources](/docs/entities/booking-resources)
- [Bookings](/docs/entities/bookings)
- [Errors](/docs/errors)
