Skip to main content

Analytics

Orbit’s Analytics endpoints expose the same delivery, engagement, and cost datasets that power the dashboard’s Insights page. Use them to embed Orbit metrics in your internal BI tooling, schedule exports to a data warehouse, or programmatically alert on delivery / spend regressions. All analytics endpoints live under /api/v1/analytics, require an API key with the analytics:read scope, and are aggregated against a read replica so heavy reporting queries never contend with the live send path. Each endpoint is rate-limited at 60 requests / minute per tenant. For the model behind the surface — what the aggregates expose, why the read-replica separation holds, how the background roll-up producers pre-aggregate the series, and how the dashboard Insights pages consume the same datasets — see the analytics pipeline concept. Every response uses the standard Orbit envelope: the payload is under data, and meta carries the request_id + timestamp.

Query delivery metrics

Aggregate sent / delivered / failed / read counts with a time-series breakdown. Filter by channel, status, or campaign_id, and bucket the series with group_by (hour, day, week, month — defaults to day).

Response

Query parameters

These filters are shared across the metric and cost endpoints (each endpoint accepts the subset documented below).

Endpoints

Cost analytics

Response

Field reference

These cost fields count billed messages only — sends that actually incurred a charge. Free-tier, promotional, and zero-priced sends carry no charge and are excluded, so the counts here are lower than the send totals from /analytics/messages. Every row is grouped by currency, so a tenant that changed billing currency mid-range gets one row per currency rather than a mixed sum. To reconcile a total against avg_cost_per_message, divide total_spend by total_messages (billed) for the matching currency — not by your overall send count.

Funnel drop-off reasons

Drill into why messages dropped at a funnel step. {step} is one of sent, delivered, read, or queued; the response returns the top carrier rejection codes (default 5, max 20 via limit) enriched with human-readable names and categories from Orbit’s carrier-error dictionary.

Response

Customer journey paths

Reconstruct the ordered touchpoint sequence customers actually walked across channels (chat → voice → email, for example), with per-stage reach and drop-off plus the most-walked full paths. This is the aggregate path view — distinct from the message-delivery funnel above (a single per-message send→deliver funnel) and from the campaign journey builder (the journey a marketer designs).

Query parameters (journey paths)

Response

Customers are matched across channels by their linked contact record (contact id, else phone, else email), so a chat and a later phone call from the same person count as one journey. Only journeys in the requested window are considered.

Common errors

Scheduled exports

For ongoing exports, prefer scheduled reports over polling the metric endpoints. POST /api/v1/analytics/scheduled-reports registers a recurring report that Orbit renders and emails to your configured recipients on a daily / weekly cadence; GET /api/v1/analytics/scheduled-reports lists the active schedules. Creating or editing a schedule requires an owner or admin role because the report payload includes per-tenant PII (top contacts, spend, etc.).