Skip to main content
Manually refresh your authentication token using the stored refresh token.

Usage

Description

Manually refresh your authentication token using the stored refresh token. Token refresh normally happens automatically when making API requests. Use this command to force an immediate refresh or to verify the refresh mechanism is working correctly.
This command only works with OAuth sessions. API tokens and environment variable tokens cannot be refreshed.

Options

boolean
default:"false"
Output result as JSON. The JSON format includes success, refreshed, message, expiresIn, and expiresAt fields.
boolean
default:"false"
Force refresh even if token is still valid. By default, the command only refreshes if the token is expired or about to expire.

Examples

Basic refresh

Expected output:

Force refresh

Expected output:

Token still valid

If the token doesn’t need refreshing:
Expected output:

JSON output

Expected output:
Token refresh happens automatically when you run commands that make API requests, so you rarely need to run this command manually.

Limitations

Environment variable tokens

If you’re using SENTRY_AUTH_TOKEN or SENTRY_TOKEN environment variables:
Expected output:

Manual API tokens

If you logged in with sentry auth login --token:
Expected output: