Upsert a day's totals
Directly sets the calorie and protein totals for one calendar day, replacing any existing roll-up.
/api/nutrition__Secure-better-auth.session_tokenAPI key · cookierequiredBetter Auth session. Signing in (Google or email magic link) sets an HttpOnly session cookie that scopes every request to that account. The web app and CLI use this; agents use the OAuth 2.1 flow of the MCP server.
AuthorizationBearer token · headerrequiredPersonal API key sent as Authorization: Bearer skcal_…. Create and scope keys in the app under your profile → API keys. Keys default to full access; a scoped key is limited to its granted resource:action permissions and cannot manage other keys.
application/jsonThe day's totals to store.
datestring<date>requiredCalendar day to upsert (YYYY-MM-DD).
kcalinteger | nullTotal calories to set for the day.
proteinGinteger | nullTotal protein in grams to set for the day.
hitProteinboolean | nullWhether to mark the protein target as met.
adherencestring | nullCalorie adherence bucket to set.
underonovernullThe day's totals were stored.
okbooleanrequiredAlways true.
The request body or parameters failed validation.
errorstringrequiredHuman-readable failure reason.
detailstringOptional extra context, present on upstream failures.