Aller au contenu

GET /v1/contacts/stats

GET
/v1/contacts/stats
curl --request GET \
--url 'https://api.asap.cool/v1/contacts/stats?from=example&to=example' \
--header 'Authorization: Bearer <token>'
from
required
string

Inclusive lower bound (YYYY-MM-DD).

to
required
string

Inclusive upper bound (YYYY-MM-DD).

Address-book growth over the window.

Media typeapplication/json

Response of GET /v1/contacts/stats.

object
by_lead_status
required

Lead-status mix of the active book (window-invariant), largest first.

Array<object>

Active contacts in one lead status.

object
count
required

How many.

integer format: int64
lead_status
required

new, qualified, contacted, won or lost.

string
series
required

Month series over the window, gap-filled, oldest first.

Array<object>

One month of address-book growth.

object
created_count
required

Active contacts created that month.

integer format: int64
period
required

Month, YYYY-MM.

string
total
required

Active contacts now (window-invariant).

integer format: int64

Example generated

{
"by_lead_status": [
{
"count": 1,
"lead_status": "example"
}
],
"series": [
{
"created_count": 1,
"period": "example"
}
],
"total": 1
}

No active org.

Media typeapplication/json

Generic error body returned by API handlers when they fail. code is a stable machine-readable token; message is human-friendly and meant for surfacing to end users.

object
code
required

Stable machine token (e.g. invalid_credentials).

string
field

Offending request field for validation errors, when known.

string | null
message
required

Human-readable message.

string

Example generated

{
"code": "example",
"field": "example",
"message": "example"
}

Missing contacts:read scope.

Media typeapplication/json

Generic error body returned by API handlers when they fail. code is a stable machine-readable token; message is human-friendly and meant for surfacing to end users.

object
code
required

Stable machine token (e.g. invalid_credentials).

string
field

Offending request field for validation errors, when known.

string | null
message
required

Human-readable message.

string

Example generated

{
"code": "example",
"field": "example",
"message": "example"
}

Invalid window (bad date, from > to, span > 366d).

Media typeapplication/json

Generic error body returned by API handlers when they fail. code is a stable machine-readable token; message is human-friendly and meant for surfacing to end users.

object
code
required

Stable machine token (e.g. invalid_credentials).

string
field

Offending request field for validation errors, when known.

string | null
message
required

Human-readable message.

string

Example generated

{
"code": "example",
"field": "example",
"message": "example"
}