Overview
Refreshes a JWT token by validating the existing token and issuing a new one with updated user information from Roblox.Procedure Type
Mutation - This endpoint generates a new authentication token.Input Parameters
The existing JWT token to refresh. Can be expired or still valid.Validation:
- Must be a valid JWT signed with the correct secret
- Must contain a valid
robloxUserIdfield
Response Fields
New JSON Web Token for authenticated API requests. Valid for 1 hour.
Updated user information fetched from Roblox.JwtUser fields:
robloxUserId(string): The user’s Roblox user IDusername(string): The user’s current Roblox usernamedisplayName(string): The user’s current Roblox display namepicture(string): URL to the user’s current Roblox avatar headshot (420x420 PNG)
Rate Limiting
Per User:- Limit: 4 requests per user
- Window: 3600 seconds (1 hour)
- Key:
robloxUserIdfrom JWT payload
- Error Code:
TOO_MANY_REQUESTS - Message:
Rate limit hit. Try again in {seconds}s.
Error Codes
Rate limit exceeded for this user. Tokens can only be refreshed 4 times per hour.Message:
Rate limit hit. Try again in {seconds}s.Invalid or malformed JWT token.Possible Messages:
Invalid session- JWT signature verification failedInvalid session payload- JWT payload missing required fields or incorrect formatFailed to fetch Roblox user profile- User ID in JWT is invalid
Failed to retrieve updated user information from Roblox API.Possible Messages:
Failed to fetch Roblox user headshotRoblox user headshot not available
Example Usage
Proactive Refresh Pattern
Use Cases
- Refreshing expired JWTs without requiring re-authentication
- Proactively refreshing tokens before they expire
- Updating user profile information (username, display name, avatar) from Roblox
- Maintaining long-lived authenticated sessions
Implementation Notes
- The JWT expiration is ignored during verification (using
ignoreExpiration: true) - Fresh user data is fetched from Roblox on every refresh
- This means username and display name changes on Roblox are reflected immediately
- Rate limiting is strict (4 per hour) to prevent abuse
- The new JWT is valid for 1 hour from the refresh time
- If a user’s Roblox account is deleted or invalid, the refresh will fail with
UNAUTHORIZED