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_…"npx @meterapp/gutlog screen_for_program{
"type": "object",
"properties": {
"answers": {
"type": "object",
"properties": {
"age": {
"type": "integer",
"minimum": 1,
"maximum": 120,
"description": "The person's age in years."
},
"pregnant_or_breastfeeding": {
"type": "boolean",
"description": "Is the person pregnant or breastfeeding?"
},
"eating_disorder_history": {
"type": "boolean",
"description": "Has the person ever had an eating disorder or disordered eating (restricting, bingeing, purging)?"
},
"red_flags": {
"type": "object",
"properties": {
"blood_in_stool": {
"type": "boolean",
"description": "Blood in your stool, or black, tarry stools?"
},
"unintended_weight_loss": {
"type": "boolean",
"description": "Losing weight without trying?"
},
"night_symptoms": {
"type": "boolean",
"description": "Symptoms that wake you up at night (pain or diarrhea)?"
},
"fever": {
"type": "boolean",
"description": "Fever with your gut symptoms?"
},
"anemia": {
"type": "boolean",
"description": "Anemia (low iron or low blood count) found on a blood test?"
},
"onset_after_50": {
"type": "boolean",
"description": "Your gut symptoms first started after age 50?"
},
"family_history_colon_cancer": {
"type": "boolean",
"description": "A parent, sibling or child with colon (bowel) cancer?"
},
"celiac_or_ibd": {
"type": "boolean",
"description": "Celiac disease or inflammatory bowel disease (Crohn's or ulcerative colitis), diagnosed or in your close family?"
}
},
"required": [
"blood_in_stool",
"unintended_weight_loss",
"night_symptoms",
"fever",
"anemia",
"onset_after_50",
"family_history_colon_cancer",
"celiac_or_ibd"
],
"description": "Ask each one plainly. Any yes means a doctor first."
},
"doctor_cleared": {
"description": "Only when a red flag is yes: a doctor has assessed these symptoms and agreed a diet trial is appropriate.",
"type": "boolean"
},
"celiac_tested": {
"description": "Has the person had a celiac blood test while still eating gluten? Cutting wheat first can make that test unreliable.",
"type": "boolean"
}
},
"required": [
"age",
"pregnant_or_breastfeeding",
"eating_disorder_history",
"red_flags"
],
"description": "The safety screen. Ask the person every question; never assume an answer."
}
}
}start_program
writeStart 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}}}'npx @meterapp/gutlog start_program --json '{"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}}}'{
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"low_fodmap",
"single_food"
]
},
"target": {
"description": "single_food only: dairy, gluten, lactose, caffeine, … or an ingredient id.",
"type": "string",
"minLength": 1,
"maxLength": 80
},
"safety_screen": {
"type": "object",
"properties": {
"age": {
"type": "integer",
"minimum": 1,
"maximum": 120,
"description": "The person's age in years."
},
"pregnant_or_breastfeeding": {
"type": "boolean",
"description": "Is the person pregnant or breastfeeding?"
},
"eating_disorder_history": {
"type": "boolean",
"description": "Has the person ever had an eating disorder or disordered eating (restricting, bingeing, purging)?"
},
"red_flags": {
"type": "object",
"properties": {
"blood_in_stool": {
"type": "boolean",
"description": "Blood in your stool, or black, tarry stools?"
},
"unintended_weight_loss": {
"type": "boolean",
"description": "Losing weight without trying?"
},
"night_symptoms": {
"type": "boolean",
"description": "Symptoms that wake you up at night (pain or diarrhea)?"
},
"fever": {
"type": "boolean",
"description": "Fever with your gut symptoms?"
},
"anemia": {
"type": "boolean",
"description": "Anemia (low iron or low blood count) found on a blood test?"
},
"onset_after_50": {
"type": "boolean",
"description": "Your gut symptoms first started after age 50?"
},
"family_history_colon_cancer": {
"type": "boolean",
"description": "A parent, sibling or child with colon (bowel) cancer?"
},
"celiac_or_ibd": {
"type": "boolean",
"description": "Celiac disease or inflammatory bowel disease (Crohn's or ulcerative colitis), diagnosed or in your close family?"
}
},
"required": [
"blood_in_stool",
"unintended_weight_loss",
"night_symptoms",
"fever",
"anemia",
"onset_after_50",
"family_history_colon_cancer",
"celiac_or_ibd"
],
"description": "Ask each one plainly. Any yes means a doctor first."
},
"doctor_cleared": {
"description": "Only when a red flag is yes: a doctor has assessed these symptoms and agreed a diet trial is appropriate.",
"type": "boolean"
},
"celiac_tested": {
"description": "Has the person had a celiac blood test while still eating gluten? Cutting wheat first can make that test unreliable.",
"type": "boolean"
}
},
"required": [
"age",
"pregnant_or_breastfeeding",
"eating_disorder_history",
"red_flags"
],
"description": "The safety screen. Ask the person every question; never assume an answer."
},
"phase_days": {
"description": "Planned length of the elimination (14–42) or removal (14–28) phase; default 28 / 21.",
"type": "integer",
"minimum": 14,
"maximum": 42
}
},
"required": [
"kind",
"safety_screen"
]
}get_program
readGet 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_…"npx @meterapp/gutlog get_program{
"type": "object",
"properties": {
"program_id": {
"description": "Default: the running program.",
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
}
}
}record_relief_check
writeRecord 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}'npx @meterapp/gutlog record_relief_check --json '{"adequate_relief":false}'{
"type": "object",
"properties": {
"program_id": {
"description": "Default: the running program.",
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"adequate_relief": {
"type": "boolean"
}
},
"required": [
"adequate_relief"
]
}record_challenge
writeRecord 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"}'npx @meterapp/gutlog record_challenge --json '{"reaction":"none"}'{
"type": "object",
"properties": {
"program_id": {
"description": "Default: the running program.",
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"challenge": {
"description": "Which challenge to start: lactose, excess_fructose, sorbitol, mannitol, gos, fructans_wheat, fructans_garlic, fructans_onion; default the next pending one.",
"type": "string",
"maxLength": 40
},
"reaction": {
"type": "string",
"enum": [
"none",
"mild",
"moderate",
"severe",
"unsure"
],
"description": "How the person felt in the hours after the dose."
},
"notes": {
"type": "string",
"maxLength": 2000
}
},
"required": [
"reaction"
]
}advance_program
writeAdvance 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_…"npx @meterapp/gutlog advance_program{
"type": "object",
"properties": {
"program_id": {
"description": "Default: the running program.",
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"skip_remaining": {
"default": false,
"description": "Leave untested challenges out and move on.",
"type": "boolean"
}
}
}stop_program
writeStop 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_…"npx @meterapp/gutlog stop_program{
"type": "object",
"properties": {
"program_id": {
"description": "Default: the running program.",
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"reason": {
"type": "string",
"maxLength": 500
}
}
}