POST/api/auth/refresh

Exchanges a valid refresh token for a new pair of access token and refresh token.

Send the most recently received `refreshToken` in the JSON body. The response contains a new `token` and a new `refreshToken`. Each refresh token can be used only once and is valid for seven days by default; store the new token after each call and discard the old one. A missing, invalid, expired or already used refresh token results in 400 `VALIDATION_ERROR`. The user then has to sign in again via `POST /api/auth/login`. Because a refresh token is consumed when used, a client should avoid parallel renewals.

Overview

Call: POST /api/auth/refresh. This endpoint belongs to the “Authentication” group of the Zentor App API. It is publicly accessible and requires no authentication. The call is not idempotent: every successful call triggers the action again. Required parameters: refreshToken (body). Documented error cases: 400 VALIDATION_ERROR. The example response below shows the structure of a successful JSON response.

Auth & Security

No authentication required

Idempotent: No

Parameters

refreshToken(body, string, required)— Most recently issued refresh token

Example Request

{"refreshToken":"<refresh token from /login>"}

Example Response

{"ok":true,"token":"<new JWT>","refreshToken":"<new refresh token>"}

Error Codes

400 VALIDATION_ERROR — The refresh token is missing, invalid, expired or has already been used.

Verified behaviour

A valid refresh token returns a new token pair; an invalid token returns 400 `VALIDATION_ERROR`.

Authentication

Related articles

← Authentication