Migrate from legacy
The legacy /v1/metrics/* surface is frozen. It stays online for backwards compatibility, but no new features are added there — everything forward ships under /v1/partner/*.
This page maps the legacy calls that partners actually use today to their Partner API equivalents. If you're relying on a legacy call that isn't listed, email support@mobilytics.com — we'll add the mapping and, if the underlying data isn't yet exposed on the Partner API, prioritise surfacing it.
Philosophy changes
- Resource-oriented URLs. Legacy keys every metrics route off
/metrics/assets/{id}; the Partner API models assets as a first-class collection and nests impression metrics under them (/v1/partner/assets/{id}/impressions/...). - Company scope on the key. Legacy relied on per-user
accessible_byfiltering; Partner API keys carry company scope so every response is pre-filtered server-side. You never pass a vendor or company ID. - Error envelope. Legacy returns
{ "code": "...", "error": "..." }. Partner API returns{ "error": { "code", "message", "details" } }— see Errors. Codes are also stricter and stable. - snake_case response fields. Partner API keeps
snake_caseend-to-end; the legacy surface mixes conventions. - Explicit grains. Legacy's
/per-minuteendpoint is replaced by/timeseries?grain=…, which also unlocksquarter_hour,week,month, andquartergrains for the first time./dailyand/hourlyremain as fixed-grain conveniences.
Endpoint map
| Legacy | Partner API | Notes |
|---|---|---|
GET /v1/metrics/assets | GET /v1/partner/assets | Legacy returns bare id lists (or reseller-specific rows for LG); Partner API always returns the paginated { data, pagination } envelope with full asset detail. |
GET /v1/metrics/assets/legacy-ids | Translation helper only. Returns { "<legacy_int_id>": "<x2_cuid>" } for assets you've previously addressed by integer ID. Cache the map and call Partner API by cuid. | Stays on the legacy /v1/metrics/* surface because it's a one-shot migration aid, not a long-term Partner API. Backed by your existing legacy key with partner:metrics:legacy:read. |
GET /v1/metrics/assets/{id}?start=&end= | GET /v1/partner/assets/{id}/impressions/summary?from_date=&to_date= and/or GET /v1/partner/assets/{id}/impressions/daily?from_date=&to_date= | Query params renamed start/end → from_date/to_date (ISO YYYY-MM-DD). Pick summary for totals/averages, daily for per-day rows. Both dates are inclusive. |
GET /v1/metrics/assets/{id}/per-minute?date= | GET /v1/partner/assets/{id}/impressions/timeseries?from_date=&to_date=&grain=minute | Set from_date = to_date = date for a single day. grain=minute is currently restricted to Mobilytics-vendor sensors (BlueZoo's finest grain is quarter_hour). Cap minute-grain ranges at a few days — bucket counts grow at 1,440/day per asset. |
Response-shape deltas at a glance
- Legacy wraps data under
{ analytics, asset_name, center, device_ids, sensor_status }. Partner API returns{ data, total, average }for impressions endpoints — no sensor-status or geo-center embedding, and no implicit default date range (both dates are required). - Legacy status codes
INVALID_IDon unknown assets,INVALID_DATE,INVALID_DATE_ORDER,REQUIRED_DATES. Partner API returnsNOT_FOUND,INVALID_DATE,INVALID_DATE_RANGE,REQUIRED_PARAMETER— stable, machine-readable, documented in Errors. - Legacy returns cross-tenant
404inconsistently depending on how assets are filtered. Partner API is strict: any asset outside your key's scope is always404 NOT_FOUND, never403.
What the Partner API adds
Things worth migrating toward, not just migrating off:
- Sensors.
/v1/partner/sensorssurfaces hardware separately from the assets they're attached to — serial, model, billable state, 15-minute health check. Legacy has no equivalent. - Demographics.
/v1/partner/assets/{id}/demographicsand/v1/partner/demographics/aggregatewere never on the legacy surface. - Regional / city breakdowns.
/v1/partner/assets/{id}/impressions/by-regionand/by-cityare new Partner API endpoints, not legacy mappings. - Timeseries with explicit grain.
/v1/partner/assets/{id}/impressions/timeseries?grain=…exposesminute,quarter_hour,hour,day,week,month, andquarterfrom a single endpoint. Legacy only offered fixed-grain/per-minute,/daily, and/hourlycalls.
Timeline
No forced cutover date. Legacy stays up until access logs show zero traffic. A Deprecation header starts appearing on legacy endpoints roughly 90 days after the Partner API goes GA — purely informational, no behaviour change.