zumpo/docs
Dashboard
Skip to content
ads / API reference
GETgetAdsTimeline

Get daily account metrics

Returns daily aggregate metrics across all ads in a SocialAccount as a single time series -- one row per calendar day in the requested range. Use this for dashboards that draw a daily-spend or daily-conversions chart, instead of calling /v1/ads/tree once per day. accountId is required.

Date range defaults to the last 90 days. Capped at 730 days. Ranges older than the ingested history return a 202 immediately with the covered part and backfillPending: true while the rest is backfilled in the background; repeat the request shortly until it returns 200 with full data.

Authentication

The following security requirement applies to this operation.

  1. bearerhttp

    scheme
    bearer
    bearerFormat
    zumpo-api-key
Read the authentication guide

Parameters

platformqueryoptional

Restrict to one platform. Values this API does not ingest ads for return an empty series rather than an error.

platformstring
enum
[ "facebook", "instagram", "tiktok", "linkedin", "pinterest", "google", "twitter", "openai" ]
Original schema
{
  "type": "string",
  "enum": [
    "facebook",
    "instagram",
    "tiktok",
    "linkedin",
    "pinterest",
    "google",
    "twitter",
    "openai"
  ]
}
toDatequeryoptional

Inclusive end of the metrics range. Defaults to today. Max 730-day range.

toDatestring
pattern
^\d{4}-\d{2}-\d{2}$
Original schema
{
  "type": "string",
  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
}
fromDatequeryoptional

Inclusive start of the metrics range. Defaults to 90 days ago.

fromDatestring
pattern
^\d{4}-\d{2}-\d{2}$
Original schema
{
  "type": "string",
  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
}
adAccountIdqueryoptional

Optional platform ad account id. Use when the connection wraps multiple platform ad accounts and the chart should show one only.

adAccountIdstring
pattern
^act_[1-9]\d{0,19}$
Original schema
{
  "type": "string",
  "pattern": "^act_[1-9]\\d{0,19}$"
}
accountIdqueryrequired

Social account id whose ads are aggregated.

accountIdstringrequired
pattern
^[0-9a-f]{24}$
Original schema
{
  "type": "string",
  "pattern": "^[0-9a-f]{24}$"
}

Responses

Status codes and shapes declared for this operation. Read each description for the meaning of that response.

200Response schema
application/json
Response 200object
#/components/schemas/AdsTimelineResponseDto
required
[ "backfillPending", "rows" ]
backfillPendingbooleanrequired

True when the requested range reaches past the ingested history for the selected ad accounts. The rows below are then the COVERED part only; the response carries HTTP 202 and the remainder is filled in by the background sync. Repeat the request shortly until it returns 200.

rowsarrayrequired

One row per calendar day in the range that has ad activity, oldest first. Days with no activity are OMITTED rather than emitted as zero rows -- an empty array is the documented signal for "no ad activity in the range", and dense zero-filling would make that signal unreachable for every account that ever ran an ad. A gap in the series therefore means "no delivery that day"; a range that was never ingested is reported by backfillPending, not by missing rows.

Array itemobject
#/components/schemas/AdsTimelineRowDto
required
[ "date", "spend", "impressions", "reach", "clicks", "engagement", "ctr", "cpc", "cpm", "conversions", "costPerConversion", "actions", "actionValues", "purchaseValue", "roas" ]
datestringrequired

The calendar day (YYYY-MM-DD) these totals belong to.

format
date
spendnumberrequired

Native currency units, matching the /v1/ads/tree convention. Never normalised to USD.

impressionsnumberrequired
reachnumberrequired

Reach summed across the account's ads for this single day. A person seen by two ads the same day counts twice, and reach is de-duplicated per day only: do NOT sum it across days (people reached on multiple days would be double-counted).

clicksnumberrequired
engagementnumberrequired
ctrnumberrequired

Click-through rate as a percentage (0-100).

cpcnumberrequired

Cost per click in native currency.

