Meal Ideas
The app shows a Meal Space's Ideas as its Rotation: the meals a household makes regularly,
plus ones it wants to try. The API keeps the ideas name. Ideas are a shared list within a Meal Space. Owners, Admins, and Editors can add and
change them. Viewers can read them. All routes use the authenticated caller's current
Membership and the space's current availability.
The prefix is /api/v1/meal-spaces/{groupId}/ideas.
| Method | Suffix | Result |
|---|---|---|
| GET | collection | Ordered items, filtered total_count, opaque next_after |
| GET | /{ideaId} | Idea content, links, space name/color, and link_state |
| POST | collection | Create with a client-generated id |
| PATCH | /{ideaId} | Replace title, notes, and Tags, and optionally the kind |
| DELETE | /{ideaId} | Conditional hard delete |
| POST | /{ideaId}/reorder | Move before or after another Idea |
| PUT | /{ideaId}/recipe | Link or unlink a Recipe and optional Variation |
| POST | /{ideaId}/schedule | Create an independent Entry and retain the Idea |
| POST | /{ideaId}/convert | Create a Recipe and link the retained Idea |
| POST | /{ideaId}/copy | Copy to another Meal Space, clearing both links |
Every command requires a UUID Idempotency-Key, membership_id, and millisecond ISO
client_updated_at. Keep the exact key and body when retrying an uncertain result.
Authority is checked before receipt replay. Changing arguments under the same key returns
409. Commands return metadata only: outcome, idea_id, group_id, membership_id, and
updated_at. Schedule adds entry_id, convert adds recipe_id, and copy adds
source_idea_id. Copy metadata identifies the new destination Idea and Membership.
Create takes id, content: { title, notes, tags }, recipe_id, and variation_id.
The links are explicitly nullable. Edit replaces content; link replaces both links.
Every Idea has a kind: meal, recipe or eating_out (D-210). Create and edit take it
as an optional field. A create without one is recipe when it links a Recipe and meal
otherwise; an edit without one keeps the current kind, so send it only when it changes. A
meal or recipe Idea may link a Recipe (D-239). Linking and unlinking keep the kind, and
converting makes it recipe. Linking or converting an Eating out Idea returns 409, as does
changing a linked Idea's kind to eating_out. Copy keeps the kind.
Titles are trimmed and limited to 200 Unicode characters; notes allow 2,000. At most 20
unique Tags are accepted, each at most 50 characters. Tags reuse the Meal Space vocabulary.
Clients cannot set source; create uses user, while copy preserves the existing source.
A Variation must belong to the linked Recipe, in the same Meal Space.
Edits, link changes, and reorders use last-write-wins client timestamps. HTTP 200 with
outcome: "stale" means the command did not apply and updated_at is null. Preserve the
local draft or reorder intent, show the current Idea for review, and use a new key only
when the person submits a revised command. Do not show a success toast for stale.
Reads and ordering
Collection queries accept q, repeated tag, limit from 1 through 200, and after.
Search is literal across title and notes. Tag filters are ANDed. total_count describes
all matching Ideas, not just the page. Pass next_after back unchanged with the same
space and filters. The default page size is 50. Invalid or mismatched cursors return 422.
Order is shared within a Meal Space. Reorder takes anchor_idea_id, side: "before" | "after", and context: { q: "", tags: [], complete: true }. Load the complete unfiltered
backlog first. The server resolves the anchor's current position while preserving unrelated
Ideas' relative order. A missing anchor returns 409; refresh before submitting new intent.
Scheduling and Undo
Schedule takes expected_updated_at, a new entry_id, entry_date, enabled slot, and
mode: "linked" | "simple". Dates use the Meal Space Planning timezone and cannot be in
the past. Linked mode carries the current Recipe and Variation to the Entry. Optional
target_yield_quantity and target_yield_unit must be supplied together in linked mode.
Simple mode uses the Idea's title and notes, and plans an Eating out Entry for an Eating out
Idea and a Simple Entry otherwise. Scheduling always keeps the Idea.
To offer “Remove from Ideas after scheduling”, first complete scheduling:
POST /api/v1/meal-spaces/{groupId}/ideas/{ideaId}/schedule
Idempotency-Key: <schedule UUID>
{
"membership_id": "<current Membership UUID>",
"client_updated_at": "2026-09-23T12:00:00.000Z",
"expected_updated_at": "<Idea version from the read>",
"entry_id": "<new Entry UUID>",
"entry_date": "2026-09-24",
"slot": "dinner",
"mode": "simple"
}
After success, start a five-second client Undo timer for the optional removal. If Undo is
selected, cancel that timer. Otherwise send a separate command with a distinct key and
use the exact Idea updated_at returned by schedule:
DELETE /api/v1/meal-spaces/{groupId}/ideas/{ideaId}
Idempotency-Key: <different delete UUID>
{
"membership_id": "<current Membership UUID>",
"client_updated_at": "2026-09-23T12:00:05.000Z",
"expected_updated_at": "<version returned by schedule>"
}
Deletion is permanent once submitted. The same Undo delay applies to ordinary removal. An intervening edit makes cleanup return 409; the Entry stays saved and the Idea remains. An uncertain delete response must retry only deletion, never scheduling. Schedule replay after deletion returns the original Entry identity and Idea version.
Delete requires exactly one of expected_updated_at or expected_command_id. The latter
is the UUID of a successful create, edit, link, or reorder for the same Idea, actor,
Membership, and Meal Space. It pins that receipt's exact version, even if later local
commands changed the mirror. A missing, expired, foreign, self, or ambiguous dependency
returns 409. A collaborator's later edit also prevents deletion. Never substitute the
latest version automatically.
Recipe links and copying
Convert takes a new recipe_id, full Recipe content, and the Idea's expected_updated_at.
It keeps Idea content, Tags, and ordering, then links the new Recipe. An already linked Idea
returns 409. Conversion respects the five-active-Recipe Free Personal allowance; capacity
returns 403 pro_required. Shared Meal Spaces are uncapped by that Personal allowance.
Copy takes a new destination id, target_group_id, target_membership_id, and
expected_updated_at. Both source and destination must be writable. The new Idea appears
at the top and reuses destination Tags. The source remains unchanged and the copy has no
Recipe or Variation links.
Recipe deletion or transfer clears both Idea links. Explicit Variation removal clears only
the Variation link; restoring it does not relink the Idea. These changes advance the Idea's
server version. Allowance archival preserves links and exposes link_state: "allowance_archived". Linked scheduling is blocked, while explicitly choosing Simple is
allowed without clearing the stored link.
Errors and sync
Invalid command fields return 422. Expected-version changes, unavailable dependencies or
links, missing anchors, reference races, and conflicting key reuse return 409 conflict.
Membership and availability errors follow the shared API conventions. Unknown failures
return a sanitized 503 without database messages or content.
The REST routes are online operations. Scheduling, conversion, and cross-space copy always
require an online result. Content projection 3 adds Ideas to the window-free library stream.
Queued create, edit, remove, link, and reorder share the same focused commands and receipt identity.
See sync for queue and conditional-delete behavior.
Web behavior
The current web shell links /ideas from its Meal Spaces aside and shows an Ideas rail on
/plan. The page can include hidden Meal Spaces; the rail follows Timeline visibility.
Reorder is available only for one complete, unfiltered Meal Space. Viewers can open full notes.
Removal waits five seconds before sending DELETE. Hover or focus pauses Undo, and leaving before submission cancels the pending removal. Schedule submits immediately. Optional cleanup uses the returned Idea version, its own UUID, and the same Undo window. Unknown outcomes retain frozen request bytes in tab session storage for explicit retry after navigation. Sign-out, account changes, and confirmed loss of write access purge recovery. No unsent cleanup survives navigation. If storage is blocked, dispatch stops before sending a write. Each board serializes writes during requests, Undo, and unresolved outcomes. Web actions require a connection.
Offline ideaPage and idea reads expose a local link_state of none, active, or
unavailable, derived from the same-space Recipe and active Variation mirror in one transaction.
An absent Recipe is unavailable; the mirror does not infer why it was removed. Stored Idea
link IDs remain unchanged.