# Recovery Access

**Endpoint**

`POST/v2/auth/recovery/request`

**Link**

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

### **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              |
| ----------- | -------- | ------------------------- | -------- | -------------------- |
| **`login`** | `string` | User's email or username. | Yes      | `"user@example.com"` |

**Example Request Body:**

json

```
{
  "login": "user@example.com"
}
```

***

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

Returns a temporary token to be used in the recovery confirmation step.

#### **Response Fields**

| Field       | Type     | Description                                                  | Example       |
| ----------- | -------- | ------------------------------------------------------------ | ------------- |
| **`token`** | `string` | **One-time token** for password reset. Valid for 15 minutes. | `"xyz789abc"` |

**Example Response:**

json

```
{
  "token": "xyz789abc"
}
```

***

### **Error Responses**

1. **User Not Found**:

   json

   ```
   {
     "error": "Account not found"
   }
   ```
2. **Too Many Requests**:

   json

   ```
   {
     "error": "Recovery attempts exceeded. Try again in 30 minutes"
   }
   ```

***

### **Next Steps**

1. **Check Email/SMS** for a 6-digit recovery code.
2. **Submit Code + Token** to `/v2/auth/recovery/confirm` with a new password.

***

### **Notes**

* **Token Validity**: 15 minutes (configurable).
* **Security**:
  * Codes are sent only to **verified** emails/phones.
  * Rate-limited to 3 attempts per hour.
* **UI Flow**:

  <figure><img src="/files/L7YFB08bpNyTY9uWNIN7" alt=""><figcaption></figcaption></figure>

### Examples

**Real request**&#x20;

```postman_json
Authorization:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjE2NCwiZXhwIjoxNzYxMTI5NzYxLCJrZXkiOiI1Y2ZiOGZjN2RmYjk4ZjVkYmIyZTgwNTVkZWFhN2U2Zjk4MzEyYmE3Iiwib3RwX3ZlcmlmaWVkIjpmYWxzZX0.atnfresV4v9XT9f_ze3ShmVs337TWt087Ze0MNuiiWk
{
  "login": "test@delos.financial"
}
```

**Real response**&#x20;

200 OK

```postman_json
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjE2NCwiZXhwIjoxNzYxMTMwMjY4LCJvdHBfdmVyaWZpZWQiOmZhbHNlfQ.JRS7E-q__bQU8o5pM1NMIgxN4KRf5jO2LpJX2_E_3F4"
}
```


---

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