Skip to content

Change password routes

Check old password

Used to check the password before changing it

URL: /api/v1/user/myself/changePassword/checkOldPassword

Method: POST

Auth required: Yes

Data constraints

{
    "password": "[required]"
}

Data example

{
    "password": "123456789"
}

Success response

Condition: Password is correct.

Code: 200

Content example

{
    "msg": "Password correct"
}

Error response

Condition: Password is wrong.

Code: 400

Content example

{
    "msg": "Password incorrect",
    "error_code": "password_incorrect"
}

Change password

Used to change the password

URL: /api/v1/user/myself/changePassword/changePassword

Method: POST

Auth required: Yes

Data constraints

{
    "old_password": "[required]",
    "new_password": "[required]"
}

Data example

{
    "old_password": "123456789",
    "new_password": "123456798"
}

Success response

Condition: Password is correct.

Code: 200

Content example

{
    "msg": "Password changed"
}

Error response

Condition: Password is wrong.

Code: 400

Content example

{
    "msg": "Password incorrect",
    "error_code": "password_incorrect"
}

Last update: December 24, 2019 14:31:33