← All articles

Dropbox API Token Expiration: Lifetimes and Refresh Rules

Two differently sized blank cards on a closed dark notebook with an amber bookmark.
Record access and refresh credentials separately, including the applicable provider rules.

Key takeaways

  • Dropbox access tokens expire in about four hours, and new apps get short-lived tokens with a refresh token by default.
  • Dropbox refresh tokens have no expiry timer and are never rotated; they die only on event-driven triggers like a password change or app disconnect.
  • Google access tokens last about an hour, and its refresh tokens can be revoked on risk signals or go stale after six months of non-use.
  • Microsoft Graph refresh tokens can last up to 90 days, but conditional access policies can invalidate tokens mid-flight.
  • Track credential ownership and expiry metadata in one inventory so a revocation maps to a named owner within minutes.

Dropbox API token expiration works like this: access tokens live about four hours, refresh tokens let your app mint new ones indefinitely, and Dropbox does not rotate refresh tokens on use. Gmail and Microsoft Graph run shorter access token lifetimes with different revocation triggers, which changes how you schedule credential lifecycle checks across all three.

How long do Dropbox API access tokens last before expiring?

Dropbox access tokens are short-lived: they expire in about four hours. New apps get short-lived tokens by default, along with a refresh token you exchange for new access tokens. That is a deliberate design change on Dropbox's part, and it matches the broader shift away from long-lived bearer credentials across major APIs.

Legacy long-lived tokens vs short-lived tokens

Older apps created before the policy change can still hold long-lived tokens that never expire on a schedule. Dropbox kept those working so existing integrations did not break overnight, but any app you register now gets the short-lived model. The Dropbox API documentation on access tokens covers the token types and their lifetimes.

The practical difference shows up in your secrets operations. A long-lived token behaves like a Stripe API key: one rotation deadline, one owner, one entry in your secrets manager. A short-lived token with a refresh token behaves like a lease. The access token itself stops being the thing you guard, because it dies in four hours regardless. What matters is the refresh token: its custody, its revocation status, and who owns the integration that depends on it. That is the same distinction between an expiring key and a rotation deadline we covered in API key expiration policy examples, and it changes what "who owns this credential" means for your team.

How do you refresh an expired Dropbox access token using a refresh token?

Exchange the refresh token, plus your app key and app secret, at Dropbox's token endpoint. The response returns a fresh short-lived access token; the refresh token itself stays valid and is reused for every subsequent exchange.

Worked example: token exchange request

curl https://api.dropboxapi.com/oauth2/token \
  -d grant_type=refresh_token \
  -d refresh_token=YOUR_REFRESH_TOKEN \
  -u YOUR_APP_KEY:YOUR_APP_SECRET

A successful response includes access_token, expires_in (access token lifetime in seconds), token_type (always Bearer), and scope. Your code should store the new access_token and schedule the next refresh before expires_in runs out. Because Dropbox does not rotate refresh tokens, you keep using the same one until it is revoked by the user or via the API.

The failure mode teams hit is not the exchange itself but the follow-through: nobody owns the job, so the refresh job silently dies and the integration breaks mid-month. Tracking which credential expires when, and who owns it, is the gap a lifecycle layer like KeyGuardRail covers while your vault keeps holding the secret values.

When does a Dropbox refresh token itself expire or get revoked?

A Dropbox refresh token has no expiry timer. Unlike the short-lived access token, it stays valid indefinitely until something kills it, and Dropbox does not rotate refresh tokens: you keep using the same one through every refresh cycle. That means your rotation policy for Dropbox looks nothing like a 30/60/90 day schedule for a Stripe or GitHub key, because the provider never expires the credential on its own.

Revocation triggers to watch

Per Dropbox's OAuth guide, refresh tokens stop working when a user changes their password, disconnects your app from their account, or an admin revokes access. Token endpoint failures can also follow if the user revokes via app settings.

Since the credential never ages out, revocation is event-driven, which makes ownership tracking the real control. Knowing which integration and which owner a refresh token belongs to beats guessing after a disconnect. If you are mapping expiry and ownership across providers, see how to track API key expiry.

How does Dropbox token expiration differ from Gmail API token expiration?

Google access tokens last about an hour, so your integration refreshes far more often than with Dropbox. The refresh token is where the real difference shows up: Google's risk-based systems can revoke it at any time if they detect suspicious activity, and a refresh token that goes unused for six months goes stale. Google may also rotate refresh tokens in some scenarios, meaning your stored credential can be replaced without you doing anything wrong. Practically, that means a Gmail integration needs to handle three failure modes: routine hourly refresh, unexpected revocation, and silent staleness from low usage. Dropbox's model is more predictable but puts more responsibility on you to track when the refresh token itself is at risk. Either way, the credential your vault stores is metadata about trust, not a stable secret, which is why ownership and expiry tracking matter more than the token value itself.

How does Dropbox token expiration differ from Microsoft Graph API token expiration?

