Skip to main content
POST
Swap a meal

Authorizations

Authorization
string
header
default:Bearer sandbox_any_token_works
required

A 15-minute token bound to one patient and one enrollment, issued by POST /v1/oauth/token with the token-exchange grant. Treat it as opaque. When it expires, exchange a fresh assertion; there is no refresh token.

Headers

Idempotency-Key
string

Optional on this action. When sent, it works as on creating requests (24 hours, same body).

Required string length: 8 - 255

Path Parameters

item_id
string<uuid>
required

Body

application/json
option_id
string
required
Example:

"opt_1"

reason
string
Maximum string length: 500
Example:

"I don't like fish"

Response

The swapped meal.

id
string<uuid>
required
Example:

"3c1e8f20-5b7a-4d9c-8e61-0a2b4c6d8e01"

day_index
integer
required

Day in the plan's cycle, starting at 0 on starts_on.

Required range: x >= 0
Example:

0

meal_type
enum<string>
required
Available options:
breakfast,
lunch,
dinner,
snack
Example:

"lunch"

sort_order
integer
required
Example:

0

title
string
required
Example:

"Greek yogurt bowl"

details
object
required
description
string | null
Example:

"Nonfat Greek yogurt with berries and almonds"

protein_g
number | null
Example:

24

calories_kcal
integer | null
Example:

310

recipe_id
string<uuid> | null

A library recipe, when the meal comes from one. Read it with GET /v1/patient/library/{library_item_id}.

Example:

null

swap
object | null

Set when the meal was swapped. The original meal is kept.

my_rating
object | null

The patient's rating of this meal, or null.