# Profile


## Change Password

<small class="badge badge-darkred">requires authentication</small>

Use this end point to change password.

> Example request:

```bash
curl -X POST \
    "https://apiqa.bettorfantasy.com/change-password" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"current_password":"tempore","new_password":"iste"}'

```


> Example response (200):

```json
{
    "message": "Password changed successfully!"
}
```
> Example response (422, Validation for required):

```json
{
    "message": "Validation Failed!",
    "errors": {
        "current_password": [
            "The current password field is required."
        ],
        "new_password": [
            "The new password field is required."
        ]
    }
}
```
> Example response (422, Current password invalid):

```json
{
    "message": "Validation Failed!",
    "errors": {
        "current_password": [
            "Current password is invalid!"
        ]
    }
}
```
> Example response (422, Current password and new password is same):

```json
{
    "message": "Validation Failed!",
    "errors": {
        "new_password": [
            "The new password and current password must be different."
        ]
    }
}
```
<div id="execution-results-POSTchange-password" hidden>
    <blockquote>Received response<span id="execution-response-status-POSTchange-password"></span>:</blockquote>
    <pre class="json"><code id="execution-response-content-POSTchange-password"></code></pre>
</div>
<div id="execution-error-POSTchange-password" hidden>
    <blockquote>Request failed with error:</blockquote>
    <pre><code id="execution-error-message-POSTchange-password"></code></pre>
</div>
<form id="form-POSTchange-password" data-method="POST" data-path="change-password" data-authed="1" data-hasfiles="0" data-headers='{"Authorization":"Bearer {YOUR_AUTH_KEY}","Content-Type":"application\/json","Accept":"application\/json"}' onsubmit="event.preventDefault(); executeTryOut('POSTchange-password', this);">
<h3>
    Request&nbsp;&nbsp;&nbsp;
        <button type="button" style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-tryout-POSTchange-password" onclick="tryItOut('POSTchange-password');">Try it out ⚡</button>
    <button type="button" style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-canceltryout-POSTchange-password" onclick="cancelTryOut('POSTchange-password');" hidden>Cancel</button>&nbsp;&nbsp;
    <button type="submit" style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-executetryout-POSTchange-password" hidden>Send Request 💥</button>
    </h3>
<p>
<small class="badge badge-black">POST</small>
 <b><code>change-password</code></b>
</p>
<p>
<label id="auth-POSTchange-password" hidden>Authorization header: <b><code>Bearer </code></b><input type="text" name="Authorization" data-prefix="Bearer " data-endpoint="POSTchange-password" data-component="header"></label>
</p>
<h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
<p>
<b><code>current_password</code></b>&nbsp;&nbsp;<small>string</small>  &nbsp;
<input type="password" name="current_password" data-endpoint="POSTchange-password" data-component="body" required  hidden>
<br>
Current password of the user. Ex: Abc@123456
</p>
<p>
<b><code>new_password</code></b>&nbsp;&nbsp;<small>string</small>  &nbsp;
<input type="password" name="new_password" data-endpoint="POSTchange-password" data-component="body" required  hidden>
<br>
New Password of the user. Min:8, Max: 16 & must be of 8-16 length and include at least one of each: Uppercase, Lowercase, Number, Special character from (^_.%,!@#\$&*~). Ex: Ems016@2020
</p>

</form>



