Skip to main content

Progress

Habits

A client's habits and their progress against the goal, day by day or week by week.

A habit is something a coach asked a client to do each day or week, like 10,000 steps a day or meditating 3 times a week, with a goal the client logs against. A habit's progress is one row per day or week it ran, with what the client logged and whether it met the goal in force then. To compare clients' habits over a period, use GET /client-summaries with include=habits.

Attributes

  • idstring

    Its unique ID.

  • namestring
  • emojistring
  • goalobject
    Show 4 child attributes
    • typeenum

      numeric when the client logs an amount (steps, litres), completion when they tick it off.

      Known valuesnumericcompletion
    • valuenumbernullable

      The amount to reach each period. For a completion habit, how many ticks (1 a day, or 1 to 7 a week).

    • unitstringnullable

      The unit the coach picked, like steps, km or cups. null for a completion habit.

    • periodenum

      Whether the goal is for each day, each Monday-to-Sunday week, or each month.

      Known valuesdayweekmonth
  • endDatedatenullable
  • statusenum

    Against today in the client's timezone.

    Known valuesupcomingactiveended
  • createdAttimestamp

    When it was created.

Habit object
{
  "id": "6ad6af3f8234ff3e82336c41",
  "name": "10,000 steps a day",
  "emoji": "🚶",
  "description": "Walk at least 10,000 steps every day.",
  "goal": {
    "type": "numeric",
    "value": 10000,
    "unit": "steps",
    "period": "day"
  },
  "startDate": "2026-03-02",
  "endDate": null,
  "status": "active",
  "createdAt": "2026-03-02T15:04:11.000Z"
}

Attributes

  • The period's first day; a week starts on a Monday.

  • The period's last day. The same as startDate for a daily habit.

  • What the client logged in the period. For a completion habit, how many days they ticked it.

  • goalValuenumbernullable

    The goal in force in the period, which may differ from the habit's current goal if the coach changed it since.

  • completedboolean

    Whether the period met its goal, as the app records it.

Habit progress object
{
  "startDate": "2026-10-26",
  "endDate": "2026-10-26",
  "loggedValue": 9412,
  "goalValue": 10000,
  "completed": true
}
GET/v1/clients/{clientId}/habits

The habits the coach gave the client, newest first, each with its current goal and whether it's upcoming, active or ended. A client has no more than 25 (MAX_HABITS_PER_CLIENT), so they all come in one response, without paging; a client given more before that limit still gets every one. Empty if the coach turned habits off for the client. Requires clients:read.

Path parameters

Returns

Every habit the client has.

GET /v1/clients/{clientId}/habits
curl https://api.hubfit.com/v1/clients/6ad6af41d3199442d31b2743/habits \
  -H "Authorization: Bearer $HUBFIT_API_KEY"
Response200 OK
{
  "data": [
    {
      "id": "6ad6af3f8234ff3e82336c41",
      "name": "10,000 steps a day",
      "emoji": "🚶",
      "description": "Walk at least 10,000 steps every day.",
      "goal": {
        "type": "numeric",
        "value": 10000,
        "unit": "steps",
        "period": "day"
      },
      "startDate": "2026-03-02",
      "endDate": null,
      "status": "active",
      "createdAt": "2026-03-02T15:04:11.000Z"
    }
  ]
}
GET/v1/habits/{habitId}/progress

One row for each day (or Monday-to-Sunday week, or month, as the habit's goal is set) the habit was running, up to today, most recent first. Each has what the client logged in it, the goal in force then, and whether it was completed. Days or weeks the client logged nothing in are listed too. 404 if the coach turned habits off for the client. Requires clients:read.

Path parameters

  • habitIdstringRequired

    A habit id from GET /clients/{clientId}/habits.

Query parameters

  • Only periods from the one this day falls in, as YYYY-MM-DD. Days are the client's own calendar days.

  • Only periods up to the one this day falls in, as YYYY-MM-DD.

  • limitinteger

    How many results to return, from 1 to 100.

    Default 25
  • cursorstring

    The nextCursor from the previous page.

Returns

A page of the habit's periods.

GET /v1/habits/{habitId}/progress
curl -G https://api.hubfit.com/v1/habits/6ad6af3f8234ff3e82336c41/progress \
  -H "Authorization: Bearer $HUBFIT_API_KEY" \
  -d startDate=2026-10-20 \
  -d endDate=2026-10-26
Response200 OK
{
  "data": [
    {
      "startDate": "2026-10-26",
      "endDate": "2026-10-26",
      "loggedValue": 9412,
      "goalValue": 10000,
      "completed": true
    }
  ],
  "nextCursor": "eyJpZCI6IjZhZDZhZjNmMjljNTk3ZjE1In0",
  "totalCount": 48
}