We are building an integration using the WHOOP API and are running into a frustrating “Token Desync” issue that is forcing our users to repeatedly re-authenticate. I’m curious if any other developers here have run into this or found a workaround.
The Scenario: When our back-end attempts to refresh an access token via https://api.prod.whoop.com/oauth/oauth2/token, we occasionally receive a 502 Bad Gateway from Cloudflare (error_name: origin_bad_gateway). The Cloudflare payload specifically states that the origin web server returned an invalid or incomplete response.
Because we receive a 502, our server never receives the new refresh_token. However, it appears WHOOP’s backend successfully processed the token rotation before the gateway timeout occurred.
When our cron job attempts to retry the refresh 15 minutes later using the “old” refresh token, WHOOP rejects it with a 400 Bad Request (invalid_grant). The token has been permanently desynced, and the user is disconnected.
My Questions:
Has anyone else experienced these intermittent 502 gateway timeouts when refreshing tokens?
Does WHOOP offer any sort of Refresh Token Grace Period? Many OAuth providers (like Auth0 or Okta) allow the old refresh token to remain valid for a short window (e.g., 60 seconds) specifically to prevent desyncs caused by network failures like this.
If any WHOOP engineers browse these forums, here is a recent request where your origin dropped the response during rotation:
Timestamp: 2026-08-03T04:00:17Z
Cloudflare Ray ID: a25269c76d181f5e
Zone: api.prod.whoop.com
Any insights or workarounds from the community would be hugely appreciated!


