bad_gateway

HTTP 502 — An upstream service returned an invalid response.

Returned as application/problem+json with code bad_gateway and HTTP status 502.

An upstream service the gateway depends on returned an invalid or unexpected response.

Common causes

  • A downstream service failed or returned something outside its contract.

How to resolve

  • Usually transient — retry with backoff.
  • If it persists, contact support with the request_id.

Example

1{
2 "type": "https://docs.usglobalmail.com/api/problems/bad_gateway",
3 "title": "An upstream service returned an invalid response.",
4 "status": 502,
5 "code": "bad_gateway",
6 "request_id": "req_8f3c2a1b9d",
7 "instance": "/v1/mails"
8}
This error is typically transient — safe to retry with exponential backoff.