Skip to main content
POST

Authorizations

Authorization
string
header
required

OAuth bearer token for Health API authentication

Path Parameters

user_id
string
required

User ID (e.g., google_104940819145861640201)

Body

application/json

Meal data (requires either description or image_base64)

Input schema for creating or updating a meal

meal_time
string<date-time>
required

ISO 8601 timestamp of when the meal was consumed

Example:

"2024-10-28T12:00:00Z"

description
string
required

Text description of the meal/food consumed. Required if image_base64 is not provided.

Maximum string length: 2000
Example:

"Grilled chicken breast with quinoa and steamed broccoli"

image_base64
string

Base64-encoded image data with data URI prefix. Required if description is not provided.

Pattern: ^data:image/(jpeg|png|jpg);base64,[A-Za-z0-9+/=]+$
Example:

"data:image/jpeg;base64,/9j/4AAQSkZJRg..."

portion_multiplier
number
default:1

Multiplier for portion size (default 1.0)

Required range: 0.1 <= x <= 10
Example:

1.5

comment
string

Additional comment about the meal

Maximum string length: 500
Example:

"Homemade healthy lunch"

Response

Meal created successfully (analysis pending)

A meal record with nutrition analysis status

id
string
required

Unique meal identifier (ULID format)

Example:

"meal_01JCXVK5N3P4Q2R7S8T9U0V1W2"

user_id
string
required

User ID this meal belongs to

project_id
string
required

Project ID this meal belongs to

meal_time
string<date-time>
required

ISO 8601 timestamp of when the meal was consumed

Example:

"2024-10-28T12:00:00Z"

analysis_status
enum<string>
required

Status of nutrition analysis

Available options:
pending,
complete,
failed
Example:

"complete"

created_at
string<date-time>
required

ISO 8601 timestamp when the meal was created

Example:

"2024-10-28T12:05:00Z"

updated_at
string<date-time>
required

ISO 8601 timestamp when the meal was last updated

Example:

"2024-10-28T12:10:00Z"

description
string

Text description of the meal/food consumed

Maximum string length: 2000
Example:

"Grilled chicken breast with quinoa and steamed broccoli"

image_url
string<uri>

Presigned URL to access the meal image (expires in 24 hours)

Example:

"https://s3.amazonaws.com/bucket/meals/image.jpg?X-Amz-..."

portion_multiplier
number
default:1

Multiplier for portion size

Required range: 0.1 <= x <= 10
Example:

1.5

comment
string

Additional comment about the meal

Maximum string length: 500
Example:

"Homemade healthy lunch"

analysis_error
string

Error message when analysis_status is 'failed' (max 500 characters, truncated if longer)

Maximum string length: 500
Example:

"Failed to analyze meal: Image is not food-related"

summary_id
string

Reference to the AI-generated MealSummary (set when analysis completes)

Example:

"aisummary_01JCXVK5N3P4Q2R7S8T9U0V1W2"

ai_generated
boolean

True if this meal has been analyzed by AI

Example:

true

title
string

AI-generated title for the meal summary

Example:

"Meal Summary"

text
string

AI-generated analysis text

Example:

"Great balanced meal! This chicken with broccoli and brown rice provides excellent protein (35g) with moderate carbs."

name
string

AI-identified meal name

Example:

"Grilled Chicken with Vegetables"

ingredients
string

AI-identified ingredients list

Example:

"chicken breast, broccoli, brown rice, olive oil"

calories
integer

Estimated calories (kcal)

Example:

450

protein_grams
number

Estimated protein in grams

Example:

35

fat_grams
number

Estimated fat in grams

Example:

12

carbohydrate_grams
number

Estimated carbohydrates in grams

Example:

45

sugar_grams
number

Estimated sugar in grams

Example:

5

fiber_grams
number

Estimated fiber in grams

Example:

6

glucose_spike_mg_dl
integer

Estimated glucose spike in mg/dL

Example:

25

healthiness_score
string

Overall healthiness grade (A-E, where A is healthiest and E is least healthy)

Example:

"A"