POST /auth/refresh
Use this endpoint to obtain a new access token when the old one expires. You must provide a valid refresh token.
This endpoint implements token rotation for enhanced security. Each time you refresh, you receive a new refresh token and the old one is automatically revoked.
Request Body
The refresh token that was provided during login or a previous refresh.
Response
Indicates if the refresh was successful.
Human-readable status message.
An object containing the new authentication tokens. A new access token for authenticating subsequent requests. Expires in 15 minutes.
A new refresh token (the old one is now invalidated). Expires in 7 days.
Token expiry time in seconds (900 = 15 minutes).
The token type (always “Bearer”).
curl -X POST https://api.llmgenerator.com/api/v1/auth/refresh \
-H "Content-Type: application/json" \
-d '{
"refreshToken": "YOUR_REFRESH_TOKEN"
}'
Success (200)
Invalid Token (401)
Revoked Token (401)
{
"success" : true ,
"message" : "Token refreshed successfully" ,
"tokens" : {
"accessToken" : "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." ,
"refreshToken" : "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." ,
"expiresIn" : 900 ,
"tokenType" : "Bearer"
}
}