cpmnumberrequired

Cost per 1000 impressions in native currency.

conversionsnumberrequired

Conversion events on this day. FRACTIONAL: attribution splits one conversion across touchpoints, so values like 0.347 are normal.

costPerConversionnumberrequired

Derived spend / conversions. 0 when conversions is 0.

actionsobjectrequired

Per-action-type counts merged across all ads on this day. Keys are platform-native action types, so branch on the ad platform.

Additional propertynumber
actionValuesobjectrequired

Monetary mirror of actions in native currency. Meta only; other platforms report an empty object.

Additional propertynumber
purchaseValuenumberrequired

Purchase-type action value on this day, in the ad account's native currency. Read from the FIRST purchase action type present in actionValues, not the sum of all of them: the platform reports one sale under several action types at once, so summing would multiply the same revenue. 0 when the account reports no purchase value.

roasnumberrequired

Derived purchaseValue / spend. 0 when spend is 0, never null or NaN.

Original schema
{
  "$ref": "#/components/schemas/AdsTimelineResponseDto"
}
202Historical data is incomplete and backfill remains pending.

Historical data is incomplete and backfill remains pending. The body is the same shape as 200 with backfillPending: true, and rows covers only the ingested part of the range. A Retry-After header carries the suggested wait when this account has a scheduled ad sync.

application/json
Response 202object
#/components/schemas/AdsTimelineResponseDto
required
[ "backfillPending", "rows" ]
backfillPendingbooleanrequired

True when the requested range reaches past the ingested history for the selected ad accounts. The rows below are then the COVERED part only; the response carries HTTP 202 and the remainder is filled in by the background sync. Repeat the request shortly until it returns 200.

rowsarrayrequired

One row per calendar day in the range that has ad activity, oldest first. Days with no activity are OMITTED rather than emitted as zero rows -- an empty array is the documented signal for "no ad activity in the range", and dense zero-filling would make that signal unreachable for every account that ever ran an ad. A gap in the series therefore means "no delivery that day"; a range that was never ingested is reported by backfillPending, not by missing rows.

Array itemobject
#/components/schemas/AdsTimelineRowDto
required
[ "date", "spend", "impressions", "reach", "clicks", "engagement", "ctr", "cpc", "cpm", "conversions", "costPerConversion", "actions", "actionValues", "purchaseValue", "roas" ]
datestringrequired

The calendar day (YYYY-MM-DD) these totals belong to.

format
date
spendnumberrequired

Native currency units, matching the /v1/ads/tree convention. Never normalised to USD.

impressionsnumberrequired
reachnumberrequired

Reach summed across the account's ads for this single day. A person seen by two ads the same day counts twice, and reach is de-duplicated per day only: do NOT sum it across days (people reached on multiple days would be double-counted).

clicksnumberrequired
engagementnumberrequired
ctrnumberrequired

Click-through rate as a percentage (0-100).

cpcnumberrequired

Cost per click in native currency.

cpmnumberrequired

Cost per 1000 impressions in native currency.

conversionsnumberrequired

Conversion events on this day. FRACTIONAL: attribution splits one conversion across touchpoints, so values like 0.347 are normal.

costPerConversionnumberrequired

Derived spend / conversions. 0 when conversions is 0.

actionsobjectrequired

Per-action-type counts merged across all ads on this day. Keys are platform-native action types, so branch on the ad platform.

Additional propertynumber
actionValuesobjectrequired

Monetary mirror of actions in native currency. Meta only; other platforms report an empty object.

Additional propertynumber
purchaseValuenumberrequired

Purchase-type action value on this day, in the ad account's native currency. Read from the FIRST purchase action type present in actionValues, not the sum of all of them: the platform reports one sale under several action types at once, so summing would multiply the same revenue. 0 when the account reports no purchase value.

roasnumberrequired

Derived purchaseValue / spend. 0 when spend is 0, never null or NaN.

Original schema
{
  "$ref": "#/components/schemas/AdsTimelineResponseDto"
}

