> For the complete documentation index, see [llms.txt](https://docs.delos.financial/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.delos.financial/authentication/recovery-confirm.md).

# Recovery Confirm

Finalizes password recovery by verifying a security code and token, then setting a new password. Returns new authentication tokens upon success.

**Endpoint**

`POST/v2/auth/recovery/confirm`

**Link**

{% embed url="<https://partner.sandbox.delos.financial/openapi/v2.html#/operations/Auth_RecoveryAccessConfirm>" %}

### **Request**

#### **Headers**

| Key             | Value              | Required |
| --------------- | ------------------ | -------- |
| `Authorization` | `<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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.delos.financial/authentication/recovery-confirm.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
