---
title: "GATEWAY_TIMEOUT"
description: "What triggers a GATEWAY_TIMEOUT error (HTTP 504) when the upstream EHR system does not respond in time."
canonical_url: "https://docs.leyr.io/api/error-handling/gateway_timeout"
---
# GATEWAY_TIMEOUT

> What triggers a GATEWAY_TIMEOUT error (HTTP 504) when the upstream EHR system does not respond in time.

## Summary

Corresponds to a standard `504 Gateway Timeout` HTTP response status

> The upstream EHR system did not respond in time, so the request timed out.

## Example Response

```json
{
    "code": "GATEWAY_TIMEOUT",
    "type": "https://docs.leyr.io/api/error-handling/gateway_timeout",
    "title": "Gateway Timeout",
    "status": 504,
    "detail": "Your request timed out. Try again or contact us if the issue persists.",
    "instance": "36b5909e-4391-4520-b303-84cbb80c4264"
}
```

## Common Causes

- The EHR system is slow or unresponsive under load
- The request queried a very large dataset or wide time range, taking too long on the EHR side
- A network connectivity issue between Leyr and the EHR

## Resolution Steps

1. Retry your request after a brief delay - timeouts are often transient.
2. If retries keep timing out, narrow the request - for example, query a smaller date range or fewer resources per call.
3. If the issue persists, contact our support team at [contact@leyr.io](mailto:contact@leyr.io) with the `instance` ID from the error response.


## Sitemap

See the full [sitemap](https://docs.leyr.io/sitemap.md) for all pages.
