Skip to Main Content

Token Renewal

Extending or refreshing an access token without a full re-login. Not currently offered — see what to do instead below.

Not currently available

Not supported yet

There's no refresh-token or token-renewal endpoint in the Shoonya API — you cannot extend or silently refresh a susertoken before it expires. Once a session token expires or is invalidated, the only way to get a new one is to repeat the full login flow.

What to do instead

SituationWhat to do
Token has expired / API calls start returning auth errorsRe-run the full OAuth login flow (authorize → codeGenAcsTok checksum → new susertoken) to get a fresh token.
Automating login so you don't do this by hand dailyUse a scheduled headless login (e.g. Selenium-based) to fetch a new token on a timer or at market open, and store it wherever your app reads credentials from.
Long-running processes (bots, dashboards)Handle auth-error responses defensively — catch them, re-run the login flow, and retry the failed request rather than assuming the token stays valid indefinitely.

Token lifetime

Planning around this?

If you're building something that needs a session to stay alive unattended for long periods, plan for scheduled re-login rather than a renewal call — the login flow itself is quick to automate (see the Manual Login (OAuth) page and the checksum calculator on that page).