PUT /auth/reset-password

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.

application/json

Body Required

  • email string(email) Required

    User email address

  • token string(JWT token) Required

    Password reset token

  • password string(password) Required

    New password

  • password2 string(password) Required

    New password confirmation

Responses

  • 200

    Password reset

  • 400

    Invalid password Wrong or expired token Inactive user

PUT /auth/reset-password
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"
}