---
title: "Patterns and weekly review"
method: GET
path: "/api/vega/patterns"
tags: ["Insights"]
---

# Patterns and weekly review

`GET /api/vega/patterns`

## Request

- Base URL: `https://getmyluna.app`
- URL: `https://getmyluna.app/api/vega/patterns`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `luna_session`

Sleep patterns, 14-day totals, today's events, and, once solids have started, 7-day nutrient tallies, targets and the allergen grid.

## Response `200`

Success

- PatternsResponse: Everything the dashboard renders. Solid-food blocks are empty until `flags.solids_started` is true.
  - `patterns` object, required
  - `daily_totals` object[], required
  - `today` Event[], required
    - `id` string, required: 8-hex-char id, unique within the family.
    - `ts` string, required: ISO 8601 local timestamp.
    - `type` 'milk' | 'sleep' | 'wake' | 'nappy' | 'poop' | 'solid' | 'note' | 'supplement' | 'weight' | 'length', required
    - `author` string: Who logged it: the caregiver's first name, or `Family admin` / `Partner` until they've set one (`app`/`agent` for non-human). Never an email or username.
    - `author_name` string, nullable: Same as `author` (display name).
    - `author_is_me` boolean, nullable: Web session/token only: true when the current caregiver logged it.
    - `ml` integer, nullable: `milk` only: millilitres (0 for a breastfeed).
    - `kind` string, nullable: `nappy`: wet|dirty|both|dry. `supplement`: vitd|iron|multivitamin.
    - `foods` string[], nullable: `solid` only: what was eaten.
    - `meal_type` 'meal' | 'snack', nullable: `solid` only.
    - `kg` number, nullable: `weight` only.
    - `cm` number, nullable: `length` only.
    - `ug` integer, nullable: `supplement` only: micrograms.
    - `note` string, nullable
    - `reactions` object[], nullable: Emoji reactions from caregivers: `emoji`, `ts`, `user` (display name), `mine`.
  - `nutrients_7d` object, required
  - `nutrients_today` object, required
  - `nutrient_targets` object, required
  - `allergens_today` object, required
  - `allergen_grid` object, required
  - `baby_name` string, required
  - `dob` string, required: YYYY-MM-DD, or empty while the family is expecting.
  - `age_months` number, nullable, required
  - `age_display` string, nullable, required
  - `flags` object, required
  - `expecting` Expecting: Set while the baby isn't born yet: there is no age and no age-based target.
    - `due_date` string, required
    - `days_until_due` integer, required: 0 once the due date arrives.
    - `due_date_reached` boolean, required
    - `days_overdue` integer: Days since the due date while the birth isn't confirmed yet (0 before it). The family stays expecting until a caregiver confirms the arrival.

## Other responses

- `401`: Missing or invalid credentials

---

[API](https://skmtc.dev/getmyluna/apis/luna-api.md) · [All operations](https://skmtc.dev/getmyluna/apis/luna-api/llms.txt) · [OpenAPI document](https://skmtc.dev/getmyluna/apis/luna-api/revisions/ef7b359c9648?raw)
