
File / Download
Your Google API integration worked fine. Then, a few days later, every request started failing with: invalid_grant: "Token has been expired or revoked." You found the Stack Overflow thread, and the usual answer was “your app is in Testing mode.” Often that’s right. But what if you already switched to Production? What if your token came from the OAuth Playground? What if only one user is affected? This guide picks up where the forum answers stop. It covers every refresh-token expiry cause in Google’s own documentation, shows you how to tell them apart, and walks you to a fix that lasts.
What’s inside
Read the error correctly. Learn where invalid_grant comes from and why retrying won’t help.
The seven-day trap. See exactly why External apps in “Testing” lose their refresh tokens after 7 days, and what to change.
Every documented cause in one table. This covers user revocation, six months of non-use, password changes on Gmail scopes, token limits, time-based access, admin restrictions and session-control policies.
The OAuth Playground gotcha. Find out why Playground tokens made with the default credentials are revoked after 24 hours, and how to mint one that lasts.
A ten-minute diagnostic decision tree. Match your failure timing to its likely cause.
Choose the right setup. Compare Testing, Production, Internal and service accounts side by side.
Token handling that survives. Turn an expired grant into a one-click reconnect instead of a silent failure, with an illustrative Python example.
A clear action plan. Work through it in three phases: today, this week, and ongoing.
Also included: 3 printables
A refresh-token self-assessment
A decision checklist for working through an incident
A one-page implementation plan
Who it’s for
Developers, analysts and solo builders running Google Analytics reports, scripts, dashboards or SaaS integrations that keep losing authorization.