
## List calendar resources

`GET /v1/calendar-resources`

Returns the calendar resources of the Bitrix24 account — use it to find a resource ID for bookings, renaming and deletion.

## Parameters

| Parameter | Type | Default | Description |
|----------|-----|-----------|---------|
| `limit` (query) | number | `50` | Number of records, up to 5000 |
| `offset` (query) | number | `0` | How many records to skip from the start of the list |
| `select` (query) | string | — | Comma-separated response fields: `?select=id,name`. Field list — [`GET /v1/calendar-resources/fields`](./fields.md) |
| `withTotal` (query) | boolean | — | Requests the total count. Has no effect: `meta.total` is always returned, including with `false` |

**Pagination.** Vibecode fetches the whole resource list and returns the window `[offset, offset + limit)`. The maximum is 5000 records per call. `meta.total` is the total number of resources; `meta.hasMore` shows whether there are resources beyond the window.

## Examples

### curl — personal key

```bash
curl "https://vibecode.bitrix24.com/v1/calendar-resources?limit=3" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl "https://vibecode.bitrix24.com/v1/calendar-resources?limit=3" \
  -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/calendar-resources?limit=3', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data, meta } = await res.json()
console.log(`Resources in the Bitrix24 account: ${meta.total}`)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/calendar-resources?limit=3', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data` | array | Array of resources |
| `data[].id` | number | Resource ID |
| `data[].name` | string | Resource name |
| `data[].createdBy` | number | ID of the employee who created the resource. List: [`GET /v1/users`](/docs/entities/users) |
| `meta.total` | number | Total number of resources in the Bitrix24 account |
| `meta.hasMore` | boolean | Whether there are resources beyond the `limit` and `offset` window |
| `meta.warnings` | array | Warnings about request parameters — objects `{ code, message, field }`. Returned, for example, for `limit=0` with code `LIMIT_ZERO_IGNORED` and for an unknown field in `select` with code `UNKNOWN_SELECT_FIELD` |

## Response example

```json
{
  "success": true,
  "data": [
    {
      "id": 7,
      "name": "Museum hall",
      "createdBy": 1
    },
    {
      "id": 49,
      "name": "resource 1",
      "createdBy": 835
    },
    {
      "id": 51,
      "name": "resource 2",
      "createdBy": 835
    }
  ],
  "meta": {
    "total": 9,
    "hasMore": true
  }
}
```

## Error response example

400 — a filter was passed:

```json
{
  "success": false,
  "error": {
    "code": "UNSUPPORTED_FILTER",
    "message": "calendar-resources list does not support filter[]; B24 method \"calendar.resource.list\" takes no list parameters at all. Filter keys received: name. Filter it on your side."
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `UNSUPPORTED_FILTER` | `filter` was passed. The list does not support filtering — filter resources on your side |
| 400 | `INVALID_SORT_FIELD` | `order` or `sort` was passed. The list does not support sorting |
| 403 | `SCOPE_DENIED` | The API key does not have the `calendar` scope |
| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 denied the key owner access to calendar resources |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |
| 429 | `RATE_LIMITED` | Request limit exceeded |
| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable or returned a malformed response |
| 503 | `BITRIX_TIMEOUT` | Bitrix24 did not respond in time |

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

## Known specifics

**A single resource is available only through the list.** There is no endpoint for reading a single resource: `GET /v1/calendar-resources/:id` returns `404 ROUTE_NOT_FOUND`. Find the resource you need in this list by `id` or `name`.

**`id` is returned with any `select`.** A request with an unknown name in `select` is not rejected — the response still contains the `id` of each resource.

## See also

- [Create calendar resource](./create.md)
- [Resource bookings](./bookings.md)
- [Calendar resource fields](./fields.md)
- [Calendar resources](/docs/entities/calendar-resources)
- [Limits and optimization](/docs/optimization)
