> ## Documentation Index
> Fetch the complete documentation index at: https://nango.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Token refreshing & validity

> How Nango handles OAuth token refresh and what to do when tokens are revoked.

## Automatic token refresh

Nango automatically refreshes OAuth access tokens before they expire. You don't need to implement any refresh logic in your application.

To prevent token revocation due to inactivity (some APIs revoke unused refresh tokens), Nango refreshes each access token at least once every 24 hours.

## Handling refresh failures

Token refresh can fail for various reasons:

* The user revoked access in the external application
* The external API revoked the refresh token
* The external API experienced an outage

When a refresh fails, Nango can [notify your app via webhook](/guides/platform/webhooks-from-nango) so you can prompt the user to reconnect.

## Best practices

Revoked access tokens and refresh failures happen to all integrations. To handle them gracefully:

1. **Monitor for failures**: Set up [webhooks from Nango](/guides/platform/webhooks-from-nango) to receive notifications when token refresh fails
2. **Handle revoked tokens**: Follow our [guide on handling revoked access tokens](/guides/platform/common-issues#token-refresh-error-from-the-external-api)
3. **Implement re-authorization**: Make sure you have the [re-authorization flow](/guides/auth/auth-guide#re-authorize-an-existing-connection) in place so users can easily reconnect broken connections

## Related guides

* [Auth guide](/guides/auth/auth-guide#re-authorize-an-existing-connection) - implement reconnect sessions for invalid credentials.
* [Webhooks from Nango](/guides/platform/webhooks-from-nango) - receive refresh failure notifications.
* [Common issues](/guides/platform/common-issues#token-refresh-error-from-the-external-api) - troubleshoot revoked tokens.

<Tip>
  **Questions, problems, feedback?** Please reach out in the [Slack community](https://nango.dev/slack).
</Tip>