Microsoft Graph access tokens default to roughly 60-90 minutes, similar to Dropbox's short-lived access tokens, but the refresh side behaves differently. Graph refresh tokens can last up to 90 days, and single sign-on sessions extend that window, so a well-used integration can go months without re-authenticating. Dropbox refresh tokens have no stated lifetime but die on specific events: password changes and app disconnects revoke them, per Dropbox's developer documentation.

The bigger operational difference is conditional access. A Graph token can be invalidated mid-flight when a conditional access policy changes, a password is revoked, or an admin disables the account. Dropbox has no equivalent policy layer; revocation is event-driven and narrower.

For your rotation policy, treat Graph credentials as having a hard 90-day ceiling plus unpredictable mid-life invalidation, and Dropbox credentials as event-driven revocation. Either way, your vault holds the secret value but not the ownership metadata. That gap is what a lifecycle monitoring layer like KeyGuardRail's automation brief addresses: track which team owns each token and when it must be re-verified, without custody of the secret itself.

Side-by-side: token lifetimes, refresh behavior, and revocation triggers

DropboxGmail (Google)Microsoft Graph
Access token lifetimeShort-lived (hours)~1 hour~60–90 minutes
Refresh tokenIssued once, no rotationIssued; rotating option availableIssued; refresh token rotation configurable
Revocation triggersUser revokes app, token disabled, password changeUser revokes, admin policy, password changePassword change, admin revocation, policy
Expiry metadata in responseYesYesYes

The operational difference is small in code but large in process. All three providers expect you to store a refresh token and exchange it before each call or on a 401, so the integration pattern is roughly identical.

What differs is how you track the credential. A Dropbox refresh token does not rotate on use, so the value in your vault can stay valid for years until a human revokes it. That makes ownership and expiry metadata matter more than the token itself: if nobody owns the record, nobody notices when the app loses authorization.

What the differences mean for your integration code

Treat every provider token as short-lived and cache only the refresh token. Check expiry timestamps before calls instead of retrying on failure, and log which service account or app registration each credential belongs to so a revocation maps to a named owner within minutes, not days.

What breaks in your integration when a Dropbox token expires?

Three failure modes, in order of how painful they are to debug. First, 401 errors mid-job: a long-running batch job starts with a valid token and dies partway through when the access token expires, which for most providers means roughly an hour of runtime (Google documents ~1 hour lifetimes and refresh token rules, including revocation after six months of non-use, in its OAuth 2.0 documentation). Second, background syncs failing silently: a nightly job that nobody watches logs 401s for weeks until someone notices stale data. Third, webhook handlers losing access: callbacks keep arriving but verification or API calls back to Dropbox fail, so you accrue events you can no longer act on.

The common thread is that expiry surfaces as a runtime error in a system that assumed the credential was permanent. If no one owns that credential or tracks its expiry, the failure surfaces in production, not in a rotation deadline.

How should you design your app to handle Dropbox token expiration automatically?

Store the refresh token in your vault (AWS Secrets Manager, Vault, Infisical), never in app config or a Postman collection. Treat the access token as disposable: refresh proactively on a schedule well under Dropbox's access token lifetime, so a scheduled refresh always beats an unexpected 401.

When a 401 does slip through, handle it once: refresh, retry the original request a single time, and fail loudly if it 401s again. A retry loop that refreshes on every failure turns a revoked token into a hammering of the token endpoint.

Tracking expiry and ownership across providers

Dropbox, Google, and Microsoft Graph all expire tokens on different clocks, so expiry metadata belongs in one inventory, not in each integration's code. Record who owns the credential ("Payments platform", "Platform engineering"), the provider, the rotation deadline, and the last successful refresh. That audit trail answers "who owns this key" before an expired token pages you.

KeyGuardRail tracks that lifecycle metadata without holding the secret value, so your vault stays the single source of truth for secrets while expiry and ownership get a coordinator.

FAQ

Do old Dropbox long-lived tokens ever stop working?

Legacy long-lived tokens issued before Dropbox's policy change can keep working indefinitely on their original schedule. They die only on event-driven triggers: the user disconnects your app, changes their password, or an admin revokes access. Any newly registered app gets short-lived tokens with a refresh token instead, so the long-lived model exists only for older integrations.

Why does my Dropbox refresh token stop working after a user changes their password?

Password changes are one of Dropbox's documented revocation events for refresh tokens, alongside the user disconnecting your app or an admin revoking access. Because refresh tokens have no expiry timer, revocation is entirely event-driven rather than age-driven. Treat a user's password change notification as a signal that the integration needs re-authorization.

Can I extend the Dropbox access token lifetime beyond four hours?

No. New apps get short-lived access tokens by default and there is no configuration to lengthen them. The design expects you to hold a refresh token and exchange it for a fresh access token whenever needed, scheduling refreshes well before the current token expires so a proactive refresh always beats an unexpected 401.

Does Dropbox rotate refresh tokens like Google sometimes does?

No. Dropbox issues a refresh token once and never rotates it; you reuse the same value through every exchange until it is revoked. Google may rotate refresh tokens in some scenarios and can revoke them on risk-based signals, so a stored Google credential can be replaced without any mistake on your side.