I'm implementing a server-to-server batch integration using the Dropbox API v2 with OAuth 2.0. I'm using token_access_type=offline to obtain a refresh token, and calling grant_type=refresh_token before each batch run to get a fresh access token.
I have two questions that I couldn't find clearly documented:
1. Refresh token expiration
Does the offline refresh token ever expire on its own (aside from explicit revocation by the user or app)? If so, what is the typical validity period? Also, is there a specific error code or response field (e.g., invalid_grant) that reliably indicates the refresh token itself has expired or been revoked, as opposed to a transient error?
2. Refresh token rotation
When calling /oauth2/token with grant_type=refresh_token, does the response ever include a new refresh_token value? If rotation can occur, is the previously issued refresh token invalidated at that point?
We're currently storing the refresh token as an environment variable, and depending on the answers above, we may need to move to a database or AWS Secrets Manager with an update mechanism. Any clarification would be greatly appreciated.