---
title: "Refresh a session"
method: POST
path: "/sessions/{session_id}/refresh"
tags: ["Sessions"]
---

# Refresh a session

`POST /sessions/{session_id}/refresh`

Refreshes a session by creating a new session token. A 401 is returned when there
are validation errors, which signals the SDKs to fall back to the handshake flow.

## Path parameters

- `session_id` string, required

## Request body

- object
  - `expired_token` string, required — The JWT that is sent via the `__session` cookie from your frontend. Note: this JWT must be associated with the supplied session ID.
  - `refresh_token` string, required — The refresh token from the `__refresh` cookie set via FAPI's handshake flow.
  - `request_origin` string, required — The origin of the request.
  - `request_headers` object, nullable — The headers of the request.
  - `format` 'token' | 'cookie', nullable — The format of the response.
  - `request_originating_ip` string, nullable — The IP address of the request.

## Response `200`

Success

- union
  - Token
    - `object` 'token', required — String representing the object's type. Objects of the same type share the same value.
    - `jwt` string, required — String representing the encoded JSON Web Token (JWT) value.
  - Cookies
    - `object` 'cookies', required — String representing the object's type. Objects of the same type share the same value.
    - `cookies` string[], required — Array of cookie directives.

## Other responses

- `400` — Request was not successful
- `401` — Authentication invalid

---

[API](https://skmtc.net/clerk/apis/clerk-backend-api.md) · [All operations](https://skmtc.net/clerk/apis/clerk-backend-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/clerk/clerk-backend-api/revisions/75df3a43fcb2/schema)
