> For the complete documentation index, see [llms.txt](https://help.recart.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.recart.com/developers/public-api/flow/statistics-view-of-a-campaign.md).

# Statistics view of a campaign

One statistics view of a campaign, addressed by campaign id — the same two views as `/automated-flows/{id}/views/{name}`. When the date range is omitted it covers the campaign's lifetime — a campaign's revenue keeps arriving for days after the send. The id of an automated flow returns 404 — use `/automated-flows/{id}/views/{name}` instead.

`flow-summary` returns the campaign's totals for the range. `flow-items-summary` returns an object keyed by `flowItemId` — the same id as `items[]` on `/campaign-flows/{id}` — with one key per message item that recorded activity in the range; adaptive-test variants are message items, so each variant gets its own key.

`adaptive-flow-summary` is for adaptive campaigns only (404 for a standard one): the campaign's id and name, its adaptive test state and result, and one entry per variant with the `evaluationStats` the winner was picked on next to the variant's lifetime totals. It ignores `dateFrom` and `dateTo`.

```json
{"openapi":"3.1.0","info":{"title":"Recart API","version":"2023-12"},"tags":[{"name":"Flow","description":"Flows"}],"servers":[{"url":"https://api.recart.com/app-integrations/2023-12","description":"Production"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Recart-API-Key","description":"It can be obtained in Recart account after contacting Support"}},"schemas":{"CampaignFlowViews":{"type":["object"],"required":["type","attributes"],"properties":{"type":{"type":"string","enum":["campaign-flow-views"]},"attributes":{"type":"object","description":"The requested view's data under its name — exactly one key per\nrequest.\n","minProperties":1,"properties":{"flow-summary":{"description":"The campaign's totals for the range","$ref":"#/components/schemas/FlowStatistics"},"flow-items-summary":{"type":"object","description":"Totals per message item, keyed by flowItemId — the same id as\nitems[] on the campaign detail; adaptive-test variants are\nmessage items, so each variant is its own key. Only items\nthat recorded activity in the range appear. Per item,\nrecipients equals sent, so revenuePerRecipient equals\nrevenuePerMessage.\n","additionalProperties":{"$ref":"#/components/schemas/FlowStatistics"}},"adaptive-flow-summary":{"description":"The campaign's adaptive test with per-variant evaluation and lifetime statistics (adaptive campaigns only)","$ref":"#/components/schemas/AdaptiveFlowSummary"}}}}},"FlowStatistics":{"type":"object","description":"Range totals of one flow, campaign, group or message — the same\nnumbers as the dashboard. Rates with a zero denominator are 0.\nAmounts are keyed by ISO 4217 code: USD always, the store currency\nadditionally when it is not USD.\n\nrecipients and revenuePerRecipient are present on every view except\nsms-summary: the SMS channel total is aggregated without the\nfirst-message cohort that defines recipients, and its sent counts\nevery message of every flow, so the number cannot be derived from\nit. The dashboard's Automated Flows header, built on the same data,\nshows RPM and no recipients for the same reason. Where the\ndashboard shows Recipients and RPR — the Campaigns header — read\nthe blast entry of flow-groups-summary.\n","required":["sent","clicked","clickRate","converted","sales","spent","roi","optOutRate","spamRate","revenuePerMessage"],"properties":{"sent":{"type":"integer","description":"SMS and MMS messages sent"},"recipients":{"type":"integer","description":"Subscribers who received the flow's first message. Present on\nflow-groups-summary, automated-flows-summary,\ncampaign-flows-summary, flow-summary and flow-items-summary\n(where it equals the item's sent — a message reaches a subscriber\nat most once); absent on sms-summary.\n"},"clicked":{"type":"integer","description":"Clicks on a link in one of the flow's messages"},"clickRate":{"type":"number","description":"Clicks / sent"},"converted":{"type":"integer","description":"Attributed orders"},"sales":{"type":"object","additionalProperties":{"type":"number"},"description":"Attributed order value per currency (ISO 4217 code)"},"spent":{"type":"object","additionalProperties":{"type":"number"},"description":"SMS and MMS cost per currency (ISO 4217 code)"},"roi":{"type":"number","description":"sales.USD / spent.USD"},"optOutRate":{"type":"number","description":"Opt-outs attributed to the flow / recipients"},"spamRate":{"type":"number","description":"Carrier spam rejections / sent"},"revenuePerRecipient":{"type":"number","description":"sales.USD / recipients — the dashboard's RPR. Present wherever\nrecipients is; absent on sms-summary. Equals revenuePerMessage\non flow-items-summary.\n"},"revenuePerMessage":{"type":"number","description":"sales.USD / sent — the dashboard's RPM"}}},"AdaptiveFlowSummary":{"type":"object","description":"One adaptive campaign's test, as evaluated and as it stands now.\nEach variant carries evaluationStats — the snapshot the winner was\npicked on, present once the test has completed — next to\nallTimeStats, the variant's lifetime totals computed at request\ntime, which keep growing with late activity and, for the winner,\ninclude the rollout to the rest of the audience.\n","required":["id","name","adaptiveTest","variants"],"properties":{"id":{"type":"string","description":"ID of the campaign"},"name":{"type":"string","description":"Name of the campaign"},"adaptiveTest":{"$ref":"#/components/schemas/CampaignAdaptiveTest"},"variants":{"type":"array","description":"The variants under test, in the order of the adaptive-test item","items":{"type":"object","required":["flowItemId","allTimeStats"],"properties":{"flowItemId":{"type":"string","description":"ID of the variant's flow item — the same id as items[] on the campaign detail and the keys of flow-items-summary"},"evaluationStats":{"$ref":"#/components/schemas/AdaptiveTestVariantEvaluationStats"},"allTimeStats":{"description":"The variant's lifetime totals at request time; recipients equals sent","$ref":"#/components/schemas/FlowStatistics"}}}}}},"CampaignAdaptiveTest":{"type":"object","description":"Adaptive test state of a campaign","properties":{"adaptiveTestStatus":{"type":"string","description":"running while the test variants are being evaluated;\ncomplete_with_winner when a variant won and was rolled out;\ncomplete_no_winner when no variant stood out; complete_control_kept\nwhen the control message beat every variant and was kept.\n","enum":["running","complete_with_winner","complete_no_winner","complete_control_kept"]},"adaptiveTestResult":{"type":"object","description":"Outcome of the test, present once evaluated","properties":{"winnerFlowItemId":{"type":"string","description":"ID of the winning variant's flow item"},"wasTiebroken":{"type":"boolean"},"completedAt":{"type":"string","format":"date-time"}}},"testVariantsDispatchedAt":{"type":"string","format":"date-time","description":"When the test variants were sent to the sample audience"}}},"AdaptiveTestVariantEvaluationStats":{"type":"object","description":"The variant's totals frozen at the moment its adaptive test was\nevaluated — the numbers the winner was picked on. The evaluation\nruns once, when the evaluation window closes\n(testVariantsDispatchedAt plus the window), and takes each\nvariant's lifetime totals as they stood then. It is a snapshot,\nnot a range query: clicks, orders and opt-outs that arrive later\nare not added, and the winner's rollout to the rest of the\naudience is not included. Amounts are keyed by ISO 4217 code: USD\nalways, the store currency additionally when it is not USD. Rates\nwith a zero denominator are 0.\n","required":["sent","clickRate","sales","spent","roi","optOutRate"],"properties":{"sent":{"type":"integer","description":"SMS and MMS messages sent to the test audience by this variant"},"clickRate":{"type":"number","description":"Clicks / sent"},"sales":{"type":"object","additionalProperties":{"type":"number"},"description":"Attributed order value per currency (ISO 4217 code)"},"spent":{"type":"object","additionalProperties":{"type":"number"},"description":"SMS and MMS cost per currency (ISO 4217 code)"},"roi":{"type":"number","description":"sales.USD / spent.USD"},"optOutRate":{"type":"number","description":"Opt-outs attributed to the variant / sent"}}},"HttpErrorBody":{"type":"object","required":["errors"],"properties":{"errors":{"type":"array","items":{"type":"object","required":["id","code","title","detail"],"properties":{"id":{"type":"string"},"code":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"}}}}}}},"responses":{"HttpError":{"description":"HTTP Error response","content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/HttpErrorBody"}}}}}},"paths":{"/campaign-flows/{id}/views/{name}":{"get":{"summary":"Statistics view of a campaign","tags":["Flow"],"operationId":"getCampaignFlowView","description":"One statistics view of a campaign, addressed by campaign id — the\nsame two views as `/automated-flows/{id}/views/{name}`. When the\ndate range is omitted it covers the campaign's lifetime — a\ncampaign's revenue keeps arriving for days after the send. The id\nof an automated flow returns 404 — use\n`/automated-flows/{id}/views/{name}` instead.\n\n`flow-summary` returns the campaign's totals for the range.\n`flow-items-summary` returns an object keyed by `flowItemId` — the\nsame id as `items[]` on `/campaign-flows/{id}` — with one key per\nmessage item that recorded activity in the range; adaptive-test\nvariants are message items, so each variant gets its own key.\n\n`adaptive-flow-summary` is for adaptive campaigns only (404 for a\nstandard one): the campaign's id and name, its adaptive test state\nand result, and one entry per variant with the `evaluationStats`\nthe winner was picked on next to the variant's lifetime totals. It\nignores `dateFrom` and `dateTo`.\n","parameters":[{"name":"id","in":"path","required":true,"description":"ID of the campaign","schema":{"type":"string"}},{"name":"name","in":"path","required":true,"description":"The view to return","schema":{"type":"string","enum":["flow-summary","flow-items-summary","adaptive-flow-summary"]}},{"name":"dateFrom","in":"query","description":"First day of the range, inclusive (YYYY-MM-DD, UTC). Defaults\nto the campaign's send day (`sentAt`, or `scheduledFor` /\n`createdAt` while it has not been sent), clamped to 18 months\nago. A caller-supplied `dateFrom` must not be older than 18\nmonths — the API does not serve older data, and an older\n`dateFrom` returns 400.\n","schema":{"type":"string","format":"date"}},{"name":"dateTo","in":"query","description":"Last day of the range, inclusive — `dateTo=2026-08-31` includes\nthe whole of 2026-08-31 (UTC). Defaults to today.\n","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Ok","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"data":{"description":"Always one resource of type campaign-flow-views;\nattributes holds the requested view under its name.\n","$ref":"#/components/schemas/CampaignFlowViews"}}}}}},"4XX":{"$ref":"#/components/responses/HttpError"},"5XX":{"$ref":"#/components/responses/HttpError"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.recart.com/developers/public-api/flow/statistics-view-of-a-campaign.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
