# Esqueci Minha Senha (Email)

## Resetar Senha (Email)

<mark style="color:green;">`POST`</mark> `https://api.gestao.plus/user?q=forgot-password`

Com essa rota é possível desenvolver um fluxo de recuperação de senhas.

#### Query Parameters

| Name                                | Type   | Description                                                                 |
| ----------------------------------- | ------ | --------------------------------------------------------------------------- |
| q<mark style="color:red;">\*</mark> | string | Ação que deseja fazer sobre o usuário (Query). Neste caso "forgot-password" |

#### Headers

| Name                                           | Type   | Description        |
| ---------------------------------------------- | ------ | ------------------ |
| Content-Type<mark style="color:red;">\*</mark> | string | "application/json" |

#### Request Body

| Name                                       | Type   | Description                                   |
| ------------------------------------------ | ------ | --------------------------------------------- |
| document<mark style="color:red;">\*</mark> | string | O CPF do usuário                              |
| email<mark style="color:red;">\*</mark>    | string | O email da conta que deseja recuperar a senha |

{% tabs %}
{% tab title="202 " %}

```
{
    "pinPrefix": "PREFIXO DE PIN",
    "token": "TOKEN PARA RECUPERAÇÃO DE SENHA",
    "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
    "title": "Forgot Password",
    "status": 202,
    "detail": "Email sent"
}
```

{% endtab %}

{% tab title="500 " %}

```
{
    "trace": [
        {
            "file": "/var/www/module/IUPBase/src/EventListener/AbstractListener.php",
            "line": 420,
            "function": "preCreate",
            "class": "IUPBase\\V1\\EventListenerController\\User",
            "type": "->",
            "args": [
                {
                    "email": "CÓDIGO DE EMAIL"
                }
            ]
        },
    ],
    "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
    "title": "Internal Server Error",
    "status": 500,
    "detail": "Call to a member function getId() on null"
}
```

{% endtab %}
{% endtabs %}
