I am a developer setting up a Klaviyo integration with our web app. Each time I create a new integration the access token and refresh token work for a day and then the refresh token gets revoked remotely. We are still in development stage and this is not accessable to customers. We do run some unit tests for accessing the API through our code with the OAuth token. I have noticed that our unit tests occasionally hit rate_limit_exceeded exceptions on the refresh token and also invalid_grant with the message “Refresh token has been revoked”
My question is, what could cause our refresh tokens to be revoked? It is not coming from us or a customer, and it hasn't been inactive for 90 days. Any help is appreciated. Thanks
Solved
OAuth integration refresh token being revoked
![[Academy] Klaviyo Product Certificate Forum|alt.badge.img](https://uploads-us-west-2.insided.com/klaviyo-en/attachment/8798a408-1d98-4c3e-9ae8-65091bb58328_thumb.png)
Best answer by Maxbuzz
Hello
The documentation says
This is likely the only reason you will be getting an
“invalid_grant”
in production. This will occur for one of two reasons:
1. The customer uninstalled your app in Klaviyo.
2. Your app made a request to/oauth/revoke
resulting in the app being revoked. This was likely because the customer uninstalled the app on your end.
I would check for any other test running in parallel that can revoke the token.
Reference link: https://developers.klaviyo.com/en/docs/set_up_oauth#:~:text=%22error_description%22%3A%20%22Refresh%20token%20has%20been%20revoked%22
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.