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

# Edit an event

`POST /api/vega/event/edit`

## Request

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

Change editable fields (ts, ml, foods, note, meal_type, kind, author) on one event by id.

## Request body

- EventEditRequest
  - `id` string, required
  - `changes` object, required: Editable fields only: ts, ml, foods, note, meal_type, kind, author.

## Response `200`

Success

- EventMutationResponse
  - `status` 'ok', required
  - `event` Event: 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`.
  - `removed` Event: 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, nullable

## Other responses

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

---

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