# 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xerial.gitbook.io/xerial-doc/~/changes/vTuPuavSUBXr6g7sVzr6/xerial-apis/wallet-api/authentication/refresh-auth-tokens.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
