---
title: "Refresh a session token"
method: POST
path: "/auth/refresh"
tags: ["Authentication"]
---

# Refresh a session token

`POST /auth/refresh`

## Request

- Base URL: `https://saturnsql.com/api`
- URL: `https://saturnsql.com/api/auth/refresh`
- Auth: none required

Exchanges a valid refresh token for a fresh 24h session token. Optionally switch the active company with `selectedCompanyId`.

## Request body

- object
  - `refreshToken` string, required
  - `selectedCompanyId` string

## Response `200`

New session token

- object
  - `token` string
  - `refreshToken` string
  - `user` object

## Other responses

- `400`: Validation failed
- `401`: Bad or missing credentials

---

[API](https://skmtc.dev/saturnsql/apis/saturnsql-api.md) · [All operations](https://skmtc.dev/saturnsql/apis/saturnsql-api/llms.txt) · [OpenAPI document](https://skmtc.dev/saturnsql/apis/saturnsql-api/revisions/90a3e54ad115?raw)
