attachment_expired
The id is still recognised, but the file behind it passed the 24 hours a pre-upload is kept for and can no longer be attached. Nothing was sent and nothing was charged.
Status: 422
{
"status": 422,
"type": "attachment_expired",
"message": "This attachment has expired. Pre-uploaded attachments are kept for 24 hours.",
"request_id": "req_01J8K2P...",
"doc_url": "https://docs.epostix.com/errors/attachment_expired"
}
Why you got this
- The file was uploaded well before the send, in an earlier run or an earlier deployment.
- An attachment id is kept in configuration, a fixture or a database row and reused.
- A queued job or a retry loop reached the send more than a day after the upload.
- A message was rejected for another reason and resubmitted the next day with the same id.
How to fix it
Upload the file again and use the id you get back. The 24 hours run from the upload, not from first use, so upload as close to the send as you can and never persist an id beyond the run that created it.
Once the file is cleaned up entirely the type changes to
attachment_not_found. If a file has to stay available for
longer than a day, host it and pass its URL on the attachment instead of pre-uploading.
Is it safe to retry
No, not with the same id. Upload the file again and send a new request referencing the id you get back.
Reusing the Idempotency-Key is safe, because a rejected request was never stored.