Docs / SynthEvents / Errors / range-too-short
range-too-short
The time range is too short: either shorter than one day, or too short for the number of events.
- Status:
422 Unprocessable Entity - Route:
POST /api/v1/generate-events - Description:
range is too short: expected at least one dayfor a range shorter than one day, andrange is too short for the event count: expected a longer range or fewer eventsfor a range too short for the number of events. - Details:
fromandto, as the request gave them, and for a range too short for the number of eventseventCountas well.
Why It Happens#
- The range is shorter than one day, that is, shorter than 24 hours from
fromtoto, whatever the number of events. SynthEvents refuses such a range before it runs anything, for every domain alike. A day is counted in hours rather than in the calendar of a time zone, so a day on which a zone changes to daylight saving time, which has 23 hours, is too short. - Even the largest population that SynthEvents sizes, with as many members as events asked for, comes out at too few events in this range: in so short a range, hardly anybody does anything.
- The run comes out at no events at all. An empty data set is never what anybody asks for, so it is refused, too.
How to Fix It#
Make the range at least one day long. If it is long enough and the request is refused all the same, make the range longer still, or ask for fewer events. For how SynthEvents sizes a run, see The Number of Events.
Example#
For 20,000 events of the to-dos within a single minute, SynthEvents answers:
{
"type": "error",
"data": {
"code": "https://docs.synthevents.io/errors/range-too-short",
"description": "range is too short: expected at least one day",
"details": {
"from": "2025-01-01T00:00:00Z",
"to": "2025-01-01T00:01:00Z"
}
}
}