Why We Built API v2
API v1 has served us well since 2021, but it was designed for a different product. As our platform grew from 10,000 to 2 million meters under management, v1's REST-only design created friction for complex data queries and real-time integrations.
What's New in v2
GraphQL Endpoint
query GetMeterReadings($meterId: ID!, $from: DateTime!, $to: DateTime!) {
meter(id: $meterId) {
id
location { lat lng }
readings(from: $from, to: $to, interval: HOURLY) {
timestamp
value
unit
}
anomalies(from: $from, to: $to) {
detectedAt
severity
description
}
}
}
Webhook Subscriptions
POST /v2/webhooks
{
"url": "https://your-system.com/ansol-hook",
"events": ["anomaly.detected", "alert.critical", "meter.offline"],
"secret": "your-signing-secret"
}
Cursor-Based Pagination
v1 used offset pagination (slow on large datasets). v2 uses cursor-based pagination:
GET /v2/readings?cursor=eyJpZCI6MTIzfQ==&limit=100
Migration Timeline
- v1 sunset date: December 31, 2026
- Migration tool available in developer portal
- Free migration assistance for enterprise clients
Rate Limits
| Plan | Requests/min | GraphQL complexity |
|---|---|---|
| Starter | 100 | 1,000 |
| Business | 1,000 | 5,000 |
| Enterprise | Unlimited | Custom |