---
search:
  tags:
    - Nutrition
    - PUT
seo:
  description: >-
    Directly sets the calorie and protein totals for one calendar day, replacing
    any existing… Reference for the PUT /api/nutrition endpoint in the skcal
    API.
sidebar:
  label: Upsert a day's totals
  badge: PUT
title: Upsert a day's totals
type: openapi-operation
---
Directly sets the calorie and protein totals for one calendar day, replacing any existing roll-up.

`PUT /api/nutrition`

**Request body** (`application/json`, required)

The day's totals to store.

- `date` (string<date>, required) — Calendar day to upsert (YYYY-MM-DD).
- `kcal` (integer | null) — Total calories to set for the day.
- `proteinG` (integer | null) — Total protein in grams to set for the day.
- `hitProtein` (boolean | null) — Whether to mark the protein target as met.
- `adherence` (string | null) — Calorie adherence bucket to set.

Request body example:

```json
{
  "date": "2026-06-29",
  "kcal": 2150,
  "proteinG": 168,
  "hitProtein": true,
  "adherence": "on"
}
```

**Responses**

- `200` — The day's totals were stored.
- `400` — The request body or parameters failed validation.

Response example, 200:

```json
{
  "ok": true
}
```
