Skip to help content
RightMessage

Analytics API reference

Read overview, audience, campaign, offer, and flow metrics with their exact filters and response contracts.

Available on the Scale and Pro plans.

Updated

View as Markdown

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:

FieldShape
completeBoolean, always true in a 200 response
campaignTotals{status:"ready"}, or {status:"unavailable",reason:string} with maxDays:number when reason is range_too_long
intervalString: day, week, or month
exposures, conversionsArrays of {holdback:boolean,result:number} for personalized and holdback campaign totals
totalAnswers, totalRespondents, totalNewEnrichedPoints, totalNewEnrichesNumbers
answersData, respondentsData, oldAnswersData, newEnrichedPointsData, newEnrichesDataArrays of {x:timestamp,y:number}
totalVisitorOffersConverted, totalVisitorQuestionsConvertedNumbers
offersDataExposure/conversion totals, series, and offer breakdowns below
questionsDataExposure/conversion totals, series, and question breakdowns below
toBeUsedForNewEnrichesDataObject 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:

reasonMeaning
range_too_longThe range covers more than maxDays (90) calendar days in timezone. Request 90 days or less for arm totals.
invalid_timezoneThe analytics search accepted timezone, but campaign reports can't read it. Use an IANA name such as America/New_York.
cappedThe campaign results are too large to compute. Choose fewer days.
computation_failedThe 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.

HTTP
GET /v1/123456/analytics/overview?start=2026-10-01&end=2026-10-13&timezone=UTC HTTP/1.1
Host: api.rightmessage.com
Authorization: Bearer YOUR_API_TOKEN
Accept: application/json

Illustrative response excerpt; the field table defines the complete contract:

JSON
{"data":{"complete":true,"campaignTotals":{"status":"ready"},"interval":"day","totalAnswers":40,"totalRespondents":25,"answersData":[{"x":"2026-10-01T00:00:00.000Z","y":4}],"exposures":[{"holdback":false,"result":200},{"holdback":true,"result":20}],"conversions":[{"holdback":false,"result":10},{"holdback":true,"result":1}]}}

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.

HTTP
GET /v1/123456/analytics/audience?start=2026-10-01&end=2026-10-14 HTTP/1.1
Host: api.rightmessage.com
Authorization: Bearer YOUR_API_TOKEN
Accept: application/json
JSON
{"data":{"segmentCounts":{"seg_example1":25,"null":10}}}

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 fieldMeaning
exposuresPersonalized-arm visitors
pageviewsPersonalized-arm engagement pageviews
conversionsPersonalized-arm outcome converters
conversionRatePercentage, rounded to one decimal; zero when no visitors
variantsArray of variant objects below
aggregateLiftObserved percentage lift rounded to one decimal, or null
aggregateStatisticsNull or zScore, pValue, integer confidenceLevel, and boolean isSignificant. Legacy holdback range figures only.
experimentNull 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.

HTTP
GET /v1/123456/analytics/campaigns?start=2026-10-01&end=2026-10-13&campaign_id=cpn_example1 HTTP/1.1
Host: api.rightmessage.com
Authorization: Bearer YOUR_API_TOKEN
Accept: application/json
JSON
{"data":{"cpn_example1":{"exposures":200,"pageviews":260,"conversions":10,"conversionRate":5,"variants":[],"aggregateLift":null,"aggregateStatistics":null,"experiment":null}}}

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.

FieldMeaning
stateOne of the states below.
labelThe 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.
startedAtWhen the current test run started, ISO 8601 in UTC.
decidedAtWhen 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.
stateMeaning
collectingNeither side has reached a verdict yet.
winnerPersonalized content has a 95% chance or more to beat the held-back visitors. A test that ended at a Winner keeps this state.
loserPersonalized content has a 5% chance or less to beat the held-back visitors, so the page as it is converts better.
inconclusiveThe test ended before it reached either verdict.
haltedPaused because visitors weren't split as planned or saw both versions. The results can't be trusted until the test restarts.
not_decision_gradePaused until RightMessage confirms the last publish. Results resume on their own.
not_measurableThe 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:

  • winner and loser used to be final. They're now live.
  • decidedAt used 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.
  • inconclusive used to mean 26 weekly checks passed without a verdict. It now means the test ended without one.
  • not_decision_grade now means only that a publish is unconfirmed.
  • cannot_decide is no longer returned.
  • A campaign that has never held anyone back returns experiment: null instead of not_measurable.
  • A campaign rolled out after its test, so nobody is held back now, returns its last run's final state (winner, loser, or inconclusive) with the label Finished, instead of not_measurable.
  • not_measurable comes from the test run's own goal, so removing a goal only in your unpublished draft doesn't change it.
  • label follows the A/B testing page: Winner became Winner found, Loser became Control wins, Not decision-grade became Paused · publish unconfirmed, and Not measurable became No goal yet. A test that ended reads Finished, whatever its state.

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, and denominator, unique exposed visitors.
  • data, a daily array of {x,numerator,denominator}.
  • Nullable numeric change, relative rate change as a fraction, not percentage points.
  • previousPeriod with numerator, denominator, and fractional rate.

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.

HTTP
GET /v1/123456/analytics/offers?start=2026-10-01&end=2026-10-14&offer_ids[]=ofr_example1 HTTP/1.1
Host: api.rightmessage.com
Authorization: Bearer YOUR_API_TOKEN
Accept: application/json
JSON
{"data":[{"for":["ofr_example1"],"numerator":10,"denominator":200,"data":[],"change":null,"previousPeriod":{"numerator":0,"denominator":0,"rate":0}}]}

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 objectFields
flowMetricsNumeric 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.funnelviews, 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.insightstopDropOffs (up to five {nodeId, nodeType, droppedCount} steps), highestDropOffQuestion, highestAbandonmentOffer, and slowestQuestion. Present for each requested flow; null for unfiltered requests
nodeMetricsMap 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
exposurePagesTotalApproximate number of distinct paths the flows ran on, or null
exposurePagesTruncatedBoolean; 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.

HTTP
GET /v1/123456/analytics/flows?start=2026-10-01&end=2026-10-13&flow_id=ofn_example1 HTTP/1.1
Host: api.rightmessage.com
Authorization: Bearer YOUR_API_TOKEN
Accept: application/json
JSON
{"data":{"flowMetrics":{"totalExecutions":20,"completedRuns":12,"unfinishedRuns":8,"uniqueVisitors":18,"identifiedVisitors":5,"avgDurationMs":12000,"completionBreakdown":{"completed":12},"byFlow":[{"flowId":"ofn_example1","executions":20,"uniqueVisitors":18,"completionRate":60}],"byFlowTruncated":false,"funnel":{"views":20,"starts":15,"submissions":12,"completionRate":60,"avgTimeToCompleteMs":14000},"insights":{"topDropOffs":[],"highestDropOffQuestion":null,"highestAbandonmentOffer":null,"slowestQuestion":null}},"nodeMetrics":{},"exposurePages":[{"url":"https://example.com/","pathname":"/","hostname":"example.com","uniqueVisitors":18,"executions":20}],"exposurePagesTotal":1,"exposurePagesTruncated":false}}

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.

Still need a hand?

Tell us what you’re trying to do and where you’re getting stuck.

support@rightmessage.com