# Refresh Access Token

**Endpoint**

`GET/v2/auth/refresh/{token}`

**Link**

{% embed url="<https://stagep.tst-apidmndelss.com/openapi/v2.html#/operations/Auth_RefreshToken>" %}

### **Request**

#### **Path Parameters**

| Parameter   | Type     | Description                                    | Required | Example       |
| ----------- | -------- | ---------------------------------------------- | -------- | ------------- |
| **`token`** | `string` | **Valid refresh token** (from login/recovery). | Yes      | `"xyz789abc"` |

#### **Headers**

| Key      | Value              | Required |
| -------- | ------------------ | -------- |
| `Accept` | `application/json` | Yes      |

***

### **Response (200 OK)**

Returns new authentication tokens with updated expiration times.

#### **Response Fields**

| Field              | Type      | Description                           | Example                       |
| ------------------ | --------- | ------------------------------------- | ----------------------------- |
| **`accessToken`**  | `string`  | **New JWT** for API authorization.    | `"eyJhbGci...xyz"`            |
| **`refreshToken`** | `string`  | **New refresh token**.                | `"eyJhbGci...abc"`            |
| **`guid`**         | `string`  | User identifier.                      | `"D69Ijtr-sTPF-2FhmobKMEExA"` |
| **`accessTtl`**    | `integer` | **Access token lifetime** (seconds).  | `3600` (1 hour)               |
| **`refreshTtl`**   | `integer` | **Refresh token lifetime** (seconds). | `2592000` (30 days)           |

**Example Response:**

json

```
{
  "accessToken": "eyJhbGci...xyz",
  "refreshToken": "eyJhbGci...abc",
  "guid": "D69Ijtr-sTPF-2FhmobKMEExA",
  "accessTtl": 3600,
  "refreshTtl": 2592000
}
```

### **Error Responses**

1. **Invalid/Expired Token**:

   json

   ```
   {
     "error": "Invalid or expired refresh token"
   }
   ```
2. **Revoked Token**:

   json

   ```
   {
     "error": "Token revoked. Please log in again"
   }
   ```

***

### **Notes**

* **When to Use**:
  * When the `accessToken` expires (check `accessTtl`).
  * After password changes or security events.
* **Security**:
  * Refresh tokens are **single-use** (a new one is issued each refresh).
  * Old refresh tokens are invalidated immediately.
* **Best Practices**:
  * Store refresh tokens securely (e.g., HTTP-only cookies).
  * Rotate tokens frequently.

### Examples

**Real request**&#x20;

```postman_json
token*
:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjE2NCwiZXhwIjoxNzYxMTMwODE1LCJrZXkiOiI1Y2ZiOGZjN2RmYjk4ZjVkYmIyZTgwNTVkZWFhN2U2Zjk4MzEyYmE3Iiwib3RwX3ZlcmlmaWVkIjpmYWxzZX0.CGqmWYJt6aL_Uz52qiFpmySsIGgJ4LEQ1eLmbsaBJjY

```

**Real response**&#x20;

200 OK

```postman_json
{
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjE2NCwiZXhwIjoxNzYxMTMwMjQwLCJrZXkiOiI1Y2ZiOGZjN2RmYjk4ZjVkYmIyZTgwNTVkZWFhN2U2Zjk4MzEyYmE3Iiwib3RwX3ZlcmlmaWVkIjpmYWxzZX0.fOBE0z6FIYH42Ks3qRklHA_wxK7cPC0RojmCDGGcDRA",
  "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjE2NCwiZXhwIjoxNzYxMTMwODQwLCJrZXkiOiI1Y2ZiOGZjN2RmYjk4ZjVkYmIyZTgwNTVkZWFhN2U2Zjk4MzEyYmE3Iiwib3RwX3ZlcmlmaWVkIjpmYWxzZX0.qvNgNcWCmEtNqJDPx2M8Xp2bpuTRutN9zP3lvh9wcpw",
  "userId": "5ff73da8-224e-44de-a235-2d7a76c3144c",
  "accessTtl": 299,
  "refreshTtl": 899
}
```


---

# 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://docs.delos.financial/authentication/refresh-access-token.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.
