---
title: "Get Stats Overview"
method: GET
path: "/v1/stats/overview"
tags: ["stats"]
---

# Get Stats Overview

`GET /v1/stats/overview`

## Request

- Base URL: `https://api.linktodm.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.linktodm.com/v1/stats/overview`
- Auth: HTTP bearer

Return hits + clicks for the authenticated user, scoped to the
requested time range and (optionally) a single channel.

Top-of-funnel half of the stats page. Conversion-side metrics
(`dms_sent`, `follows`, `contacts`) live on `/extended_overview`.

When `channel_id` is omitted the totals span all of the user's channels.
When set, it's parsed by `parse_channel_id` to extract exactly one of
`instagram_user_id` / `instagram_business_account_id` / `facebook_account_id`,
which is then applied as an equality filter on every branch.

## Query parameters

- `range` 'all' | '24h' | '7d' | '30d': Time-range window applied to every metric on the stats page. Mirrors the frontend tabs (`All time / 24 hours / 7 days / 30 days`).
- `channel_id` string, nullable

## Response `200`

Successful Response

- StatsOverviewResponse: Top-of-funnel aggregate counts for the current user, scoped to the requested time range. Kept intentionally light so it answers fast — the genuinely heavy metrics (follows self-join, contacts scan) live on `/v1/stats/extended_overview`. - `hits`: trigger matches across both surfaces — comments matched by a normal automation keyword (`event_tracker.AUTODM_KEYWORD_FOUND`) plus flow automation triggers fired (`flow_event_tracker.FLOW_TRIGGER_FOUND`). - `clicks`: tracked-URL clicks across both surfaces (`event_tracker.URL_CLICKED` + flow `URL_CLICKED` / `BUTTON_CLICKED`). - `dms_sent`: DMs sent — `event_tracker.AUTODM_DM_SENT` for normal automations plus completed message-type `flow_execution_step` rows for flow automations. Cheap to count, so it lives here (next to clicks) rather than on the extended endpoint, letting the page render CTR without a second round-trip. - `ctr`: click-through rate as a percentage, `clicks / dms_sent * 100`, rounded to 2 decimals. `0.0` when `dms_sent` is 0 (no divide-by-zero).
  - `hits` integer, required
  - `clicks` integer, required
  - `dms_sent` integer, required
  - `ctr` number, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/linktodm/apis/salesmorph.md) - [All operations](https://skmtc.dev/linktodm/apis/salesmorph/llms.txt) - [OpenAPI document](https://skmtc.dev/linktodm/apis/salesmorph/revisions/4af0ad5dbe92?raw)
