Skip to content

History API

GET /api/v1/history returns past Entries from every Meal Space the caller can read, newest first. It needs the read scope. Raw History follows read access only, so it stays available in a read-only shared Meal Space and after Pro ends, when computed Stats lock (D-143).

Each Meal Space decides what is past from its own Planning timezone: an Entry is History when its date is before that space's Today (D-119). Today and future Entries never appear.

Query

  • meal_space_id: repeatable. Limits the result to those spaces. An unreadable space adds nothing.
  • from: inclusive YYYY-MM-DD lower bound.
  • before: exclusive YYYY-MM-DD upper bound. Today still applies.
  • limit: 1 to 100, default 100.
  • after: the opaque next_after token from the previous page.

Pages order by date descending and then by Entry ID, so every Entry appears exactly once across pages. Clients group a page by date and apply the usual Slot and position order within a day.

Items

Each item carries the full entry (the same projection as the Entry API), its meal_space id, name, and color, and an effective_status. A past planned Simple, Recipe, Leftovers, or Eating out Entry reads as completed. Placeholder and Prep keep planned. Stored status never changes; only an explicit edit, skip, or replace does (D-006). Replaced Entries appear with their replaced_by_entry_id link, so clients can show what was eaten instead.

Past meals

GET /api/v1/meal-spaces/{groupId}/history/meals returns every distinct meal one Meal Space has eaten, for the Rotation's "From history" view (D-223). It needs the read scope and follows the same access as History: any current member, Viewers included, may call it, and it stays available without Pro. A non-member or unknown space gets not_found.

A meal counts when it is a Simple, Recipe, or Eating out Entry that was not replaced, and is either completed or planned on a date before the space's Today. Skipped Entries, Prep, Leftovers, Placeholders, and future Entries never count. Meals group like the regulars: a Recipe Entry by its Recipe, so Variations fold in, and anything else by type and case-folded title.

The response carries the space's today and up to 200 items, ordered by count descending, then last_on descending, then title and ID. Each item has the most recent Entry as entry, how many times it was eaten as count, that Entry's date as last_on, and recipe_readable, which is false when a linked Recipe or Variation is archived. The list does not leave out meals already in the rotation; clients filter those against their own Ideas.