Analytics API reference
Read overview, audience, campaign, offer, and flow metrics with their exact filters and response contracts.
Analytics endpoints read recorded activity. They do not preview draft performance or publish configuration. Different reports use different units and date boundaries, so their totals are not interchangeable.
Authentication and shared query fields
Paths below follow https://api.rightmessage.com/v1/{teamPid}. All five operations are GET and accept read, write, or *. The shared request conventions cover bearer authentication, headers, project access, and rate limits.
Required query fields start and end must be valid dates. Optional timezone defaults to UTC. Only the campaigns endpoint validates the timezone identifier; the other endpoints accept it as a string.
Use query arrays such as offer_ids[]=ofr_example1 and flow_ids[]=ofn_example1, not comma-separated strings. There is no pagination parameter in this family.
The illustrative examples use fictional WorkForge IDs and counts.
GET /analytics/overview
Returns project-wide answer, enrichment, offer, question, and campaign metrics.
Accepts only the shared query fields, with no interval override. The endpoint reads the whole requested range. Time series use calendar buckets in timezone: day when the range spans 31 days or less, week up to 366 days, and month beyond. Weeks start on Monday, so the first and last buckets can cover only part of a day, week, or month. The returned interval names the bucket size.
Raw analytics events are kept for 365 days. A range that starts more than a year ago counts only the part that's still kept, and the response doesn't flag it.
The ordinary overview queries use inclusive timestamp bounds. A date-only end parses to midnight, not the end of that day. The timezone argument controls time-series buckets; it does not reinterpret an otherwise timezone-less input timestamp. Campaign arm totals separately use local calendar dates, so their boundary semantics differ. Supply explicit timestamp offsets when you need exact bounds.
Returns 200 with the following data fields:
| Field | Shape |
|---|---|
complete | Boolean, always true in a 200 response |
campaignTotals | {status:"ready"}, or {status:"unavailable",reason:string} with maxDays:number when reason is range_too_long |
interval | String: day, week, or month |
exposures, conversions | Arrays of {holdback:boolean,result:number} for personalized and holdback campaign totals |
totalAnswers, totalRespondents, totalNewEnrichedPoints, totalNewEnriches | Numbers |
answersData, respondentsData, oldAnswersData, newEnrichedPointsData, newEnrichesData | Arrays of {x:timestamp,y:number} |
totalVisitorOffersConverted, totalVisitorQuestionsConverted | Numbers |
offersData | Exposure/conversion totals, series, and offer breakdowns below |
questionsData | Exposure/conversion totals, series, and question breakdowns below |
toBeUsedForNewEnrichesData | Object containing syncUpsData below |
Both offersData and questionsData have numeric visitorsExposed, numeric visitorsConverted, and timeSeries entries with x, visitorsExposed, and visitorsConverted. offersData.offerBreakdowns[] adds offerId to that same structure. questionsData.questionBreakdowns[] adds questionId.
syncUpsData contains subscribersEnriched: {value:number}, dataPointsEnriched: {value:number}, and timeSeries[] entries with key, subscribersEnriched, and dataPointsEnriched.
Campaign arm totals sum across campaigns that have testing enabled. They are not globally deduplicated visitor totals. They're read separately and aren't covered by complete; campaignTotals says whether they were read. With status: "ready", empty arm arrays mean no campaign has testing enabled. With status: "unavailable", the arm arrays are empty because the totals are unknown, not zero, while the rest of the overview still covers the whole range. reason says why:
reason | Meaning |
|---|---|
range_too_long | The range covers more than maxDays (90) calendar days in timezone. Request 90 days or less for arm totals. |
invalid_timezone | The analytics search accepted timezone, but campaign reports can't read it. Use an IANA name such as America/New_York. |
capped | The campaign results are too large to compute. Choose fewer days. |
computation_failed | The campaign results couldn't be loaded. Retry after a minute. |
Daily unique values must not be added to reconstruct range-wide unique counts. The retained oldAnswersData field currently repeats the respondent series.
When a search behind the overview errors, times out, loses shards, or can't reach the analytics backend, the endpoint returns 503 with {"error":"Failed to fetch dashboard metrics."} instead of zeros. A 200 response always has complete: true, so its zeros are real counts for the retained data. Retry after a minute, or request a shorter range. An end before the start, or a timezone the analytics search doesn't recognize, also returns this 503, so check them before retrying.
Illustrative response excerpt; the field table defines the complete contract:
GET /analytics/audience
Returns unique-visitor counts for each segment in the requested period.
Accepts the shared query fields. The time range uses inclusive start and exclusive end. Returns 200 with data.segmentCounts, a map from segment ID to unique-visitor count. The string key null represents missing segment membership. The query returns up to 10,000 segment buckets. Counts use cardinality aggregation and can be estimates.
The audience query does not apply the supplied timezone to its timestamp bounds. Use explicit timestamp offsets, or UTC dates with the exclusive end set to the following day. This endpoint does not support a goalId filter.
GET /analytics/campaigns
Returns personalized and holdback performance for published campaigns, plus each campaign's personalization test result. This endpoint has no audience or original page A/B test results; read those on the dashboard's A/B testing page or through the MCP tool get-campaign-performance.
Adds optional string campaign_id. Unknown IDs filter to an empty result rather than producing an item 404. Timezone must be valid. Dates normalize to local calendar dates, both inclusive. End must not precede start, and the inclusive range must not exceed 90 days. Invalid ranges return 422 under errors.end, including invalid_range or range_too_long.
Returns 200 with data keyed by campaign ID. An empty result can serialize as [].
| Campaign field | Meaning |
|---|---|
exposures | Personalized-arm visitors |
pageviews | Personalized-arm engagement pageviews |
conversions | Personalized-arm outcome converters |
conversionRate | Percentage, rounded to one decimal; zero when no visitors |
variants | Array of variant objects below |
aggregateLift | Observed percentage lift rounded to one decimal, or null |
aggregateStatistics | Null or zScore, pValue, integer confidenceLevel, and boolean isSignificant. Legacy holdback range figures only. |
experiment | Null or the campaign's personalization test result: state, label, startedAt, and decidedAt. See the personalization test result. |
A variant object contains nullable variantId, string-array segmentIds, numeric traffic, numeric conversions, and percentage conversionRate rounded to two decimals. The holdback row has null variant ID and an empty segment list. Variant counts can overlap when visitors match multiple variants.
Aggregate statistics require a measurable outcome, enabled testing, visitors in both arms, and holdback converters. pValue and isSignificant describe only the legacy holdback comparison over the requested range. They are not A/B test verdicts, and they never decide experiment. Campaigns come from live configuration. Visitors observed in both arms are excluded from the campaign reporting cohorts.
Unavailable team, combination, or engagement results return 503 with {"error":"Failed to fetch campaign performance."}.
The personalization test result
experiment is the campaign's personalization test: personalized visitors against the held-back visitors over the test's whole run, not the requested dates. It's the result the dashboard's A/B testing page shows for that campaign, and it refreshes every hour. It's null until the campaign has a recorded test run, for example while it holds nobody back.
| Field | Meaning |
|---|---|
state | One of the states below. |
label | The test's status on the A/B testing page, such as Collecting evidence, Winner found, Control wins, Paused (health issue), Paused · publish unconfirmed, or Finished. It's No goal yet when state is not_measurable and the test hasn't ended. |
startedAt | When the current test run started, ISO 8601 in UTC. |
decidedAt | When personalized content most recently reached a 95% chance to beat the held-back visitors, ISO 8601 in UTC. Set only while state is winner; null otherwise. |
state | Meaning |
|---|---|
collecting | Neither side has reached a verdict yet. |
winner | Personalized content has a 95% chance or more to beat the held-back visitors. A test that ended at a Winner keeps this state. |
loser | Personalized content has a 5% chance or less to beat the held-back visitors, so the page as it is converts better. |
inconclusive | The test ended before it reached either verdict. |
halted | Paused because visitors weren't split as planned or saw both versions. The results can't be trusted until the test restarts. |
not_decision_grade | Paused until RightMessage confirms the last publish. Results resume on their own. |
not_measurable | The test run has no goal, so nothing is measured. |
winner and loser are live. While the test runs, either can go back to collecting, and decidedAt changes when a Winner is found again.
Until November 2026, a weekly check filled experiment. The field names and types didn't change, but some meanings did:
winnerandloserused to be final. They're now live.decidedAtused to be the end of the week whose check reached a verdict. It's now the most recent time the result reached a Winner, and null in every other state.inconclusiveused to mean 26 weekly checks passed without a verdict. It now means the test ended without one.not_decision_gradenow means only that a publish is unconfirmed.cannot_decideis no longer returned.- A campaign that has never held anyone back returns
experiment: nullinstead ofnot_measurable. - A campaign rolled out after its test, so nobody is held back now, returns its last run's final state (
winner,loser, orinconclusive) with the labelFinished, instead ofnot_measurable. not_measurablecomes from the test run's own goal, so removing a goal only in your unpublished draft doesn't change it.labelfollows the A/B testing page:WinnerbecameWinner found,LoserbecameControl wins,Not decision-gradebecamePaused · publish unconfirmed, andNot measurablebecameNo goal yet. A test that ended readsFinished, whatever itsstate.
GET /analytics/offers
Returns offer conversion metrics and a comparison with the previous period.
Adds optional offer_ids, an array of strings with no declared item-count limit. A nonempty list enables offer-level splitting. The time range uses inclusive start and exclusive end; the timezone controls histogram buckets, not the raw query bounds.
Supply explicit offer IDs. When the list is omitted or empty, the query does not include normal offer events. The returned overall series is therefore not a reliable all-offer total without explicit IDs.
Returns 200 with a data array. Each item contains:
for, an array identifying the aggregation key, such as["overall"]or an offer key.- Numeric
numerator, unique converters, anddenominator, unique exposed visitors. data, a daily array of{x,numerator,denominator}.- Nullable numeric
change, relative rate change as a fraction, not percentage points. previousPeriodwithnumerator,denominator, and fractionalrate.
The comparison period is the immediately preceding interval of equal duration. With no prior exposure, change is null. If the prior rate is zero and the current rate is positive, change is 1. Current rate is calculated from numerator and denominator; there is no top-level rate field in each item.
Caught batch-query failures can also return a 200 with empty aggregation data rather than an explicit reporting error. Do not interpret an empty offers response as confirmed zero conversions.
GET /analytics/flows
Returns flow executions, node metrics, and the pages where flows appeared.
Adds optional string flow_id and optional flow_ids, an array of at most 25 strings. A nonempty flow_ids array takes precedence over flow_id. Without either filter, the service queries all flows. A date-only end expands through the end of that local day. An explicit timestamp is used as supplied.
Single-flow and unfiltered responses place one metrics object under data. Multi-flow responses use {"data":{"flows":{"FLOW_ID":METRICS}}}. Single-flow and multi-flow results are cached for 300 seconds, with question attribution sensitive to configuration changes. Unfiltered results are not cached this way.
The metrics object contains flowMetrics, nodeMetrics, exposurePages, exposurePagesTotal, and exposurePagesTruncated.
| Nested object | Fields |
|---|---|
flowMetrics | Numeric totalExecutions, completedRuns, unfinishedRuns, uniqueVisitors, identifiedVisitors, and avgDurationMs; completionBreakdown map; byFlow array; byFlowTruncated boolean; nullable funnel and insights objects |
flowMetrics.byFlow[] | flowId, executions, uniqueVisitors, percentage completionRate. At most the 100 flows with the most runs; byFlowTruncated is true when other flows also ran. Flows with no runs aren't listed |
flowMetrics.funnel | views, starts, submissions, percentage completionRate, and avgTimeToCompleteMs, all counted in runs. Present for each requested flow that isn't a system flow; null for unfiltered requests and system flows |
flowMetrics.insights | topDropOffs (up to five {nodeId, nodeType, droppedCount} steps), highestDropOffQuestion, highestAbandonmentOffer, and slowestQuestion. Present for each requested flow; null for unfiltered requests |
nodeMetrics | Map keyed by node ID; each value has nodeId, nodeType, visitorCount, and avgDurationMs |
exposurePages[] | url, pathname, hostname, uniqueVisitors, and executions, for at most the 50 paths with the most runs |
exposurePagesTotal | Approximate number of distinct paths the flows ran on, or null |
exposurePagesTruncated | Boolean; true when runs on other paths were left out of exposurePages |
views is every run, starts counts runs where the visitor answered or skipped a question, converted on an offer or redirect, or reached the end, and submissions counts runs that reached the end. completionRate is submissions divided by views.
Node metrics can add conversionCount, percentage conversionRate, droppedCount, and type-specific count maps splitDistribution, answerDistribution, branchDistribution, offerDistribution, and bucketDistribution. Counts are people. On a question node, visitorCount counts people the question was shown to and conversionCount people who answered it. droppedCount counts people a step was presented to who never got past it on any run in the range.
Question metrics add coverage, with status of available or unavailable, nullable reason, and nullable from timestamp. Coverage is unavailable when the range starts before the project's question display tracking, which began with its first publish after October 8, 2026. Then visitorCount, conversionRate, and droppedCount are null, not zero, and conversionCount still counts.
Question attribution uses the current draft-first configuration, even though the events are recorded traffic. Each question step counts the answers recorded for that step. Answers recorded under the question's own ID count only when exactly one step in the flow asks that question.
A metrics-query failure returns 503 with {"status":"unavailable"}. Flow filters do not check whether the flow exists, so an unknown flow ID does not have the same resource-404 contract as the flows CRUD API.
Common errors and interpretation
Authentication, access, validation, and throttling use the shared error contract. Invalid dates or filter types return 422. A metrics read that can't complete returns 503 on the overview, campaigns, and flows endpoints, with the bodies shown in their sections. Other reporting exceptions can produce 500. Null, empty, unavailable, and zero values have different meanings. No endpoint on this page changes the draft or starts an experiment.