---
title: "Log an event"
method: POST
path: "/api/vega/log"
tags: ["Tracker"]
---

# Log an event

`POST /api/vega/log`

## Request

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

Append a feed, sleep/wake, nappy, solid meal, note, supplement or measurement. Validates ranges (milk 0-500 ml, weight 0.5-30 kg, length 40-120 cm) and rejects future timestamps. Returns the saved event, the refreshed live status, and a soft `warning` if the time conflicts with a recorded sleep span.

## Request body

- LogEventRequest: Body for `POST /api/vega/log`. Provide the fields that make sense for `type`.
  - `type` 'milk' | 'sleep' | 'wake' | 'nappy' | 'poop' | 'solid' | 'note' | 'supplement' | 'weight' | 'length', required
  - `ts` string, nullable: ISO 8601 local time; defaults to now. Cannot be in the future.
  - `ml` integer, nullable: `milk`: millilitres, 0-500. Use 0 (or omit) for a breastfeed.
  - `kind` string, nullable: `nappy`: wet|dirty|both|dry. `supplement`: vitd|iron|multivitamin.
  - `foods` string[], nullable: `solid`: foods eaten.
  - `meal_type` 'meal' | 'snack', nullable: `solid` only.
  - `kg` number, nullable: `weight`: kilograms, 0.5-30.
  - `cm` number, nullable: `length`: centimetres, 40-120.
  - `ug` integer, nullable: `supplement`: micrograms.
  - `note` string, nullable: Free text, up to 300 characters.
  - `author` string, nullable: Defaults to the calling user's username.
  - `timezone` string, nullable: IANA zone if `ts` is in a different zone from the family's.

## Response `200`

Success

- LogEventResponse
  - `status` 'ok', required
  - `event` Event, required: One logged event. Fields beyond `id`/`ts`/`type`/`author` depend on `type`.
    - `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`.
  - `live` object, required: The refreshed live-status block (same shape as `GET /api/vega/live`).
  - `unknown_foods` string[]: `solid` foods with no nutrient data.
  - `warning` Warning
    - `type` string, required
    - `message` string, required
    - `sleep_span` object, nullable

## Other responses

- `400`: Bad Request
- `401`: Missing or invalid credentials
- `403`: `insufficient_scope`: the bearer token lacks the `write` scope

---

[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)
