authChangePassword
PUT
/auth/password
const url = 'http://localhost:8300/auth/password';const options = { method: 'PUT', headers: { 'x-api-key': '<x-api-key>', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"current_password":"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 PUT \ --url http://localhost:8300/auth/password \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'x-api-key: <x-api-key>' \ --data '{ "current_password": "example", "new_password": "example" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
current_password
required
string
new_password
required
Common passwords are refused
string
Example generated
{ "current_password": "example", "new_password": "example"}Responses
Section titled “Responses”Changed; every session of the user is revoked
Bad access token, or wrong current_password (“current password is incorrect”); the 5th wrong one within 15 minutes also revokes the session
Media typeapplication/json
object
detail
required
string
Example generated
{ "detail": "example"}Invalid input: “invalid JSON body”, or the failed rule (“invalid email”, “name must be 1-200 characters”, “password must be at least 10 characters”, “password is too common”, “roles must not be empty”, …)
Media typeapplication/json
object
detail
required
string
Example generated
{ "detail": "example"}