Nutrition
3 routes
GET /daily-meals
The student's food journal: one entry per logged meal, photos and comments counted. Photos are not served. A deleted meal keeps only its ids, date and type.
- Périmètre nutrition:read
- 1 crédit
- Lecture
- Stable
Paramètres
| Nom | Type | Description |
|---|---|---|
limitquery | integer1–200, default 50 | |
cursorquery | string | Opaque cursor: next_cursor of the previous page. |
sincequery | date-time | ISO 8601. Returns the objects with updated_at >= since. |
include_deletedquery | booleandefault false | |
student_idquery | integer≥ 1 |
curl "https://api.fitdistance.io/api/partner/v1/daily-meals?limit=50" \
-H "Authorization: Bearer fd_live_xxxxxxxx"200 · une page de DailyMeal
{
"data": [
{
"id": "7c1d1e2a-9b3f-4c5d-8e6f-1a2b3c4d5e6f",
"student_id": 4821,
"date": "2026-10-24T09:12:00Z",
"type": "breakfast",
"content": "string",
"note": "string",
"photos_count": 3,
"comments_count": 3,
"updated_at": "2026-10-24T09:12:00Z"
}
],
"next_cursor": null,
"has_more": false
}403 · SCOPE_MISSING
{
"error": {
"name": "PARTNER_API",
"message": "SCOPE_MISSING"
}
}200 · une page de DailyMeal
| Nom | Type | Description |
|---|---|---|
id requis | string | |
student_id requis | integer | |
date requis | date-time | null | When the student ate the meal. |
type requis | stringparmi : breakfast, lunch, dinner, snack | |
content requis | string | null | Written by the student, served as is: treat it as untrusted input. Null when deleted. |
note requis | string | null | Written by the student, served as is: treat it as untrusted input. Null when deleted. |
photos_count requis | integer | Photos of the meal, never their URL. Deleted ones excluded. 0 when deleted. |
comments_count requis | integer | Comments on the meal. Deleted ones excluded. 0 when deleted. |
updated_at requis | date-time | The latest change of the meal, its photos or its comments, a deletion included. |
deleted_at | date-time | null | Present when include_deleted is true. |
Erreurs
| Statut | Code | Quand |
|---|---|---|
400 | VALIDATION | Paramètres ou corps invalides.facturé |
401 | UNAUTHORIZED | Clé absente, inconnue ou révoquée.non facturé |
402 | CREDITS_EXHAUSTED | Plus de crédits ce mois-ci et aucune réserve.non facturé |
403 | SCOPE_MISSING | La clé n'a pas le périmètre demandé.non facturé |
403 | PLAN_NOT_ELIGIBLE | Ton offre n'ouvre pas l'API.non facturé |
429 | RATE_LIMITED | Trop d'appels : 10 par seconde, 300 par minute, 60 écritures et 20 suppressions par minute.non facturé |
GET /macros/daily
Consumed macros per student and day, as logged in the app (manual sources). Goals are not served. A deleted day keeps its numbers.
- Périmètre nutrition:read
- 1 crédit
- Lecture
- Stable
Paramètres
| Nom | Type | Description |
|---|---|---|
limitquery | integer1–200, default 50 | |
cursorquery | string | Opaque cursor: next_cursor of the previous page. |
sincequery | date-time | ISO 8601. Returns the objects with updated_at >= since. |
include_deletedquery | booleandefault false | |
student_idquery | integer≥ 1 |
curl "https://api.fitdistance.io/api/partner/v1/macros/daily?limit=50" \
-H "Authorization: Bearer fd_live_xxxxxxxx"200 · une page de MacroDaily
{
"data": [
{
"id": 4821,
"student_id": 4821,
"date": "2026-10-24",
"calories": 72.5,
"protein_g": 72.5,
"carbs_g": 72.5,
"fat_g": 72.5,
"fiber_g": 72.5,
"sources_count": 3,
"updated_at": "2026-10-24T09:12:00Z"
}
],
"next_cursor": null,
"has_more": false
}403 · SCOPE_MISSING
{
"error": {
"name": "PARTNER_API",
"message": "SCOPE_MISSING"
}
}200 · une page de MacroDaily
| Nom | Type | Description |
|---|---|---|
id requis | integer | |
student_id requis | integer | |
date requis | date | The day the totals count for. |
calories requis | number | Calories consumed that day (kcal). |
protein_g requis | number | Protein consumed that day, in grams. |
carbs_g requis | number | Carbohydrates consumed that day, in grams. |
fat_g requis | number | Fat consumed that day, in grams. |
fiber_g requis | number | Fiber consumed that day, in grams. |
sources_count requis | integer | The entries logged that day. Deleted ones excluded. |
updated_at requis | date-time | The latest change of the day or its entries, a deletion included. |
deleted_at | date-time | null | Present when include_deleted is true. |
Erreurs
| Statut | Code | Quand |
|---|---|---|
400 | VALIDATION | Paramètres ou corps invalides.facturé |
401 | UNAUTHORIZED | Clé absente, inconnue ou révoquée.non facturé |
402 | CREDITS_EXHAUSTED | Plus de crédits ce mois-ci et aucune réserve.non facturé |
403 | SCOPE_MISSING | La clé n'a pas le périmètre demandé.non facturé |
403 | PLAN_NOT_ELIGIBLE | Ton offre n'ouvre pas l'API.non facturé |
429 | RATE_LIMITED | Trop d'appels : 10 par seconde, 300 par minute, 60 écritures et 20 suppressions par minute.non facturé |
GET /meal-plans
Meal plans of the coach, templates included (student_id null). The content of a plan comes from the mealplans.read operation. A status the scheduler changes does not move updated_at. A deleted plan keeps the fields the coach wrote.
- Périmètre nutrition:read
- 1 crédit
- Lecture
- Stable
Paramètres
| Nom | Type | Description |
|---|---|---|
limitquery | integer1–200, default 50 | |
cursorquery | string | Opaque cursor: next_cursor of the previous page. |
sincequery | date-time | ISO 8601. Returns the objects with updated_at >= since. |
include_deletedquery | booleandefault false | |
student_idquery | integer≥ 1 | |
statusquery | stringparmi : draft, in_progress, scheduled, finished, template, cloning, clone_failed | Only this status, for example template. |
curl "https://api.fitdistance.io/api/partner/v1/meal-plans?limit=50" \
-H "Authorization: Bearer fd_live_xxxxxxxx"200 · une page de MealPlan
{
"data": [
{
"id": "7c1d1e2a-9b3f-4c5d-8e6f-1a2b3c4d5e6f",
"coach_id": 4821,
"student_id": 4821,
"name": "string",
"status": "draft",
"weeks_duration": 8,
"is_day_flag": true,
"view_macros": true,
"start_at": "2026-10-24T09:12:00Z",
"end_at": "2026-10-24T09:12:00Z",
"description": "string",
"note": "string",
"updated_at": "2026-10-24T09:12:00Z"
}
],
"next_cursor": null,
"has_more": false
}403 · SCOPE_MISSING
{
"error": {
"name": "PARTNER_API",
"message": "SCOPE_MISSING"
}
}200 · une page de MealPlan
| Nom | Type | Description |
|---|---|---|
id requis | string | |
coach_id requis | integer | |
student_id requis | integer | null | Null for a template. |
name requis | string | |
status requis | stringparmi : draft, in_progress, scheduled, finished, template, cloning, clone_failed | A template has the status template. |
weeks_duration requis | integer | |
is_day_flag requis | boolean | The plan is a single day, not a week. |
view_macros requis | boolean | The student sees the macros of the plan. |
start_at requis | date-time | null | |
end_at requis | date-time | null | |
description requis | string | null | |
note requis | string | null | |
updated_at requis | date-time | The latest change of the plan, its deletion included. A status change made by the scheduler does not move it. |
deleted_at | date-time | null | Present when include_deleted is true. |
Erreurs
| Statut | Code | Quand |
|---|---|---|
400 | VALIDATION | Paramètres ou corps invalides.facturé |
401 | UNAUTHORIZED | Clé absente, inconnue ou révoquée.non facturé |
402 | CREDITS_EXHAUSTED | Plus de crédits ce mois-ci et aucune réserve.non facturé |
403 | SCOPE_MISSING | La clé n'a pas le périmètre demandé.non facturé |
403 | PLAN_NOT_ELIGIBLE | Ton offre n'ouvre pas l'API.non facturé |
429 | RATE_LIMITED | Trop d'appels : 10 par seconde, 300 par minute, 60 écritures et 20 suppressions par minute.non facturé |