Programs API

Elimination diet programs: safety screen, phases and challenges. 7 ops: screen_for_program, start_program, get_program, record_relief_check, record_challenge, advance_program, stop_program.

Elimination diet programs: safety screen, phases and challenges.

Safety screen for a program · POST /api/v1/screen_for_program · scope programs:read or GET …?input=

The safety screen every elimination program starts with. Without answers it returns the questions to ask (age, pregnancy or breastfeeding, eating-disorder history, and red flags: blood in stool, unintended weight loss, night-time symptoms, fever, anemia, symptoms starting after 50, family history of colon cancer, celiac or IBD). With answers it returns clear, see_doctor_first (a red flag: a doctor first) or blocked (under 18, pregnant or breastfeeding, or disordered eating: no restrictive diet here). Ask every question; never assume an answer. Nothing is stored. Free.

curl -X POST https://getgutlog.com/api/v1/screen_for_program \  -H "Authorization: Bearer gutlog_…"

Start an elimination program · POST /api/v1/start_program · scope programs:write

Start an elimination program after the safety screen (pass the same answers as safety_screen). kind low_fodmap: elimination 2–6 weeks with low-FODMAP swaps and a weekly adequate-relief check, then reintroduction of one subgroup at a time (lactose, excess_fructose, sorbitol, mannitol, gos, fructans_wheat, fructans_garlic, fructans_onion; 3 days of increasing doses, then 3 washout days), then personalization. kind single_food with target (dairy, gluten, lactose, caffeine, capsaicin, alcohol, fructans, gos, excess_fructose, sorbitol, mannitol or any taxonomy ingredient id): remove 2–4 weeks, reintroduce over 3 days, compare. If the screen does not clear, nothing starts: the reply has status blocked and the reason to relay. Returns the program, its schedule and the next action. Recommend a registered dietitian. Plus plan.

curl -X POST https://getgutlog.com/api/v1/start_program \  -H "Authorization: Bearer gutlog_…" \  -H "Content-Type: application/json" \  -d '{"kind":"low_fodmap","safety_screen":{"age":1,"pregnant_or_breastfeeding":false,"eating_disorder_history":false,"red_flags":{"blood_in_stool":false,"unintended_weight_loss":false,"night_symptoms":false,"fever":false,"anemia":false,"onset_after_50":false,"family_history_colon_cancer":false,"celiac_or_ibd":false}}}'

Get a program · POST /api/v1/get_program · scope programs:read or GET …?input=

The running elimination program (or one by id): phase, day, next action in words to relay, the schedule of challenges with doses and results, the tummy-score comparison before and during elimination, low-FODMAP swaps for foods the person actually ate recently, and the dietitian recommendation.

curl -X POST https://getgutlog.com/api/v1/get_program \  -H "Authorization: Bearer gutlog_…"

Record the weekly relief check · POST /api/v1/record_relief_check · scope programs:write

The weekly question during elimination: "Over the past 7 days, have you had adequate relief of your gut symptoms?" Record yes or no. Reintroduction needs adequate relief after at least 2 weeks; no relief by 6 weeks means stop and talk to a doctor or dietitian.

curl -X POST https://getgutlog.com/api/v1/record_relief_check \  -H "Authorization: Bearer gutlog_…" \  -H "Content-Type: application/json" \  -d '{"adequate_relief":false}'

Record a challenge dose · POST /api/v1/record_challenge · scope programs:write

During reintroduction: record that the person ate today's challenge dose and how they reacted (none, mild, moderate, severe, or unsure). The first call starts the next challenge (or the one named in challenge). A moderate or severe reaction stops the challenge; after the third dose it is settled as tolerated or symptoms, with the largest dose that was fine, then a 3-day washout. One dose a day. Plus plan.

curl -X POST https://getgutlog.com/api/v1/record_challenge \  -H "Authorization: Bearer gutlog_…" \  -H "Content-Type: application/json" \  -d '{"reaction":"none"}'

Advance a program · POST /api/v1/advance_program · scope programs:write

Move the running program to its next phase when it is ready: elimination → reintroduction (after 2+ weeks with adequate relief), removal → reintroduce (after 2+ weeks), reintroduction → personalization (every challenge done, or skip_remaining), then finish. Refuses with the reason when it is too early. Returns the program and, at the end, what to limit and what to eat freely. Plus plan.

curl -X POST https://getgutlog.com/api/v1/advance_program \  -H "Authorization: Bearer gutlog_…"

Stop a program · POST /api/v1/stop_program · scope programs:write

Stop the running program (no relief at 6 weeks, too hard to follow, or a doctor's advice). The history stays. Suggest the person returns to a varied diet and talks to a doctor or dietitian if symptoms continue.

curl -X POST https://getgutlog.com/api/v1/stop_program \  -H "Authorization: Bearer gutlog_…"