Habitudes
2 routes
GET /habits
Habits of the coach, archived ones included.
- Périmètre habits: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 |
curl "https://api.fitdistance.io/api/partner/v1/habits?limit=50" \
-H "Authorization: Bearer fd_live_xxxxxxxx"200 · une page de Habit
{
"data": [
{
"id": "7c1d1e2a-9b3f-4c5d-8e6f-1a2b3c4d5e6f",
"coach_id": 4821,
"name": "string",
"is_archived": true,
"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 Habit
| Nom | Type | Description |
|---|---|---|
id requis | string | |
coach_id requis | integer | |
name requis | string | |
is_archived requis | boolean | |
updated_at requis | date-time | |
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 /habits/entries
Completed habit entries: one per student, habit and day. The value column that applies depends on the habit type.
- Périmètre habits: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/habits/entries?limit=50" \
-H "Authorization: Bearer fd_live_xxxxxxxx"200 · une page de HabitEntry
{
"data": [
{
"id": "7c1d1e2a-9b3f-4c5d-8e6f-1a2b3c4d5e6f",
"habit_id": "7c1d1e2a-9b3f-4c5d-8e6f-1a2b3c4d5e6f",
"student_id": 4821,
"entry_date": "2026-10-24",
"completed_at": "2026-10-24T09:12:00Z",
"value_boolean": true,
"value_number": 72.5,
"value_rating": 4821,
"value_choice": "string",
"value_text": "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 HabitEntry
| Nom | Type | Description |
|---|---|---|
id requis | string | |
habit_id requis | string | |
student_id requis | integer | The student the habit is assigned to. |
entry_date requis | date | The day the entry counts for. |
completed_at requis | date-time | |
value_boolean requis | boolean | null | |
value_number requis | number | null | |
value_rating requis | integer | null | |
value_choice requis | string | null | |
value_text requis | string | null | |
note requis | string | null | |
updated_at requis | date-time | |
deleted_at | date-time | null | Present when include_deleted is true. An entry is deleted with its habit or its assignment. |
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é |