# Refresh a token

```
POST 
/jwt/refresh
```

Access tokens have a short lifespan of 5 minutes as they are irrevocable. Conversely, refresh tokens last for 30 days and can be revoked using the [logout endpoint](/core-api/reference/2025-04-03/user/jwt-logout.md).

Therefore, the user's front-end should invoke this endpoint to obtain a new set of session tokens (both access and refresh) when the access token expires.

It's advisable to treat a token as expired under these conditions:

• An HTTP 401 Unauthorized error is received when using the token.

• The token's expiration date (`exp` field in the JWT) is approaching within a few seconds. Avoid relying on any other JWT fields apart from `exp` as they are subject to change and are not part of the API contract.

Note that this endpoint does not require authentication, so omit any authentication headers and only include your `refresh_token` in the request body.

## Request[​](#request "Direct link to request")

## Responses[​](#responses "Direct link to Responses")

* 200

Tokens.

## Operation spec

```json
{
  "method": "post",
  "path": "/jwt/refresh",
  "operationId": "jwt-refresh",
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "refresh_token": {
              "type": "string"
            }
          },
          "required": [
            "refresh_token"
          ]
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Tokens.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "description": "The tokens for an authenticated session.",
            "properties": {
              "access_token": {
                "description": "A (typically) short-lived JWT token used to access authenticated resources, e.g. the Nabla User API.",
                "type": "string",
                "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoiYWNjZXNzIiwic3ViIjoiMTIzNDU2Nzg5MCIsIm5hbWUiOiJKb2huIERvZSIsImlhdCI6MTUxNjIzOTAyMn0.v5qdy8w9Ygs5fdic9a1LuX76PUdx3omYd5GlDTAF3Ug",
                "title": "jwt_token"
              },
              "refresh_token": {
                "description": "A (typically) long-lived JWT token allowing you to \"refresh\" your access to resources (i.e. extend your session,  returning a fresh access token and a new refresh token with a later expiration).",
                "type": "string",
                "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoiYWNjZXNzIiwic3ViIjoiMTIzNDU2Nzg5MCIsIm5hbWUiOiJKb2huIERvZSIsImlhdCI6MTUxNjIzOTAyMn0.v5qdy8w9Ygs5fdic9a1LuX76PUdx3omYd5GlDTAF3Ug",
                "title": "jwt_token"
              }
            },
            "required": [
              "access_token",
              "refresh_token"
            ],
            "title": "session_tokens"
          }
        }
      }
    }
  }
}
```
