Skip to main content
Provides a new access token and expiration time without requiring the wallet to log in again.

Prerequisites

  • Valid JWT token (even if close to expiration)
  • Active authenticated session

Request

curl -X POST "https://api.g2cplatform.com/v2/auth/wallet/refresh" \
  -H "Authorization: Bearer your-current-jwt-token"

Response

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expiresAt": "2024-03-15T18:30:00Z",
  "wallet": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "username": "user123",
    "email": "[email protected]",
    "status": "active",
    "blockchainAddress": "0x1234567890abcdef...",
    "createdAt": "2024-01-15T10:30:00Z",
    "updatedAt": "2024-03-15T10:30:00Z"
  }
}

Response Fields

FieldTypeDescription
tokenstringNew JWT access token
expiresAtstringISO 8601 timestamp when the new token expires
walletobjectWallet information associated with the token

Error Responses

Status CodeDescription
401Unauthorized - invalid or missing JWT token
500Internal server error

Usage Notes

  • Use this endpoint to obtain a new JWT token before the current one expires
  • The new token will have an extended expiration time
  • The old token becomes invalid after successful refresh
  • Store the new token and expiration time for future API requests
  • This is more efficient than requiring the user to log in again