---
title: "Record a meal with the assistant's estimates per food"
method: POST
path: "/meals"
tags: ["records"]
---

# Record a meal with the assistant's estimates per food

`POST /meals`

## Request

- Base URL: `https://nutri.coghorizon.com/api/v1`
- URL: `https://nutri.coghorizon.com/api/v1/meals`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://nutri.coghorizon.com/oauth/authorize`, token URL `https://nutri.coghorizon.com/oauth/token`, scopes: `records:write`)

The assistant estimates each food (weight, kcal, protein, carbohydrates, fat; fibre, sugar, sodium when known) from what the person said or showed, states its confidence, and sends the result. Keep the person's words in description; name the model in model. The server stores, totals and reports; it never judges the meal.

## Request body

- LogMealInput
  - `profile_id` string: Profile to record in; the default profile when absent
  - `meal_type` 'breakfast' | 'lunch' | 'dinner' | 'snack' | 'other', required: Breakfast, lunch, dinner, snack or other
  - `eaten_at` string, date-time: When the meal was eaten, ISO 8601 with offset; now when absent
  - `description` string: What the person said or typed about the meal, kept in full
  - `items` object[], required: Each food with the assistant's estimate
    - `name` string, required: Food as the person named it, in their language
    - `description` string: Preparation or brand, if said
    - `portion` string: Portion in everyday terms: 2 slices, a bowl, 150 g
    - `weight_g` number: Estimated weight in grams
    - `kcal` number, required: Estimated energy, kcal
    - `protein_g` number, required: Protein, g
    - `carbs_g` number, required: Carbohydrates, g
    - `fat_g` number, required: Fat, g
    - `fiber_g` number: Fibre, g
    - `sugar_g` number: Sugar, g
    - `sodium_mg` number: Sodium, mg
    - `confidence` number: How sure the estimate is, 0 to 1
  - `model` string: Model that produced the estimates, for provenance in the report
  - `confidence` number: Overall confidence, 0 to 1
  - `notes` string: The person's own note or correction

## Response `201`

The stored meal with its items and totals

- object

## Other responses

- `400`: Validation failed
- `401`: Missing or invalid token
- `403`: Token lacks the scope
- `404`: Not found
- `429`: Rate limited

---

[API](https://skmtc.dev/coghorizon/apis/top-nutritionist-api.md) · [All operations](https://skmtc.dev/coghorizon/apis/top-nutritionist-api/llms.txt) · [OpenAPI document](https://skmtc.dev/coghorizon/apis/top-nutritionist-api/revisions/928f04d72f8c?raw)
