Facebook Pixel
Fit'DistanceDocumentation
Open the app

Habits

2 routes

GET /habits

Habits of the coach, archived ones included.

  • Scope habits:read
  • 1 credit
  • Read
  • Stable

Parameters

NameTypeDescription
limitqueryinteger1–200, default 50
cursorquerystringOpaque cursor: next_cursor of the previous page.
sincequerydate-timeISO 8601. Returns the objects with updated_at >= since.
include_deletedquerybooleandefault 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

NameTypeDescription
id requiredstring
coach_id requiredinteger
name requiredstring
is_archived requiredboolean
updated_at requireddate-time
deleted_atdate-time | nullPresent when include_deleted is true.

Errors

StatusCodeWhen
400VALIDATIONInvalid parameters or body.billed
401UNAUTHORIZEDKey missing, unknown or revoked.not billed
402CREDITS_EXHAUSTEDNo credits left this month and no reserve.not billed
403SCOPE_MISSINGThe key doesn't have the required scope.not billed
403PLAN_NOT_ELIGIBLEYour plan doesn't include the API.not billed
429RATE_LIMITEDToo 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

NameTypeDescription
limitqueryinteger1–200, default 50
cursorquerystringOpaque cursor: next_cursor of the previous page.
sincequerydate-timeISO 8601. Returns the objects with updated_at >= since.
include_deletedquerybooleandefault false
student_idqueryinteger≥ 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

NameTypeDescription
id requiredstring
habit_id requiredstring
student_id requiredintegerThe student the habit is assigned to.
entry_date requireddateThe day the entry counts for.
completed_at requireddate-time
value_boolean requiredboolean | null
value_number requirednumber | null
value_rating requiredinteger | null
value_choice requiredstring | null
value_text requiredstring | null
note requiredstring | null
updated_at requireddate-time
deleted_atdate-time | nullPresent when include_deleted is true. An entry is deleted with its habit or its assignment.

Errors

StatusCodeWhen
400VALIDATIONInvalid parameters or body.billed
401UNAUTHORIZEDKey missing, unknown or revoked.not billed
402CREDITS_EXHAUSTEDNo credits left this month and no reserve.not billed
403SCOPE_MISSINGThe key doesn't have the required scope.not billed
403PLAN_NOT_ELIGIBLEYour plan doesn't include the API.not billed
429RATE_LIMITEDToo many calls: 10 per second, 300 per minute, 60 writes and 20 deletes per minute.not billed