
## Get a booking

`GET /v1/bookings/:id`

Returns a single booking by id.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `id` (path) | number | yes | Booking id |

## Examples

### curl — personal key

```bash
curl "https://vibecode.bitrix24.com/v1/bookings/27" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl "https://vibecode.bitrix24.com/v1/bookings/27" \
  -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/bookings/27', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data } = await res.json()
console.log('Booking:', data.name, data.resourceIds)
```

### JavaScript — OAuth application

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

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

## Response fields

The object contains 5 fields — all are listed in the table below.

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data.id` | number | Booking id |
| `data.name` | string \| null | Booking name. May be `null` |
| `data.description` | string \| null | Booking description. May be `null` |
| `data.resourceIds` | number[] | Ids of the reserved resources |
| `data.datePeriod` | object | Booking period: `from` and `to`, each with `timestamp` (Unix seconds) and `timezone` (IANA) |

## Response example

```json
{
  "success": true,
  "data": {
    "id": 27,
    "name": "Meeting room for the demo",
    "description": "Meeting room booking",
    "resourceIds": [1],
    "datePeriod": {
      "from": {
        "timestamp": 1780132384,
        "timezone": "UTC"
      },
      "to": {
        "timestamp": 1780135984,
        "timezone": "UTC"
      }
    }
  }
}
```

## Error response example

422 — booking not found:

```json
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "Booking not found"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 422 | `BITRIX_ERROR` | The booking with the given `id` was not found |
| 422 | `BITRIX_ERROR` | `id` contains a non-numeric value |
| 403 | `SCOPE_DENIED` | The API key does not have the `booking` scope |
| 401 | `MISSING_API_KEY` | The request was sent without the `X-Api-Key` header |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |

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

## See also

- [List bookings](/docs/entities/bookings/list)
- [Update a booking](/docs/entities/bookings/update)
- [Delete a booking](/docs/entities/bookings/delete)
- [Limits and optimization](/docs/optimization)