Response headers

Retry-After

Suggested delay before repeating this request, in seconds. It is the wait until the next scheduled ad sync for accountId, which is the earliest moment the coverage -- and therefore this answer -- can change. It is a LOWER BOUND, not an estimate of when the backfill completes: the run itself takes additional time, and a long backfill spans several runs. Omitted when the account has no scheduled ad sync yet.

Retry-Afterinteger
minimum
60
maximum
86400
Original schema
{
  "type": "integer",
  "minimum": 60,
  "maximum": 86400
}
400Response schema
application/json
Response 400object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
401Response schema
application/json
Response 401object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
403Response schema
application/json
Response 403object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
404Resource not found

Resource not found

application/json
Response 404object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
409Conflict

Conflict

application/json
Response 409object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
429Rate limit exceeded

Rate limit exceeded

application/json
Response 429object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}

Response headers

X-RateLimit-Limit

Request ceiling that applied to this request. Authenticated requests use the team tier ceiling; unauthenticated identity endpoints use a per-IP ceiling. Usage is measured continuously against a trailing period rather than tallied and cleared at a boundary, so the full ceiling never becomes available again in one step.

X-RateLimit-Limitinteger
minimum
1
Original schema
{
  "type": "integer",
  "minimum": 1
}

X-RateLimit-Remaining

Requests still allowed against that ceiling; never negative. On a 429 produced by the request throttler this is 0. Such a refused request is not counted, so retrying too early costs you no capacity and does not push your recovery further away.

X-RateLimit-Remaininginteger
minimum
0
Original schema
{
  "type": "integer",
  "minimum": 0
}

X-RateLimit-Reset

Absolute Unix epoch time, in SECONDS, at which the current counting period turns over. This is NOT the number of seconds left: subtract the current time to obtain that. It is also NOT the moment your capacity returns: earlier usage keeps weighing on the ceiling across the turnover, so after a 429 wait for Retry-After instead, which is usually later than this value.

X-RateLimit-Resetinteger
format
int64
minimum
0
Original schema
{
  "type": "integer",
  "format": "int64",
  "minimum": 0
}

Retry-After

Seconds to wait before retrying. Always a positive integer delta (never an HTTP-date), at least 1. On a 429 from the request throttler it is the wait until your usage actually drops back under the ceiling; prefer it over any delay you compute from X-RateLimit-Reset.

Retry-Afterinteger
minimum
1
maximum
86400
Original schema
{
  "type": "integer",
  "minimum": 1,
  "maximum": 86400
}
500Server error

Server error

application/json
Response 500object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
502Platform error

Platform error

application/json
Response 502object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
503Service unavailable

Service unavailable

application/json
Response 503object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}

Referenced schemas

Original local definitions used by this operation. Recursive and deeply nested references can be inspected here without expanding them repeatedly.

AdsTimelineResponseDto

#/components/schemas/AdsTimelineResponseDto

{
  "type": "object",
  "properties": {
    "backfillPending": {
      "type": "boolean",
      "description": "True when the requested range reaches past the ingested history for the selected ad accounts. The rows below are then the COVERED part only; the response carries HTTP 202 and the remainder is filled in by the background sync. Repeat the request shortly until it returns 200."
    },
    "rows": {
      "description": "One row per calendar day in the range that has ad activity, oldest first. Days with no activity are OMITTED rather than emitted as zero rows -- an empty array is the documented signal for \"no ad activity in the range\", and dense zero-filling would make that signal unreachable for every account that ever ran an ad. A gap in the series therefore means \"no delivery that day\"; a range that was never ingested is reported by `backfillPending`, not by missing rows.",
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/AdsTimelineRowDto"
      }
    }
  },
  "required": [
    "backfillPending",
    "rows"
  ]
}
AdsTimelineRowDto

#/components/schemas/AdsTimelineRowDto

