Invalid Date Range
URI: https://docs.ankatech.co/errors/invalid-date-range
HTTP Status: 400 Bad Request
When you see this
You asked a usage read or a usage export for a date range wider than the platform will answer for. Both dates were individually valid and in order; the span between them exceeds the cap of the grain you asked for. The correction is to send a narrower range.
| Operation | Cap |
|---|---|
GET /api/v3/admin/usage/telemetry | 366 days at grain=day, 24 calendar months at grain=month |
GET /api/v3/admin/platform/usage/telemetry | the same |
POST /api/v3/admin/usage/exports | the same, and no job is created when it is exceeded |
The cap is on the difference between the ends, not on the inclusive day count: at grain=day, 366 days apart is answered and 367 is refused. It is 366 rather than 365 so that a full leap year fits in one request.
from and to are required on all three — there is no "all time" — and the span is checked before any upstream call is made, so a refused range costs nothing and reveals nothing about whether the data exists.
Not this problem type
- An inverted range (
fromlater thanto), an unknowngrain, or apage/sizeout of bounds is Invalid Input: the Admin API checks the range's shape before it measures the span. - An absent
fromortois refused during request binding as Validation.
Response Example
{
"type": "https://docs.ankatech.co/errors/invalid-date-range",
"title": "Invalid Date Range",
"status": 400,
"detail": "The requested span of 731 days exceeds the maximum of 366 for grain day.",
"instance": "/api/v3/admin/usage/telemetry"
}
Content-Type: application/problem+json — the response follows RFC 9457 Problem Details. The Admin API nests its correlation identifier under extensions.requestId.
How to Resolve
- Keep the span within the grain's cap; split a longer question into consecutive requests, or ask at
grain=monthfor a range longer than a year. - The admin console's Usage pages never send a range over the cap: Apply stays disabled, and a link carrying one falls back to the initial view.
The full contract is on Usage Telemetry, Exports & Signed Statements*.