Skip to content

Aggregate lead totals and breakdowns by stage and source

GET
/leads/summary
curl --request GET \
--url https://app.buildworkpro.com/api/v1/leads/summary \
--header 'Authorization: Bearer <token>'

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. Null source becomes its own bucket. Money values are decimal strings. Date filter applies to createdAt.

dateFrom
string format: date-time
dateTo
string format: date-time
assignedTo
integer
> 0
stageId
integer
> 0

Lead summary

Media type application/json
object
data
required
object
totals
required
object
count
required
integer
estimated_value_total
required
string
by_stage
required
Array<object>
object
stageId
required
integer | null
stageName
required
string | null
count
required
integer
estimated_value_total
required
string
by_source
required
Array<object>
object
source
required
string | null
count
required
integer
estimated_value_total
required
string
meta
required
object
request_id

Server-generated request identifier

string
pagination
object
cursor
required

Opaque cursor for the next page; null when no more results

string | null
has_more
required

Whether more pages are available after this one

boolean
count
required

Items in this page

integer
Example generated
{
"data": {
"totals": {
"count": 1,
"estimated_value_total": "example"
},
"by_stage": [
{
"stageId": 1,
"stageName": "example",
"count": 1,
"estimated_value_total": "example"
}
],
"by_source": [
{
"source": "example",
"count": 1,
"estimated_value_total": "example"
}
]
},
"meta": {
"request_id": "example",
"pagination": {
"cursor": "example",
"has_more": true,
"count": 1
}
}
}

Scope insufficient

Media type application/problem+json
object
type
required

URL identifying the problem type

string format: uri
title
required

Short human-readable summary

string
status
required

HTTP status code

integer
detail

Human-readable explanation

string
request_id

Server-generated request identifier

string
errors

Validation error array (422 only)

Array<object>
object
field
required

Field path that failed validation

string
code
required

Validation error code

string
message
required

Human-readable validation message

string
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"request_id": "example",
"errors": [
{
"field": "example",
"code": "example",
"message": "example"
}
]
}

Validation failed

Media type application/problem+json
object
type
required

URL identifying the problem type

string format: uri
title
required

Short human-readable summary

string
status
required

HTTP status code

integer
detail

Human-readable explanation

string
request_id

Server-generated request identifier

string
errors

Validation error array (422 only)

Array<object>
object
field
required

Field path that failed validation

string
code
required

Validation error code

string
message
required

Human-readable validation message

string
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"request_id": "example",
"errors": [
{
"field": "example",
"code": "example",
"message": "example"
}
]
}