Skip to main content
This endpoint provides comprehensive analytics for kitchen staff to plan meal preparation based on guest meal skipping patterns. It helps optimize food preparation and reduce waste during guest sessions. Learn more about using meal skipping data in the Guest Meal Skipping User Guide.

Authentication

Query Parameters

The API supports two modes of querying: by session ID or by date range.

Option 1: Query by Session ID

sessionId
string
required
The ID of the session to analyze for meal skipping patterns

Option 2: Query by Date Range

startDate
string
required
Start date in ISO format (YYYY-MM-DD). Required when not using sessionId.
endDate
string
required
End date in ISO format (YYYY-MM-DD). Required when not using sessionId.
Either sessionId OR both startDate and endDate must be provided.

Response

summary
object
High-level statistics about meal skipping patterns
byDate
object
Meal skipping data organized by date
byGuest
object
Meal skipping data organized by individual guest
curl -X GET \
  "https://api.teamm.work/guests/meal-skipping-report?sessionId=64f1234567890abcdef12345" \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json"
{
	"summary": {
		"totalGuests": 25,
		"guestsWithSkipping": 8,
		"datesWithSkipping": ["2025-01-15", "2025-01-16", "2025-01-17"],
		"mealsAffected": ["breakfast", "lunch", "dinner"]
	},
	"byDate": {
		"2025-01-15": {
			"breakfast": {
				"count": 3,
				"guests": [
					{
						"id": "64f1234567890abcdef12345",
						"name": "Sarah Johnson"
					},
					{
						"id": "64f1234567890abcdef12346",
						"name": "Michael Chen"
					},
					{
						"id": "64f1234567890abcdef12347",
						"name": "Emma Williams"
					}
				]
			},
			"lunch": {
				"count": 2,
				"guests": [
					{
						"id": "64f1234567890abcdef12345",
						"name": "Sarah Johnson"
					},
					{
						"id": "64f1234567890abcdef12348",
						"name": "David Rodriguez"
					}
				]
			},
			"dinner": {
				"count": 1,
				"guests": [
					{
						"id": "64f1234567890abcdef12349",
						"name": "Lisa Thompson"
					}
				]
			}
		},
		"2025-01-16": {
			"breakfast": {
				"count": 2,
				"guests": [
					{
						"id": "64f1234567890abcdef12346",
						"name": "Michael Chen"
					},
					{
						"id": "64f1234567890abcdef12347",
						"name": "Emma Williams"
					}
				]
			},
			"lunch": {
				"count": 0,
				"guests": []
			},
			"dinner": {
				"count": 1,
				"guests": [
					{
						"id": "64f1234567890abcdef12345",
						"name": "Sarah Johnson"
					}
				]
			}
		}
	},
	"byGuest": {
		"64f1234567890abcdef12345": {
			"name": "Sarah Johnson",
			"skippedMeals": [
				{ "date": "2025-01-15", "meals": ["breakfast", "lunch"] },
				{ "date": "2025-01-16", "meals": ["dinner"] }
			],
			"totalSkippedBreakfast": 1,
			"totalSkippedLunch": 1,
			"totalSkippedDinner": 1
		},
		"64f1234567890abcdef12346": {
			"name": "Michael Chen",
			"skippedMeals": [
				{ "date": "2025-01-15", "meals": ["breakfast"] },
				{ "date": "2025-01-16", "meals": ["breakfast"] }
			],
			"totalSkippedBreakfast": 2,
			"totalSkippedLunch": 0,
			"totalSkippedDinner": 0
		}
	}
}

Use Cases

Kitchen Planning

Use the byDate section to plan daily meal preparation:
// Calculate meals needed for each day
const mealCounts = response.byDate;
const totalGuests = response.summary.totalGuests;

Object.keys(mealCounts).forEach((date) => {
	const day = mealCounts[date];
	console.log(`${date}:`);
	console.log(`  Breakfast for ${totalGuests - day.breakfast.count} guests`);
	console.log(`  Lunch for ${totalGuests - day.lunch.count} guests`);
	console.log(`  Dinner for ${totalGuests - day.dinner.count} guests`);
});

Guest Management

Use the byGuest section to track individual dietary patterns:
// Find guests with frequent meal skipping
const frequentSkippers = Object.values(response.byGuest)
	.filter((guest) => {
		const totalSkipped =
			guest.totalSkippedBreakfast +
			guest.totalSkippedLunch +
			guest.totalSkippedDinner;
		return totalSkipped > 3;
	})
	.map((guest) => guest.name);

console.log('Guests with frequent meal skipping:', frequentSkippers);

Summary Analytics

Use the summary section for high-level insights:
const { summary } = response;
const skippingRate = (summary.guestsWithSkipping / summary.totalGuests) * 100;
console.log(`${skippingRate.toFixed(1)}% of guests skip at least one meal`);
console.log(`Most affected meals: ${summary.mealsAffected.join(', ')}`);

Notes

  • Only active guests are included (excludes cancelled, waiting list, and review status)
  • Dates are returned in YYYY-MM-DD format
  • Guest names are formatted as “FirstName LastName”
  • Empty meal arrays indicate no skipping for that meal type
  • All times are in the center’s configured timezone
  • Data is updated in real-time as guests modify their preferences