# API: Booking page

| Method | Path | What it does | Scope |
|---|---|---|---|
| GET | `/v1/embed/book/:key` | An organization's booking page, for its own website to show in a frame (only the websites it named may) (no sign-in) | — |
| POST | `/v1/embed/book/:key/link` | Ask for a sign-in link to reserve: if the organization has this email for a family, that guardian gets a one-time link to their family view (the answer is the same either way) (no sign-in) | — |
| GET | `/v1/embed/book/:key/sessions` | The next two weeks' sessions on an organization's booking page: times, rooms and places left (no names) (no sign-in) | — |

## Examples

### GET /v1/embed/book/$KEY

An organization's booking page, for its own website to show in a frame (only the websites it named may). No sign-in, so it sends no key.

```bash
curl -s "https://api.cubbylark.com/v1/embed/book/$KEY"
```

```js
const res = await fetch(`https://api.cubbylark.com/v1/embed/book/${key}`, {
  method: "GET",
});
const data = await res.json();
```

### POST /v1/embed/book/$KEY/link

Ask for a sign-in link to reserve: if the organization has this email for a family, that guardian gets a one-time link to their family view (the answer is the same either way). No sign-in, so it sends no key.

```bash
curl -s -X POST "https://api.cubbylark.com/v1/embed/book/$KEY/link" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.cubbylark.com/v1/embed/book/${key}/link`, {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### GET /v1/embed/book/$KEY/sessions

The next two weeks' sessions on an organization's booking page: times, rooms and places left (no names). No sign-in, so it sends no key.

```bash
curl -s "https://api.cubbylark.com/v1/embed/book/$KEY/sessions"
```

```js
const res = await fetch(`https://api.cubbylark.com/v1/embed/book/${key}/sessions`, {
  method: "GET",
});
const data = await res.json();
```

Request and response schemas: [https://www.cubbylark.com/openapi.json](https://www.cubbylark.com/openapi.json). All resources: [API reference](https://www.cubbylark.com/docs/api).
