---
title: "Get Unread Counts"
method: GET
path: "/api/app-auto-gtm/unread-counts"
tags: ["AppAutoGtm"]
---

# Get Unread Counts

`GET /api/app-auto-gtm/unread-counts`

Unreplied-hot-lead counts for the sidebar badges, split out of ``/user``.

The ``unreplied_hot`` CTE is the heaviest part of the old app-shell query;
serving it here lets the sidebar render instantly and hydrate the badges
from a separate, non-blocking poll. Redis-cached per org (short TTL) so the
poll — and concurrent org members / tabs — stay cheap.

Org-scoped by the org's segment ids and deliberately NOT filtered by the
viewer's ``user_email``, so every member sees the org's real hot-lead
counts (matches the old ``/user`` behaviour and the dashboard CTA).

## Cookies

- `ex_access` string, nullable
- `ex_org` string, nullable

## Response `200`

Successful Response

- UnreadCountsResponse — Unreplied-hot-lead counts for the sidebar badges, served separately from ``/user`` so the heavy ``unreplied_hot`` CTE never blocks the app-shell render. Keys are stringified ids (JSON object keys). ``by_segment`` drives the active project's per-campaign badges; ``by_project`` (sum over a project's segments) drives the dropdown badge. Only non-zero entries are included.
  - `by_segment` object
  - `by_project` object

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/explee/apis/explee-api.md) · [All operations](https://skmtc.dev/explee/apis/explee-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/explee/explee-api/revisions/f169bc6e9447/schema)
