Lambda: Request must be smaller than 6291456 bytes for the InvokeFunction operation (RequestEntityTooLargeException)
The event payload (or response) is over Lambda’s 6 MB synchronous limit (256 KB for async invocations).
Seen on:
AWS
Meaning
Payload limits apply to the request and the response. API Gateway uploads of files, large JSON batches, or functions returning big responses hit it. Put large data in S3 and pass a reference instead.
Common causes
- Uploading files through API Gateway → Lambda
- Large batch payloads
- Function response over 6 MB
- Async invoke (event) over 256 KB
⚡ Quick fix
- Upload to S3 with a presigned URL and pass the key
- Paginate or compress responses
- Split batches
Detailed fix by platform
Node.js
- javascript
const url = await getSignedUrl(s3, new PutObjectCommand({ Bucket, Key }), { expiresIn: 300 }); // client uploads directly to S3, then calls the API with { key }
How to diagnose
- Size — Request/response bytes
- Invocation — Sync or async?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in AWS
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026