Hey @arens.myzyri, Klaviyo doesn’t currently support webhooks for this.
The approach I’ve found most reliable is to handle OAuth refresh errors correctly. In particular, an invalid_grant error (documented here: https://developers.klaviyo.com/en/docs/troubleshoot_oauth_errors#error-descriptions-for-invalid-refresh-token) indicates that the user has removed the app from Klaviyo, which revokes all access and refresh tokens.
The behavior you’ll see is that an access token—while not yet “expired” based on its issuance—will start returning 401s, and the invalid_grant error will appear when attempting a refresh.
Since my app doesn’t check this every hour, I’ve added a “health check” that runs when users visit the integrations page to confirm their connection is still valid. If your app has more frequent background jobs, you could incorporate a similar check there.
Hey @arens.myzyri, Klaviyo doesn’t currently support webhooks for this.
The approach I’ve found most reliable is to handle OAuth refresh errors correctly. In particular, an invalid_grant error (documented here: https://developers.klaviyo.com/en/docs/troubleshoot_oauth_errors#error-descriptions-for-invalid-refresh-token) indicates that the user has removed the app from Klaviyo, which revokes all access and refresh tokens.
The behavior you’ll see is that an access token—while not yet “expired” based on its issuance—will start returning 401s, and the invalid_grant error will appear when attempting a refresh.
Since my app doesn’t check this every hour, I’ve added a “health check” that runs when users visit the integrations page to confirm their connection is still valid. If your app has more frequent background jobs, you could incorporate a similar check there.
Hi cadence,
I think we will go with the same approach. If they visit our services I will try to generate access_token by using their refresh token. If it doesn’t work it mean that the app is removed.
Thank you for the insights.