Allow the user to change his password. Requires current password for verification and password confirmation to ensure accuracy.
POST
/auth/change-password
curl
curl -X POST "http://api.example.com/auth/change-password" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"old_password": "",
"password": "",
"password_2": ""
}'
import requests
url = "http://api.example.com/auth/change-password"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json"
}
params = {}
payload = {
"old_password": "",
"password": "",
"password_2": ""
}
response = requests.post(
url,
headers=headers,
params=params,
json=payload
)
response.raise_for_status()
if response.content:
print(response.json())
curl \
--request POST 'http://api.example.com/auth/change-password' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"old_password":"string","password":"string","password_2":"string"}'
Request examples
{
"old_password": "string",
"password": "string",
"password_2": "string"
}