payload_too_large
The request was rejected on arrival because of its size, before any field was read. Nothing was sent and nothing was charged.
Status: 413
{
"status": 413,
"type": "payload_too_large",
"message": "Request body is too large. Pre-upload large attachments with POST /attachments.",
"request_id": "req_01J8K2P...",
"doc_url": "https://docs.epostix.com/errors/payload_too_large"
}
Why you got this
- A file was inlined in the send request instead of being uploaded first.
- A batch carries up to 100 emails, and each one adds its own HTML body, attachments and metadata to the same request.
- The HTML body embeds images as data URIs rather than linking to them.
- A generated document or report was pasted into the message body.
How to fix it
Upload each file with POST /attachments first, then reference the returned attachment id
in the send request. That keeps the request small no matter how large the file is. A
pre-uploaded attachment stays usable for 24 hours, after which referencing it returns
attachment_expired.
If the attachments themselves go over the 40MB total limit, pre-uploading will not help and
you get attachment_too_large. Split the message or link to
the file instead. For a batch, send fewer emails per request.
Is it safe to retry
No, not unchanged. Rebuild the request with attachment ids and send it again. Nothing was
stored, so reusing the same Idempotency-Key is safe.