Allow a user to change his password when he forgets it. It uses a token sent by email to the user to verify it is the user who requested the password reset.
PUT
/auth/reset-password
curl
curl -X PUT "http://api.example.com/auth/reset-password" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"email": "admin@example.com",
"token": "",
"password": "",
"password2": ""
}'
import requests
url = "http://api.example.com/auth/reset-password"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json"
}
params = {}
payload = {
"email": "admin@example.com",
"token": "",
"password": "",
"password2": ""
}
response = requests.put(
url,
headers=headers,
params=params,
json=payload
)
response.raise_for_status()
if response.content:
print(response.json())
curl \
--request PUT 'http://api.example.com/auth/reset-password' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"email":"admin@example.com","token":"string","password":"string","password2":"string"}'
Request examples
{
"email": "admin@example.com",
"token": "string",
"password": "string",
"password2": "string"
}