# API: Family

| Method | Path | What it does | Scope |
|---|---|---|---|
| GET | `/v1/family/bookable` | Sessions you can book in the next two weeks at sites your family has used, with places left, and your bookings (no sign-in) | — |
| GET | `/v1/family/channels` | How you can get your organization's messages besides email: push to this device, and texts (when your organization offers them) (no sign-in) | — |
| PUT | `/v1/family/children/:id/activity-photos` | Agree to photos of the day of your child, or withdraw (which deletes them) (no sign-in) | — |
| GET | `/v1/family/form-submissions/:id/pdf` | Your signed copy of a form, as a PDF (no sign-in) | — |
| GET | `/v1/family/forms` | Your forms and waivers: what each asks, and whether yours is current, expiring, expired or missing (no sign-in) | — |
| POST | `/v1/family/forms/:id` | Fill and sign a form or waiver for your family (or one child) (no sign-in) | — |
| GET | `/v1/family/forms/:id/pdf` | A form's PDF as your organization wrote it, to read before you fill it in (no sign-in) | — |
| GET | `/v1/family/me` | A family's view: your children's first names, recent check-ins and check-outs, and who may collect them (no sign-in) | — |
| GET | `/v1/family/notices` | The messages sent to you in the last 14 days, newest first (at most 20) (no sign-in) | — |
| GET | `/v1/family/photos/:id` | A photo of the day of your child (each view is recorded) (no sign-in) | — |
| GET | `/v1/family/preferences` | Which messages you get from your organization (only the kinds it turned on; incident notices can't be turned off) (no sign-in) | — |
| PUT | `/v1/family/preferences/:kind` | Turn one kind of message on or off for yourself (no sign-in) | — |
| GET | `/v1/family/programs` | Programs open for registration, with the fee and places left, and your registrations (no sign-in) | — |
| DELETE | `/v1/family/push` | Turn off push (this device, or every device when no address is given) (no sign-in) | — |
| POST | `/v1/family/push` | Turn on push to this device (the browser's push address; at most 5 devices) (no sign-in) | — |
| POST | `/v1/family/registrations` | Register your children for a program in one registration (one payment); a full program puts it on the waitlist. Card payment returns a checkout link (no sign-in) | — |
| POST | `/v1/family/registrations/:id/pay` | Pay by card for a registration awaiting payment (a new checkout link if the last one expired) (no sign-in) | — |
| POST | `/v1/family/reservations` | Book your children into a session together (or join its waitlist together) (no sign-in) | — |
| DELETE | `/v1/family/reservations/:id` | Cancel your booking or waitlist place (until the session starts) (no sign-in) | — |
| POST | `/v1/family/sessions` | Sign in to a family's view with the link a guardian was emailed (it works once) (no sign-in) | — |
| DELETE | `/v1/family/sessions/current` | Sign out of the family view (no sign-in) | — |
| DELETE | `/v1/family/texts` | Stop texts (email and push are unchanged) (no sign-in) | — |
| PUT | `/v1/family/texts` | Agree to texts at a US mobile number (the words shown are what you agree to) (no sign-in) | — |

## Examples

### GET /v1/family/bookable

Sessions you can book in the next two weeks at sites your family has used, with places left, and your bookings. No sign-in, so it sends no key.

```bash
curl -s "https://api.cubbylark.com/v1/family/bookable"
```

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

### GET /v1/family/channels

How you can get your organization's messages besides email: push to this device, and texts (when your organization offers them). No sign-in, so it sends no key.

```bash
curl -s "https://api.cubbylark.com/v1/family/channels"
```

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

### PUT /v1/family/children/$ID/activity-photos

Agree to photos of the day of your child, or withdraw (which deletes them). No sign-in, so it sends no key.

```bash
curl -s -X PUT "https://api.cubbylark.com/v1/family/children/$ID/activity-photos" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.cubbylark.com/v1/family/children/${id}/activity-photos`, {
  method: "PUT",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### GET /v1/family/form-submissions/$ID/pdf

Your signed copy of a form, as a PDF. No sign-in, so it sends no key.

```bash
curl -s "https://api.cubbylark.com/v1/family/form-submissions/$ID/pdf"
```

```js
const res = await fetch(`https://api.cubbylark.com/v1/family/form-submissions/${id}/pdf`, {
  method: "GET",
});
const data = await res.json();
```

### GET /v1/family/forms

Your forms and waivers: what each asks, and whether yours is current, expiring, expired or missing. No sign-in, so it sends no key.

```bash
curl -s "https://api.cubbylark.com/v1/family/forms"
```

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

### POST /v1/family/forms/$ID

Fill and sign a form or waiver for your family (or one child). No sign-in, so it sends no key.

```bash
curl -s -X POST "https://api.cubbylark.com/v1/family/forms/$ID" \
  -H "content-type: application/json" \
  -d '{}'
```

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

### GET /v1/family/forms/$ID/pdf

A form's PDF as your organization wrote it, to read before you fill it in. No sign-in, so it sends no key.

```bash
curl -s "https://api.cubbylark.com/v1/family/forms/$ID/pdf"
```

```js
const res = await fetch(`https://api.cubbylark.com/v1/family/forms/${id}/pdf`, {
  method: "GET",
});
const data = await res.json();
```

### GET /v1/family/me

A family's view: your children's first names, recent check-ins and check-outs, and who may collect them. No sign-in, so it sends no key.

```bash
curl -s "https://api.cubbylark.com/v1/family/me"
```

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

### GET /v1/family/notices

The messages sent to you in the last 14 days, newest first (at most 20). No sign-in, so it sends no key.

```bash
curl -s "https://api.cubbylark.com/v1/family/notices"
```

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

### GET /v1/family/photos/$ID

A photo of the day of your child (each view is recorded). No sign-in, so it sends no key.

```bash
curl -s "https://api.cubbylark.com/v1/family/photos/$ID"
```

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

### GET /v1/family/preferences

Which messages you get from your organization (only the kinds it turned on; incident notices can't be turned off). No sign-in, so it sends no key.

```bash
curl -s "https://api.cubbylark.com/v1/family/preferences"
```

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

### PUT /v1/family/preferences/$KIND

Turn one kind of message on or off for yourself. No sign-in, so it sends no key.

```bash
curl -s -X PUT "https://api.cubbylark.com/v1/family/preferences/$KIND" \
  -H "content-type: application/json" \
  -d '{}'
```

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

### GET /v1/family/programs

Programs open for registration, with the fee and places left, and your registrations. No sign-in, so it sends no key.

```bash
curl -s "https://api.cubbylark.com/v1/family/programs"
```

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

### DELETE /v1/family/push

Turn off push (this device, or every device when no address is given). No sign-in, so it sends no key.

```bash
curl -s -X DELETE "https://api.cubbylark.com/v1/family/push"
```

```js
const res = await fetch(`https://api.cubbylark.com/v1/family/push`, {
  method: "DELETE",
});
const data = await res.json();
```

### POST /v1/family/push

Turn on push to this device (the browser's push address; at most 5 devices). No sign-in, so it sends no key.

```bash
curl -s -X POST "https://api.cubbylark.com/v1/family/push" \
  -H "content-type: application/json" \
  -d '{}'
```

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

### POST /v1/family/registrations

Register your children for a program in one registration (one payment); a full program puts it on the waitlist. Card payment returns a checkout link. No sign-in, so it sends no key.

```bash
curl -s -X POST "https://api.cubbylark.com/v1/family/registrations" \
  -H "content-type: application/json" \
  -d '{}'
```

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

### POST /v1/family/registrations/$ID/pay

Pay by card for a registration awaiting payment (a new checkout link if the last one expired). No sign-in, so it sends no key.

```bash
curl -s -X POST "https://api.cubbylark.com/v1/family/registrations/$ID/pay" \
  -H "content-type: application/json" \
  -d '{}'
```

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

### POST /v1/family/reservations

Book your children into a session together (or join its waitlist together). No sign-in, so it sends no key.

```bash
curl -s -X POST "https://api.cubbylark.com/v1/family/reservations" \
  -H "content-type: application/json" \
  -d '{}'
```

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

### DELETE /v1/family/reservations/$ID

Cancel your booking or waitlist place (until the session starts). No sign-in, so it sends no key.

```bash
curl -s -X DELETE "https://api.cubbylark.com/v1/family/reservations/$ID"
```

```js
const res = await fetch(`https://api.cubbylark.com/v1/family/reservations/${id}`, {
  method: "DELETE",
});
const data = await res.json();
```

### POST /v1/family/sessions

Sign in to a family's view with the link a guardian was emailed (it works once). No sign-in, so it sends no key.

```bash
curl -s -X POST "https://api.cubbylark.com/v1/family/sessions" \
  -H "content-type: application/json" \
  -d '{}'
```

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

### DELETE /v1/family/sessions/current

Sign out of the family view. No sign-in, so it sends no key.

```bash
curl -s -X DELETE "https://api.cubbylark.com/v1/family/sessions/current"
```

```js
const res = await fetch(`https://api.cubbylark.com/v1/family/sessions/current`, {
  method: "DELETE",
});
const data = await res.json();
```

### DELETE /v1/family/texts

Stop texts (email and push are unchanged). No sign-in, so it sends no key.

```bash
curl -s -X DELETE "https://api.cubbylark.com/v1/family/texts"
```

```js
const res = await fetch(`https://api.cubbylark.com/v1/family/texts`, {
  method: "DELETE",
});
const data = await res.json();
```

### PUT /v1/family/texts

Agree to texts at a US mobile number (the words shown are what you agree to). No sign-in, so it sends no key.

```bash
curl -s -X PUT "https://api.cubbylark.com/v1/family/texts" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.cubbylark.com/v1/family/texts`, {
  method: "PUT",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
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).
