Reset Password
POST
/api/auth/reset-password
const url = 'https://example.com/api/auth/reset-password';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"code":"example","new_password":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/auth/reset-password \ --header 'Content-Type: application/json' \ --data '{ "code": "example", "new_password": "example" }'Reset a user’s password using a single-use password reset code.
The code is stored only as a SHA-256 hash in Redis and is invalidated on first use via atomic GETDEL.
Request Body required
Section titled “Request Body required ” Media type application/json
ResetPasswordBody
object
code
required
Code
string
new_password
required
New Password
string
Example generated
{ "code": "example", "new_password": "example"}Responses
Section titled “ Responses ”Successful Response
Media type application/json
ResetPasswordResponse
{"reset": True} after a successful password reset.
object
reset
required
Reset
boolean
Example generated
{ "reset": true}Validation Error
Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}