Custom Occasions
Define your own meal occasion groups (e.g., Breakfast/Lunch/Dinner/Snack) and their time windows, plus localized translations. Use them across intakes and history.
See also: Occasion Detection to auto‑assign occasions when users create intakes.
Plan & Token Requirements
Feature available in the following LogMeal Plans:
Analyse
Monitor
Recommend
Custom
Accessible by the following User Types:
⚫ APICompany | 🔴 APIUser | 🔵 APIUserManager
What It Does
Custom Occasions lets you create occasion groups (names + time windows) and provide translations for each occasion so your app can display localized labels. Occasion groups are then used by Occasion Detection to assign the right label (e.g., Breakfast, Lunch) to each intake based on its registration time.


When to Use It / Outcomes
- You want custom meal buckets and time windows (e.g., add Brunch, split Snacks into AM/PM).
- You need localized names for occasions (e.g., Desayuno, Déjeuner).
- You plan to analyze nutrition by occasion or trigger occasion‑based reminders.
- Output: JSON confirming creation of groups and translations; subsequent history and intake endpoints return the occasion for each intake.
Feature-Specific Details
- Occasion group =
( name, init_time, end_time )
(24‑hour format"%H:%M:%S"
). - Translations are created per language code (e.g.,
eng
,esp
,fre
) and linked to an occasion. - Validation ensures time values are correctly formatted and required fields are present.
- Visibility: 🔴 APIUser can read configured occasion groups; creation is available to ⚫ APICompany and 🔵 APIUserManager.
- Timezone aware: Detection uses the user's timezone when mapping intakes to your time windows.
Related Endpoints
- GET /intake/getOccasionGroups → ⚫ 🔴 🔵 List existing occasion groups (names and windows).
- POST /intake/createOccasionGroup → ⚫ 🔵 Create a new occasion group with
name
,init_time
,end_time
. - POST /intake/createOccasionTranslation → ⚫ 🔵 Add a translation for an occasion (
language
,name
).
Typical Workflow
- Design your occasion model (e.g., Breakfast 06:00–10:00, Lunch 12:00–15:00, Dinner 18:00–23:00, Snack otherwise).
- Create groups with POST /intake/createOccasionGroup.
- Add translations with POST /intake/createOccasionTranslation.
- Verify configuration via GET /intake/getOccasionGroups.
- Use Occasion Detection to label intakes, or override per intake if needed.
Updated about 10 hours ago