Skip to main content
POST
/
connect
/
refresh
curl -X POST https://api.useknot.xyz/connect/refresh \
  -H "Authorization: Bearer <token>"
{
  "status": true,
  "data": {
    "sessionToken": "eyJhbGciOiJIUzI1NiIs...",
    "solanaAddress": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
    "email": "agent@example.com"
  }
}
Use this endpoint to obtain a fresh JWT token without re-authenticating via OTP. The current token must still be valid. Call this before your token expires to avoid service interruptions.
Requires authentication via Bearer token.
Implement proactive token refresh in your agent before the expiration timestamp returned by validate token. Handle 401 errors by re-authenticating via the full OTP flow.

Response

status
boolean
true when the refresh succeeds.
data
object

Errors

StatusDescription
401Token is missing, invalid, or already expired
429Rate limit exceeded
curl -X POST https://api.useknot.xyz/connect/refresh \
  -H "Authorization: Bearer <token>"
{
  "status": true,
  "data": {
    "sessionToken": "eyJhbGciOiJIUzI1NiIs...",
    "solanaAddress": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
    "email": "agent@example.com"
  }
}