Endpoint request timed out AWS Origin: Platform & cloud Last updated 14 Oct 2026

API Gateway: {"message": "Endpoint request timed out"} (504 after 29 seconds)

The backend (usually Lambda) didn’t respond within API Gateway’s integration timeout (29 seconds by default for REST APIs).

Exact message you may see Endpoint request timed out{"message": "Endpoint request timed out"}Execution failed due to a timeout error
Seen on: AWS

Meaning

Even if the Lambda timeout is 15 minutes, the API returns 504 at the integration limit. Long-running work must go async (queue + polling/webhook), or be sped up.

Common causes

  • Lambda/backend work takes longer than the integration timeout
  • Cold start + slow dependency (DB in VPC, external API)
  • Lambda in a VPC without NAT waiting on internet calls

⚡ Quick fix

  1. Move long tasks to async processing (SQS/Step Functions) and return 202
  2. Optimise the slow call; add timeouts on outbound requests
  3. Request a higher integration timeout where supported

Detailed fix by platform

AWS CLI

  1. aws logs tail /aws/lambda/my-fn --since 10m | grep -E 'REPORT|Task timed out'

How to diagnose

  1. Duration — Lambda REPORT duration
  2. Dependencies — Slow outbound calls?
  3. VPC — NAT for internet access?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

2006 — MySQL ERROR 2006 (HY000): MySQL server has gone away (MySQL)20062013 — MySQL ERROR 2013 (HY000): Lost connection to MySQL server during query (MySQL)2013408 — HTTP 408 Request Timeout (HTTP)408499 — HTTP 499 Client Closed Request (Nginx) (HTTP)499504 — HTTP 504 Gateway Timeout (HTTP)504522 — Cloudflare Error 522: Connection Timed Out (Cloudflare)522524 — Cloudflare Error 524: A Timeout Occurred (Cloudflare)52457014 — ERROR: canceling statement due to statement timeout (PostgreSQL)57014Endpoint …

Explore the map of this error Full error map →

🧠 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.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.