OAuth Token Refresh Failures in Multi-Org AppFoundry Integration (401 Unauthorized)

We are encountering persistent authentication issues with our Genesys Cloud integration, which is deployed via AppFoundry. Our application services multiple organizations using the multi-tenant OAuth flow. While initial token acquisition succeeds, subsequent token refresh operations frequently fail with a 401 Unauthorized error, specifically citing invalid_grant.

This issue appears to be intermittent and correlates with high-volume API usage. We are using the Genesys Cloud REST API v2 endpoints for our integration logic. The environment details are as follows:

  • SDK: Genesys Cloud SDK for Node.js v5.1.2
  • Auth Method: Client Credentials with JWT assertion for user impersonation
  • Error Response: {"error":"invalid_grant","error_description":"The refresh token has been revoked or expired."}

We have verified that the refresh tokens are being stored securely and are not being rotated prematurely in our backend. However, the error suggests Genesys Cloud is rejecting the token before its documented expiry. We suspect this might be related to API rate limiting triggering a security lockout, but our logs do not show any 429 responses preceding the 401 errors.

Has anyone else experienced similar token invalidation issues in a multi-org setup? Are there specific best practices for handling token lifecycle in high-throughput AppFoundry apps to avoid these intermittent failures? We are looking for insights on whether this is a known platform behavior or if our implementation of the refresh flow needs adjustment.