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. - Fixed grains. Legacy's
/per-minuteendpoint is replaced by explicit/dailyand/hourlygrains. Per-minute isn't exposed on the Partner API in v1 — raise a ticket if you depend on it.
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/{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= | No direct equivalent in v1. Use GET /v1/partner/assets/{id}/impressions/hourly?from_date=&to_date= for the finest grain available, with from_date = to_date = date. | Per-minute resolution is deferred to v1.1+. Hourly covers the common dashboard use case; email support if you need finer. |
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.
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.