{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/getmyluna-app/json-schema/getmyluna-app-log-event-request-schema.json",
  "title": "LogEventRequest",
  "description": "Body for `POST /api/vega/log`. Provide the fields that make sense for `type`.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/getmyluna-app-openapi.json#/components/schemas/LogEventRequest",
  "properties": {
    "type": {
      "enum": [
        "milk",
        "sleep",
        "wake",
        "nappy",
        "poop",
        "solid",
        "note",
        "supplement",
        "weight",
        "length"
      ],
      "title": "Type",
      "type": "string"
    },
    "ts": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "ISO 8601 local time; defaults to now. Cannot be in the future.",
      "title": "Ts"
    },
    "ml": {
      "anyOf": [
        {
          "maximum": 500,
          "minimum": 0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "`milk`: millilitres, 0-500. Use 0 (or omit) for a breastfeed.",
      "title": "Ml"
    },
    "kind": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "`nappy`: wet|dirty|both|dry. `supplement`: vitd|iron|multivitamin.",
      "title": "Kind"
    },
    "foods": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "`solid`: foods eaten.",
      "title": "Foods"
    },
    "meal_type": {
      "anyOf": [
        {
          "enum": [
            "meal",
            "snack"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "`solid` only.",
      "title": "Meal Type"
    },
    "kg": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "`weight`: kilograms, 0.5-30.",
      "title": "Kg"
    },
    "cm": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "`length`: centimetres, 40-120.",
      "title": "Cm"
    },
    "ug": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "`supplement`: micrograms.",
      "title": "Ug"
    },
    "note": {
      "anyOf": [
        {
          "maxLength": 300,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Free text, up to 300 characters.",
      "title": "Note"
    },
    "author": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Defaults to the calling user's username.",
      "title": "Author"
    },
    "timezone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "IANA zone if `ts` is in a different zone from the family's.",
      "title": "Timezone"
    },
    "client_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Same as the `Idempotency-Key` header, for clients that can't set headers. 8-128 characters: letters, digits, `_ - . :`. If both are sent they must match.",
      "title": "Client Id"
    }
  },
  "required": [
    "type"
  ],
  "type": "object"
}