/Docs
Search docs or ask a question⌘K
DocsAgent
Changelog
API Reference Refresh Session

Refresh Session

Exchange a refresh token for a new access token and refresh token.

POST/v1/auth/refreshTry it

Trade the refresh token from Log In for a new pair. Access tokens last an hour; refresh tokens last 30 days and can be used once — each refresh returns a new refresh token and retires the old one.

Note

No valid access token is needed — send the expired one in Authorization if you have it, or nothing. The refresh token is the credential. Tokens issued by stx login are never refreshed here. Any plan.

Request Body

NameDescription
refreshToken:stringbodyRequired
The refresh token from your last sign-in or refresh, at least 10 characters.

Response

NameDescription
data.accessToken:string
A new session JWT. Send it as Authorization: Bearer ….
data.refreshToken:string
A new refresh token. Store it in place of the old one, which no longer works.
data.expiresIn:integer
Seconds until the access token expires — 3600.

The session keeps its identity across refreshes, so it stays the same entry in List Sessions.

Errors

StatusCodeWhen
400validation_errorrefreshToken is missing or shorter than 10 characters
401unauthorizedThe refresh token is unknown, expired, already used, belongs to a deleted account, or its session was signed out
Warning

Reusing a refresh token that was already exchanged signs that whole session out, because it suggests the token was copied. Sign in again with Log In.

Was this page helpful? Yes No
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl -X POST https://api.syntext.dev/v1/auth/refresh \
-H "Content-Type: application/json" \
-d '{ "refreshToken": "'"$SYNTEXT_REFRESH_TOKEN"'" }'
Responseapplication/json
200OK
{
"data": {
"accessToken": "eyJhbGciOiJIUzI1NiIs…",
"refreshToken": "c3f1…",
"expiresIn": 3600
}
}
Product
Resources
Company
© 2026 SyntextBuilt with Syntext