Habits
2 routes
GET /habits
Habits of the coach, archived ones included.
- Scope habits:read
- 1 credit
- Read
- Stable
Parameters
| Name | 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 · a page of 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 · a page of Habit
| Name | Type | Description |
|---|---|---|
id required | string | |
coach_id required | integer | |
name required | string | |
is_archived required | boolean | |
updated_at required | date-time | |
deleted_at | date-time | null | Present when include_deleted is true. |
Errors
| Status | Code | When |
|---|---|---|
400 | VALIDATION | Invalid parameters or body.billed |
401 | UNAUTHORIZED | Key missing, unknown or revoked.not billed |
402 | CREDITS_EXHAUSTED | No credits left this month and no reserve.not billed |
403 | SCOPE_MISSING | The key doesn't have the required scope.not billed |
403 | PLAN_NOT_ELIGIBLE | Your plan doesn't include the API.not billed |
429 | RATE_LIMITED | Too many calls: 10 per second, 300 per minute, 60 writes and 20 deletes per minute.not billed |
GET /habits/entries
Completed habit entries: one per student, habit and day. The value column that applies depends on the habit type.
- Scope habits:read
- 1 credit
- Read
- Stable
Parameters
| Name | 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 · a page of 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 · a page of HabitEntry
| Name | Type | Description |
|---|---|---|
id required | string | |
habit_id required | string | |
student_id required | integer | The student the habit is assigned to. |
entry_date required | date | The day the entry counts for. |
completed_at required | date-time | |
value_boolean required | boolean | null | |
value_number required | number | null | |
value_rating required | integer | null | |
value_choice required | string | null | |
value_text required | string | null | |
note required | string | null | |
updated_at required | date-time | |
deleted_at | date-time | null | Present when include_deleted is true. An entry is deleted with its habit or its assignment. |
Errors
| Status | Code | When |
|---|---|---|
400 | VALIDATION | Invalid parameters or body.billed |
401 | UNAUTHORIZED | Key missing, unknown or revoked.not billed |
402 | CREDITS_EXHAUSTED | No credits left this month and no reserve.not billed |
403 | SCOPE_MISSING | The key doesn't have the required scope.not billed |
403 | PLAN_NOT_ELIGIBLE | Your plan doesn't include the API.not billed |
429 | RATE_LIMITED | Too many calls: 10 per second, 300 per minute, 60 writes and 20 deletes per minute.not billed |