---
description: >-
  The "Refresh Auth Tokens" endpoint allows you to refresh authentication
  tokens, providing a seamless and secure experience for users. Follow the
  instructions below to integrate this functionality.
---

# Refresh Auth Tokens

## Overview

{% hint style="success" %}
### Endpoint

* **Method:** POST
* **URL:** `.../auth/refresh-tokens`
{% endhint %}

### Request Body

```json
{
  "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1ZWJhYzUzNDk1NGI1NDEzOTgwNmMxMTIiLCJpYXQiOjE1ODkyOTg0ODQsImV4cCI6MTU4OTMwMDI4NH0.m1U63blB0MLej_WfB7yC2FTMnCziif9X8yzwDEfJXAg"
}
```

* **`refreshToken`**: The refresh token obtained during the initial authentication.

### Responses

#### Success (Code 200)

```json
{
  "access": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "expires": "2020-05-12T16:18:04.793Z"
  },
  "refresh": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "expires": "2020-05-12T16:18:04.793Z"
  }
}
```

* **`access`**: New access token for authentication.
* **`expires`**: Expiry date and time for the new access token.
* **`refresh`**: New refresh token for obtaining the next access token.

#### Unauthorized (Code 401)

```json
{
  "code": 401,
  "message": "Please Authenticate"
}
```

* **Media Type**: application/json
* **Example Value**: An error response indicating unauthorized access.

**Internal Server Error (Code 500)**

```json
{
  "error": "Internal Server Error"
}
```

* **Media Type**: application/json
* **Example Value**: An error response indicating an internal server error.

### Usage

1. **Send a POST request** to the provided endpoint with the refresh token.
2. **Handle the response accordingly** based on success or unauthorized access.

**Note:** Ensure the refresh token (`refreshToken`) is valid and has not expired.
