33

What is the request-payload limit with AWS API-Gateway?

I need to send a JSON payload with base64 encoded files and some other parameters to API Gateway, that will then pass on the payload to AWS Lambda.

I could not find AWS documentation regarding this.

Suhail Gupta
  • 22,386
  • 64
  • 200
  • 328

2 Answers2

60

Maximum payload to API gateway is 10 MB and maximum payload for Lambda is 6 MB, which cannot be increased.

Please see API gateway payload limits here

Please see Lambda payload limits here

But there is an alternative way (a work around) to achieve the same by uploading data to an S3 bucket if your size is more that 10 MB. Please read the below article for details (Unofficial document):

https://sookocheff.com/post/api/uploading-large-payloads-through-api-gateway/

smottt
  • 3,272
  • 11
  • 37
  • 44
Vijayanath Viswanathan
  • 8,027
  • 3
  • 25
  • 43
  • Am looking to read the official documentation. Google search gives out different answers to same question – Suhail Gupta Sep 22 '17 at 09:25
  • @SuhailGupta there will not be an official documentation for this as this will be a work aorund to solve existing size limitage. – Vijayanath Viswanathan Sep 22 '17 at 09:29
  • What does it mean? – Suhail Gupta Sep 22 '17 at 09:31
  • @SuhailGupta If you are looking for official documents for limit usage then I have updated the answer. The solution document link I have provided in just a work around to acheive size limitage problem in a different way, which is unofficial document – Vijayanath Viswanathan Sep 22 '17 at 09:38
  • The most common solution is to have a api route with a lambda that generates a presigned s3 upload link. Then hook a lambda as a s3 event to read that file as a payload/json – Mojimi Aug 06 '19 at 12:33
8

The API Gateway has a request size limit of 10MB.

Amazon API Gateway Limits, Pricing and Known Issues

The more important limit in your scenario is the lambda size limit which is only 6 MB.

AWS Lambda Limits

jens walter
  • 13,269
  • 2
  • 56
  • 54