---
title: "Refresh access token"
method: POST
path: "/userAccount/refresh/token"
tags: ["User Account"]
---

# Refresh access token

`POST /userAccount/refresh/token`

Get a new access token using a valid refresh token.

**Usage:**

- Pass the refresh token as a Bearer token in the Authorization header
- Returns a new access token and basic user information

**Token Lifetimes:**

- Access token: 24 hours (configurable via `ACCESS_TOKEN_EXPIRY` environment variable)
- Refresh token: 30 days (configurable via `REFRESH_TOKEN_EXPIRY` environment variable)

**Best Practices:**

- Call this endpoint before the access token expires
- Store the new access token and continue using it for authenticated requests
- If refresh fails with 401, redirect user to login flow

## Response `200`

Token refreshed successfully

- RefreshTokenResponse — Response with new access token
  - `user` RefreshTokenUser, required — User record returned with a refreshed access token
    - `_id` string, required — User ID
    - `orgId` string, required — Organization ID
    - `email` string, email, required
    - `fullName` string, required
    - `firstName` string
    - `lastName` string
    - `designation` string
    - `hasLoggedIn` boolean, required
    - `isDeleted` boolean, required
    - `slug` string, required
    - `createdAt` string, required
    - `updatedAt` string, required
    - `__v` integer, required
  - `accessToken` string, required — New JWT access token (24 hour default expiry, configurable via ACCESS_TOKEN_EXPIRY)

## Other responses

- `400` — Disabled user account
- `401` — Invalid or expired refresh token - user must re-authenticate
- `404` — User not found (account may have been deleted), User credentials not found, or Organization not found
- `500` — Internal server error

---

[API](https://skmtc.net/pipeshub-ai/apis/pipeshub-api.md) · [All operations](https://skmtc.net/pipeshub-ai/apis/pipeshub-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pipeshub-ai/pipeshub-api/versions/abd27cfefc73/schema)
