The "invalid_grant" error. occurs when Google Cloud Platform project with an OAuth consent screen configured for an external user type and a publishing status of "Testing" is issued a refresh token expiring in 7 days. Your Google project's publishing status is Testing so the refresh token expires every 7 days and receives an invalid_grant error.
You can follow the following steps to avoid this issue:
Additionally, the invalid_grant error usually indicates an issue with the refresh token. That said, you’ll need to regenerate credentials and refresh tokens. You may refer to this document to read more information about refresh token expiration.
Note that the access token will expire in 1 hour. You can use the refresh token to refresh an expired access token. By default, our client libraries automatically refresh expired access tokens.
Since you are using the PHP client library, you may refer to this sample code to generate user credentials. Once you have a valid refresh token, the error should disappear.![]() |
Google Ads API Team |
[2025-07-21 17:11:10Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01swEf4:ref" (ADR-00319613)