# Recovery Confirm

**Endpoint**

`POST/v2/auth/recovery/confirm`

**Link**

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

### **Request**

#### **Headers**

| Key             | Value              | Required |
| --------------- | ------------------ | -------- |
| `Authorization` | `Bearer <JWT>`     | Yes      |
| `Content-Type`  | `application/json` | Yes      |
| `Accept`        | `application/json` | Yes      |

#### **Request Body (JSON)**

| Field                | Type     | Description                         | Required | Example               |
| -------------------- | -------- | ----------------------------------- | -------- | --------------------- |
| **`code`**           | `string` | **Recovery code** (from email/SMS). | Yes      | `"A1B2C3"`            |
| **`token`**          | `string` | **One-time recovery token**.        | Yes      | `"xyz789abc"`         |
| **`password`**       | `string` | **New password**.                   | Yes      | `"NewSecurePass123!"` |
| **`repeatPassword`** | `string` | **Must match `password` exactly**.  | Yes      | `"NewSecurePass123!"` |

**Example Request Body:**

json

```
{
  "code": "A1B2C3",
  "token": "xyz789abc",
  "password": "NewSecurePass123!",
  "repeatPassword": "NewSecurePass123!"
}
```

***

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

Returns new authentication tokens for immediate login.

#### **Response Fields**

| Field              | Type     | Description                               | Example            |
| ------------------ | -------- | ----------------------------------------- | ------------------ |
| **`accessToken`**  | `string` | **JWT for API access**.                   | `"eyJhbGci...xyz"` |
| **`refreshToken`** | `string` | **Long-lived token for renewing access**. | `"eyJhbGci...abc"` |
| **`guid`**         | `string` | **User identifier**.                      | `"usr_5f3d8e2a"`   |

**Example Response:**

json

```
{
  "accessToken": "eyJhbGci...xyz",
  "refreshToken": "eyJhbGci...abc",
  "guid": "usr_5f3d8e2a"
}
```

### **Error Responses**

1. **Invalid Code/Token**:

   json

   ```
   {
     "error": "Invalid recovery code or token"
   }
   ```
2. **Password Mismatch**:

   json

   ```
   {
     "error": "Passwords do not match"
   }
   ```
3. **Weak Password**:

   json

   ```
   {
     "error": "Password must contain at least 8 characters, including uppercase and numbers"
   }
   ```

***

### **Notes**

* **Token Validity**:
  * Recovery tokens typically expire after **15 minutes**.
* **Password Rules**:
  * Minimum 8 characters.
  * Requires uppercase, lowercase, and numbers/symbols.
* **Security**:
  * Old passwords are invalidated immediately.
  * Active sessions using the old password are terminated.

### Examples

Real request&#x20;

Real response&#x20;


---

# 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/recovery-confirm.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.
