---
title: "Aggregate lead totals and breakdowns by stage and source"
method: GET
path: "/leads/summary"
tags: ["Leads"]
---

# Aggregate lead totals and breakdowns by stage and source

`GET /leads/summary`

## Request

- Base URL: `https://app.buildworkpro.com/api/v1`
- URL: `https://app.buildworkpro.com/api/v1/leads/summary`
- Auth: HTTP bearer

Returns flat totals (count, estimated_value_total) plus a breakdown by pipeline stage (with stage name joined from lead_stages) and a breakdown by source. `totals.count` counts every matching lead; `totals.estimated_value_total` and each `by_source[].estimated_value_total` are the OPEN pipeline value — leads in a Won or Lost stage are excluded, matching the app's Pipeline Value. `by_stage[]` reports each stage's own sum (a Won/Lost bucket carries its closed value) and flags closed stages with `isWon` / `isLost`. Null source becomes its own bucket. Money values are decimal strings. Date filter applies to createdAt.

## Query parameters

- `dateFrom` string, date-time
- `dateTo` string, date-time
- `assignedTo` integer
- `stageId` integer

## Response `200`

Lead summary

- object
  - `data` object, required
    - `totals` object, required
      - `count` integer, required
      - `estimated_value_total` string, required
    - `by_stage` object[], required
      - `stageId` integer, nullable, required
      - `stageName` string, nullable, required
      - `isWon` boolean, nullable, required
      - `isLost` boolean, nullable, required
      - `count` integer, required
      - `estimated_value_total` string, required
    - `by_source` object[], required
      - `source` string, nullable, required
      - `count` integer, required
      - `estimated_value_total` string, required
  - `meta` ResponseMeta, required
    - `request_id` string: Server-generated request identifier
    - `pagination` PaginationMeta
      - `cursor` string, nullable, required: Opaque cursor for the next page; null when no more results
      - `has_more` boolean, required: Whether more pages are available after this one
      - `count` integer, required: Items in this page

## Other responses

- `403`: Scope insufficient
- `422`: Validation failed

---

[API](https://skmtc.dev/buildworkpro/apis/buildworkpro-api.md) · [All operations](https://skmtc.dev/buildworkpro/apis/buildworkpro-api/llms.txt) · [OpenAPI document](https://skmtc.dev/buildworkpro/apis/buildworkpro-api/revisions/441cf40012f7?raw)
