<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[SmartAPI Token and WebSocket Session Lifecycle]]></title><description><![CDATA[<p dir="auto">Dear Angel One SmartAPI Support Team,</p>
<p dir="auto">I am integrating Angel One SmartAPI for a live market-data application using WebSocket 2.0.</p>
<p dir="auto">I have reviewed the SmartAPI documentation for Authentication, Generate Token, Logout, WebSocket 2.0, Exceptions, Instruments, Market Data and Rate Limits.</p>
<p dir="auto">Most of the integration flow is clear. However, I could not find definitive documentation for a few authentication and WebSocket lifecycle scenarios.</p>
<p dir="auto">Could you please clarify the following based on the current SmartAPI production behavior:</p>
<p dir="auto">Refresh Token Validity<br />
What is the exact validity/expiry period of the refresh token?<br />
Does it expire at the daily session boundary or have a different lifetime?<br />
Feed Token Validity<br />
What is the exact validity/expiry period of the feed token used for WebSocket 2.0?<br />
Does it expire together with the JWT or independently?<br />
Token Refresh / Rotation<br />
When generateTokens() is called using the refresh token, the response contains JWT, refresh token and feed token.</p>
<p dir="auto">Please confirm:</p>
<p dir="auto">Does the newly returned refresh token invalidate the previous refresh token?<br />
Does the newly returned feed token invalidate the previous feed token?<br />
Should the application always replace all three stored tokens with the newly returned values?<br />
Existing WebSocket After Token Refresh<br />
If generateTokens() returns a new feed token while a WebSocket 2.0 connection is already active:<br />
Can the existing WebSocket continue using the old authenticated session?<br />
Or must it be disconnected and reconnected using the new JWT/feed token?<br />
Token Expiry During Active WebSocket<br />
What happens if the JWT or feed token reaches its expiry/session boundary while the WebSocket is already connected?<br />
Is the connection immediately disconnected?<br />
Does it continue until network disconnection?<br />
Is an authentication/error message sent before closure?<br />
Logout / terminateSession<br />
When terminateSession(clientCode) is called, please confirm which credentials/resources are invalidated:<br />
JWT<br />
Refresh token<br />
Feed token<br />
Existing WebSocket connections<br />
Daily Authentication Expiry<br />
Current SmartAPI documentation indicates that the authentication/session token expires at 00:00 (midnight).</p>
<p dir="auto">Could you please confirm that 00:00 IST is the current production session/token expiry boundary and that this supersedes older SmartAPI guidance mentioning other session durations?</p>
<p dir="auto">Recovery After Expiry<br />
Please confirm the expected recovery action for:</p>
<p dir="auto">Expired JWT with a still-valid refresh token<br />
Expired refresh token<br />
Expired feed token<br />
Session expired (AB1010)<br />
WebSocket authentication failure (HTTP 401/403)<br />
Specifically, please indicate when generateTokens() should be used and when a complete login using Client Code + MPIN/PIN + TOTP is mandatory.</p>
<p dir="auto">This clarification will help us implement deterministic session renewal and WebSocket recovery without making assumptions about SmartAPI authentication behavior.</p>
<p dir="auto">If possible, please also share the latest official documentation/reference covering these lifecycle rules.</p>
]]></description><link>https://smartapi.angelone.in/smartapi/forum/topic/5638/smartapi-token-and-websocket-session-lifecycle</link><generator>RSS for Node</generator><lastBuildDate>Mon, 17 Aug 2026 02:49:49 GMT</lastBuildDate><atom:link href="https://smartapi.angelone.in/smartapi/forum/topic/5638.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 12 Aug 2026 06:24:02 GMT</pubDate><ttl>60</ttl></channel></rss>