---
title: "Refresh an authentication session"
description: "Exchanges a refresh token for a rotated bearer access token and refresh token in the same organization."
canonical: "https://www.cool.computer/docs/api-reference/authentication/refresh-an-authentication-session"
---
# Refresh an authentication session

> Exchanges a refresh token for a rotated bearer access token and refresh token in the same organization.

```http
POST https://api.cool.computer/api/auth/refresh
```

Exchanges a refresh token for a rotated bearer access token and refresh token in the same organization.

## Authorization

No credential is needed.

## Request body

Required.

- `application/json` (object)
  - `refresh_token` (string, at least 1 characters, required)
  - `organization_id` (string, at least 1 characters, required)

## Responses

- `200`: Bearer and refresh credentials for the account.
  - `application/json` (object)
    - `access_token` (string, required): A short-lived user access token. For repeated automation, create an API key with it (POST /api/api-keys) instead of refreshing it in a loop.
    - `expires_in` (integer, at least 0, required): Seconds until access_token expires, from its exp claim. Refresh it with POST /api/auth/refresh before then.
    - `refresh_token` (string, required)
    - `organization_id` (string, required)
    - `session_id` (string, required)
- `400`: Bad Request.
- `401`: Unauthorized.
- `413`: Payload Too Large.
- `429`: Too Many Requests. If the problem code is api_request_rate_exceeded, wait for Retry-After seconds; other problem codes describe a separate limit.
- `500`: Internal Server Error.
- `503`: Service Unavailable.
- `default`: A machine-readable API error with a stable code and recovery instruction.

An error is an `application/problem+json` document with a stable `code`; [API errors](/docs/api-reference/errors) says how to handle one.

## Example

```sh
curl -X POST "https://api.cool.computer/api/auth/refresh" \
  -H "content-type: application/json" \
  --data '{"refresh_token":"string","organization_id":"string"}'
```
