Skip to Content
HomeLink Hub
Authentication

Exchange a refresh token for a new access token

POST
/api/v1/auth/refresh-token

Access: Public, no token needed.

Returns a new access token for the session encoded in the refresh token. The refresh token is not rotated: keep using the same one until it expires or is replaced. It must equal the single refresh token stored on the account, so it stops working after a sign-in on any other device, POST /auth/signout with that token, POST /user/logout-all-devices, a password reset, or account deletion. The handler does not re-check isActive or email verification.

A refresh token that is expired or malformed is answered with 500, not 401; only a well-formed token that no longer matches the stored one gets 401.

Request Body

application/json
  1. body
refreshToken*string

The refresh token returned by a sign-in endpoint.

Response Body

New access token issued

application/json
  1. response
status*integer
success*boolean
message*string
data*
Example Request
curl -X POST 'http://localhost:4000/api/v1/auth/refresh-token' \  -H 'Content-Type: application/json' \  -d '{  "refreshToken": "eyJhbGciOiJIUzI1NiIs..."}'
Example Response
{  "status": 200,  "success": true,  "message": "Access token refreshed.",  "data": {    "accessToken": "eyJhbGciOiJIUzI1NiIs..."  }}