---
title: "Bulk habit consistency stats"
method: POST
path: "/completed-activity/consistency-stats"
tags: ["completed-activity"]
---

# Bulk habit consistency stats

`POST /completed-activity/consistency-stats`

## Request

- Base URL: `https://api.focusbear.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.focusbear.io/completed-activity/consistency-stats`
- Auth: HTTP bearer

Returns, for each owned habit in the request, the number of distinct local days with at least one completion in the last `days_number` days. Replaces one single-habit stats GET per habit. Ids that are unknown or not owned by the caller are omitted. `timezone` is presentation-only and never updates user settings.

## Request body

- GetBulkConsistencyStatsDto
  - `days_number` number, required
  - `activity_ids` string[], required
  - `timezone` string, required

## Response `200`

- BulkConsistencyStats
  - `days_number` number, required
  - `habits` HabitConsistencyStat[], required
    - `activity_id` string, required
    - `completed_days` number, required: Number of distinct local days with at least one completion in the window.
    - `scheduled_days` number, required: Days in the window the habit was due: on or after its creation day, on a weekday in its `days_of_week`. Uses the current schedule for the whole window.
    - `consistency_percent` number, nullable, required: `completed_days` as a percentage of `scheduled_days`, rounded and capped at 100. Null when the habit had no scheduled days in the window, so it has no score and should be left out of consistency rankings.

---

[API](https://skmtc.dev/focusbear/apis/focusbear-api.md) - [All operations](https://skmtc.dev/focusbear/apis/focusbear-api/llms.txt) - [OpenAPI document](https://skmtc.dev/focusbear/apis/focusbear-api/revisions/3a83a3b9a811?raw)
