
## Booking resources

`GET /v1/booking-resources`

Returns the booking resources available to the key. This is the only way to learn the values for the mandatory `resourceIds` field when [creating a booking](/docs/entities/bookings/create) — start here if you are creating your first booking.

The method returns the whole catalogue at once and accepts no pagination parameters: `meta.total` always equals the length of `data`, and `meta.hasMore` is always `false`.

## Parameters

| Parameter | Type | Req. | Default | Description |
|----------|-----|:-----:|-----------|---------|
| `typeId` (query) | number | no | — | Keep only resources of one type. A positive integer in canonical form |
| `searchQuery` (query) | string | no | — | Bitrix24 substring search. A non-empty string of at most 200 characters |

The parameters may be combined. Any other parameter, a repeated parameter, an array or object spelling (`typeId[]`, `filter[typeId]`) is rejected with `400 INVALID_PARAMS` before Bitrix24 is contacted.

Sorting is deliberately not exposed: the walk always goes by ascending `id`, and a caller-controlled order would break the completeness guarantee of the response.

## Examples

### curl — personal key

```bash
curl "https://vibecode.bitrix24.com/v1/booking-resources?typeId=1" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl "https://vibecode.bitrix24.com/v1/booking-resources" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — from the resource list to a booking

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/booking-resources?searchQuery=meeting', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { data } = await res.json()
console.log(`Resources available: ${data.length}`)

const room = data.find(r => r.isMain === 'Y') ?? data[0]

await fetch('https://vibecode.bitrix24.com/v1/bookings', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    resourceIds: [room.id],
    datePeriod: {
      from: { timestamp: 1723446900, timezone: 'Europe/Berlin' },
      to: { timestamp: 1723447800, timezone: 'Europe/Berlin' },
    },
  }),
})
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data[].id` | number | Resource identifier. This is the value that goes into a booking's `resourceIds` |
| `data[].name` | string | Resource name |
| `data[].typeId` | number | Resource type identifier. The same value the `typeId` filter accepts |
| `data[].isMain` | string | The main-resource flag of the Bitrix24 record: `"Y"` or `"N"` |
| `meta.total` | number | Number of returned records. Always equals the length of `data` |
| `meta.hasMore` | boolean | Always `false` — a successful response holds the whole catalogue within the cap |

The `description` field is withheld deliberately: it is free-form portal text that may contain personal data and internal notes, and it is not needed to pick a resource. Notification and template settings are not returned either.

The response carries the `Cache-Control: private, no-store` header — the content is bound to the Bitrix24 account and to the identity of the key.

## Response example

```json
{
  "success": true,
  "data": [
    {
      "id": 1,
      "name": "Meeting room for 6",
      "typeId": 1,
      "isMain": "Y"
    },
    {
      "id": 3,
      "name": "Meeting room with a projector",
      "typeId": 1,
      "isMain": "N"
    }
  ],
  "meta": {
    "total": 2,
    "hasMore": false
  }
}
```

## Error response example

400 — an unknown parameter was passed:

```json
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "Only typeId and searchQuery are supported query parameters."
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_PARAMS` | An unknown, repeated, array-shaped or malformed query parameter. The same code arrives when Bitrix24 itself rejected the filters |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header was not sent |
| 401 | `TOKEN_MISSING` | The key has no Bitrix24 tokens configured |
| 403 | `SCOPE_DENIED` | The key does not have the `booking` scope |
| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 denied access |
| 403 | `B24_TARIFF_RESTRICTION` | The account plan does not include booking resources |
| 422 | `BITRIX_METHOD_NOT_FOUND` | The booking module is unavailable on this Bitrix24 account |
| 422 | `BITRIX_ERROR` | Bitrix24 rejected the request |
| 429 | `RATE_LIMITED` | More than 20 requests per minute per Bitrix24 account reached this endpoint, or the request rate limit to Bitrix24 was exceeded. See `Retry-After` |
| 429 | `OPERATION_TIME_LIMIT` | The Bitrix24 operation-time limit was exceeded |
| 429 | `QUEUE_OVERFLOW` | The account's Bitrix24 queue is full and the request was refused immediately. See `Retry-After` |
| 429 | `QUEUE_TIMEOUT` | The request waited in the Bitrix24 queue past its timeout. See `Retry-After` |
| 502 | `BITRIX_RESPONSE_INVALID` | Bitrix24 returned a response of an unexpected shape |
| 502 | `BITRIX_PAGINATION_INCOMPLETE` | The catalogue walk did not converge, completeness is not guaranteed |
| 502 | `BITRIX_RESULT_TOO_LARGE` | The account holds more than 500 resources. Narrow the lookup with `typeId` or `searchQuery` |
| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is temporarily unavailable |
| 503 | `BITRIX_TIMEOUT` | Bitrix24 did not answer in time |

No refusal contains partially collected data: the response is either complete or an error.

The full list of common API errors — [Errors](/docs/errors).

## Known specifics

**The catalogue cap is 500 resources.** An account with more resources gets `502 BITRIX_RESULT_TOO_LARGE` instead of a truncated list: handing back the first 500 as the whole catalogue would be a lie. Narrow the lookup with the filters.

**Completeness is guaranteed for a catalogue that did not change during the request.** Bitrix24 provides no snapshot of the collection, so creating or deleting a resource while the walk is in progress can shift a page. The response then stays well-formed but may omit a just-created resource or still contain a just-deleted one.

**Visibility is decided by Bitrix24.** The method returns what the account shows to the identity behind the key. An employee key with the `booking` scope may call the method; whether its list matches an administrator's is decided by Bitrix24, not by the platform.

**A read-only key works.** The method is a read, so read-only mode does not refuse it. The limit of 20 requests per minute per Bitrix24 account still applies to every key.

## See also

- [Bookings](/docs/entities/bookings)
- [Create a booking](/docs/entities/bookings/create)
- [List bookings](/docs/entities/bookings/list)
- [Errors](/docs/errors)
- [Limits and optimization](/docs/optimization)
