Skip to main content
POST
Ask the AI Coach for swap options

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
reason
string

Why the patient wants a swap, in their words. The AI Coach uses it to choose options.

Maximum string length: 500
Example:

"I don't like fish"

avoid
string[]
Maximum array length: 20
Example:

Response

Options checked against the plan's constraints.

item_id
string<uuid>
required
Example:

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

options
object[]
required

Only options that keep the protocol's targets and the rule-matrix constraints (allergies, foods to avoid, calorie floor). Empty when none does; note then says why.

expires_at
string<date-time>
required

ISO 8601 in UTC.

Example:

"2026-10-26T14:05:00Z"

note
string | null
Example:

null