stats
Message counts over up to 13 months
GET/v1/stats
Counts of messages grouped by one dimension. Does not return messages and does not count against the budget. Range: from the first day of the month 12 months ago to today. Default: the last 30 days. A message with several tags or products counts once in each. Order: by=day by date ascending; the others by n descending, then key.
Authentication: CF-Access-Client-Id + CF-Access-Client-Secret. Operation id getStats.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
by required | query | string | Grouping dimension. one of "day", "inst", "tag", "product", "channel"example inst |
from | query | Date | First date, YYYY-MM-DD. Default: today minus 30 days. example 2025-11-01 |
to | query | Date | Last date, YYYY-MM-DD. Default: today. A date after today is treated as today. from after to returns an empty list. example 2026-11-08 |
insts | query | string | Comma-separated institution slugs from /v1/institutions. A message matches if it is from any of them. An unknown slug returns 404. example nubank,itau |
Request example
curl -s https://api.mint.xcorp.cc/v1/stats \
-H "CF-Access-Client-Id: $MINT_ID" \
-H "CF-Access-Client-Secret: $MINT_SECRET"Responses
200Counts.
Headers
x-request-id | string | Request id. Quote it when contacting support. |
Body application/json
Schema: Stats
| Field | Type | Description |
|---|---|---|
by | string | one of "day", "inst", "tag", "product", "channel" |
from | Date | |
to | Date | |
data | array of object | |
data[].key | string | Date (day), institution slug (inst), tag id (tag), product id (product) or channel (channel; empty string = no channel). |
data[].name optional | string | Tag or product name (only for tag and product). |
data[].n | integer | minimum 0 |
as_of | Date |
Example
{
"by": "inst",
"from": "2026-10-09",
"to": "2026-11-08",
"data": [
{
"key": "nubank",
"n": 112
},
{
"key": "itau",
"n": 97
}
],
"as_of": "2026-11-08"
}400Invalid, unknown or repeated parameter (bad_request, with detail = {param, why}), date before the window (window, first accepted date in detail.first_date) or invalid cursor (bad_cursor: tampered, expired, from another credential, other filters or another day; restart without cursor). BadRequest
Body application/json
Schema: Error
| Field | Type | Description |
|---|---|---|
error | string | one of "bad_request", "window", "bad_cursor", "forbidden", "disabled", "access_ended", "not_found", "method_not_allowed", "rate_limited", "internal" |
message | string | What happened and what to do, in English. |
detail optional | any | Extra information: {"param", "why"} for every bad_request, {"first_date"} for window, {"limit"} for rate_limited. |
Example
{
"error": "window",
"message": "Dates before 2026-10-09 are outside the 30-day window. Use since/from on or after that date; for older trends use /v1/stats.",
"detail": {
"first_date": "2026-10-09"
}
}403No valid credential (forbidden), access disabled (disabled) or access period over (access_ended). Do not retry; contact XCORP. Forbidden
Body application/json
Schema: Error
| Field | Type | Description |
|---|---|---|
error | string | one of "bad_request", "window", "bad_cursor", "forbidden", "disabled", "access_ended", "not_found", "method_not_allowed", "rate_limited", "internal" |
message | string | What happened and what to do, in English. |
detail optional | any | Extra information: {"param", "why"} for every bad_request, {"first_date"} for window, {"limit"} for rate_limited. |
Example
{
"error": "access_ended",
"message": "Your access period has ended. Contact XCORP."
}404Message does not exist, is outside the window or is not visible to you; or an unknown institution, tag or product in a filter. All these cases look the same. NotFound
Body application/json
Schema: Error
| Field | Type | Description |
|---|---|---|
error | string | one of "bad_request", "window", "bad_cursor", "forbidden", "disabled", "access_ended", "not_found", "method_not_allowed", "rate_limited", "internal" |
message | string | What happened and what to do, in English. |
detail optional | any | Extra information: {"param", "why"} for every bad_request, {"first_date"} for window, {"limit"} for rate_limited. |
Example
{
"error": "not_found",
"message": "Not found. Messages exist here only for the last 30 days; check ids and slugs against the catalogs."
}405Only GET is allowed (HEAD and OPTIONS too return 405). MethodNotAllowed
Headers
allow | "GET" | Allowed methods: GET. |
Body application/json
Schema: Error
| Field | Type | Description |
|---|---|---|
error | string | one of "bad_request", "window", "bad_cursor", "forbidden", "disabled", "access_ended", "not_found", "method_not_allowed", "rate_limited", "internal" |
message | string | What happened and what to do, in English. |
detail optional | any | Extra information: {"param", "why"} for every bad_request, {"first_date"} for window, {"limit"} for rate_limited. |
Example
{
"error": "method_not_allowed",
"message": "This API is read-only. Use GET."
}429A limit of your access plan was reached. detail.limit is minute (requests per minute), day (requests per day), images (images per day) or budget (distinct messages per month). Wait retry-after seconds. Your limits: /v1/usage. RateLimited
Headers
retry-after | integer | Seconds to wait before retrying. |
x-request-id | string | Request id. Quote it when contacting support. |
Body application/json
Schema: Error
| Field | Type | Description |
|---|---|---|
error | string | one of "bad_request", "window", "bad_cursor", "forbidden", "disabled", "access_ended", "not_found", "method_not_allowed", "rate_limited", "internal" |
message | string | What happened and what to do, in English. |
detail optional | any | Extra information: {"param", "why"} for every bad_request, {"first_date"} for window, {"limit"} for rate_limited. |
Example
{
"error": "rate_limited",
"message": "Too many requests per minute. Wait for retry-after seconds, then continue.",
"detail": {
"limit": "minute"
}
}500Unexpected error (internal). Retry later; quote x-request-id to support. Internal
Headers
x-request-id | string | Request id. Quote it when contacting support. |
Body application/json
Schema: Error
| Field | Type | Description |
|---|---|---|
error | string | one of "bad_request", "window", "bad_cursor", "forbidden", "disabled", "access_ended", "not_found", "method_not_allowed", "rate_limited", "internal" |
message | string | What happened and what to do, in English. |
detail optional | any | Extra information: {"param", "why"} for every bad_request, {"first_date"} for window, {"limit"} for rate_limited. |
Example
{
"error": "internal",
"message": "Unexpected error. Retry later and quote x-request-id if it persists."
}503Service temporarily disabled for all clients (disabled). Retry after retry-after seconds. Disabled
Headers
retry-after | integer | Seconds to wait before retrying. |
x-request-id | string | Request id. Quote it when contacting support. |
Body application/json
Schema: Error
| Field | Type | Description |
|---|---|---|
error | string | one of "bad_request", "window", "bad_cursor", "forbidden", "disabled", "access_ended", "not_found", "method_not_allowed", "rate_limited", "internal" |
message | string | What happened and what to do, in English. |
detail optional | any | Extra information: {"param", "why"} for every bad_request, {"first_date"} for window, {"limit"} for rate_limited. |
Example
{
"error": "disabled",
"message": "The service is temporarily disabled. Try again later."
}