{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "The calendar day (YYYY-MM-DD) these totals belong to."
    },
    "spend": {
      "type": "number",
      "description": "Native currency units, matching the /v1/ads/tree convention. Never normalised to USD."
    },
    "impressions": {
      "type": "number"
    },
    "reach": {
      "type": "number",
      "description": "Reach summed across the account's ads for this single day. A person seen by two ads the same day counts twice, and reach is de-duplicated per day only: do NOT sum it across days (people reached on multiple days would be double-counted)."
    },
    "clicks": {
      "type": "number"
    },
    "engagement": {
      "type": "number"
    },
    "ctr": {
      "type": "number",
      "description": "Click-through rate as a percentage (0-100)."
    },
    "cpc": {
      "type": "number",
      "description": "Cost per click in native currency."
    },
    "cpm": {
      "type": "number",
      "description": "Cost per 1000 impressions in native currency."
    },
    "conversions": {
      "type": "number",
      "description": "Conversion events on this day. FRACTIONAL: attribution splits one conversion across touchpoints, so values like 0.347 are normal."
    },
    "costPerConversion": {
      "type": "number",
      "description": "Derived spend / conversions. 0 when conversions is 0."
    },
    "actions": {
      "type": "object",
      "additionalProperties": {
        "type": "number"
      },
      "description": "Per-action-type counts merged across all ads on this day. Keys are platform-native action types, so branch on the ad platform."
    },
    "actionValues": {
      "type": "object",
      "additionalProperties": {
        "type": "number"
      },
      "description": "Monetary mirror of `actions` in native currency. Meta only; other platforms report an empty object."
    },
    "purchaseValue": {
      "type": "number",
      "description": "Purchase-type action value on this day, in the ad account's native currency. Read from the FIRST purchase action type present in `actionValues`, not the sum of all of them: the platform reports one sale under several action types at once, so summing would multiply the same revenue. 0 when the account reports no purchase value."
    },
    "roas": {
      "type": "number",
      "description": "Derived purchaseValue / spend. 0 when spend is 0, never null or NaN."
    }
  },
  "required": [
    "date",
    "spend",
    "impressions",
    "reach",
    "clicks",
    "engagement",
    "ctr",
    "cpc",
    "cpm",
    "conversions",
    "costPerConversion",
    "actions",
    "actionValues",
    "purchaseValue",
    "roas"
  ]
}
ZumpoErrorDto

#/components/schemas/ZumpoErrorDto

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable message. UNSTABLE — do not branch on it.",
      "example": "WhatsApp session window expired; use a template message."
    },
    "type": {
      "type": "string",
      "description": "Stable error category (does not change across versions).",
      "enum": [
        "invalid_request_error",
        "authentication_error",
        "permission_error",
        "not_found",
        "conflict",
        "rate_limit_error",
        "platform_error",
        "platform_rejected",
        "account_disconnected",
        "media_error",
        "api_error"
      ],
      "example": "invalid_request_error"
    },
    "code": {
      "type": "string",
      "description": "Stable machine-readable code.",
      "example": "whatsapp_window_expired"
    },
    "param": {
      "type": "string",
      "description": "Offending parameter, present only when relevant.",
      "example": "body"
    },
    "docUrl": {
      "type": "string",
      "description": "https://docs.zumpo.io/errors/{code}",
      "example": "https://docs.zumpo.io/errors/whatsapp_window_expired"
    },
    "requestId": {
      "type": "string",
      "description": "Support correlation id: req_ + 16 hex.",
      "example": "req_7f3a9c2e1b8d4056"
    },
    "details": {
      "type": "object",
      "additionalProperties": true,
      "description": "Additional structured context, present only when an error has more to say than a single `param` can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.",
      "example": {
        "created": [
          {
            "kind": "campaign",
            "platformId": "120210000000000001"
          },
          {
            "kind": "adSet",
            "platformId": "120210000000000002"
          }
        ]
      }
    }
  },
  "required": [
    "error",
    "type",
    "code",
    "docUrl",
    "requestId"
  ]
}