invalid_schedule
The scheduled_at value falls outside the window the API accepts. The message was not
queued, and nothing was charged.
Status: 422
{
"status": 422,
"type": "invalid_schedule",
"message": "scheduled_at must be within 72 hours",
"request_id": "req_01J8K2P...",
"doc_url": "https://docs.epostix.com/errors/invalid_schedule"
}
Why you got this
- The time has already passed.
messagereadsscheduled_at must be in the future. - The time is more than 72 hours ahead.
messagereadsscheduled_at must be within 72 hours. - You sent local time where UTC was expected, so a time you meant as future arrived as past.
- The value was computed minutes before the request and the clock ran out in between, which shows up on slow queues and on retries.
How to fix it
Compute scheduled_at in UTC at the moment you send, and check it against both edges of the
window before calling: later than now, and no more than 72 hours out. Branch on the type
rather than the message, since both cases share this one type.
To send further ahead than 72 hours, hold the message in your own system and call the API
closer to the send time. A message already inside the window can be moved by rescheduling it,
which stops working once it has been sent and returns
email_not_cancellable.
Is it safe to retry
No, not unchanged. Recompute scheduled_at and send a new request. Retrying the same body
fails again, and keeps failing as the original time recedes further into the past.