Aller au contenu

Change password

POST
/password/change
curl --request POST \
--url https://auth.timetonic.com/api/password/change \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "current_password": "example", "password": "example", "password_confirmation": "example" }'

Change password for authenticated user. Accepts a Bearer token OR a portal session cookie (OidcBearerOrSession middleware). Also requires the verified (email verification) middleware — returns 403 if the user’s email is not verified.

Media typeapplication/json
object
current_password
required
string format: password
password
required
string format: password
>= 8 characters
password_confirmation
required
string format: password
Examplegenerated
{
"current_password": "example",
"password": "example",
"password_confirmation": "example"
}

Password changed successfully

Media typeapplication/json
object
success
boolean
message
string
Example
{
"success": true
}

Authentication required or failed

Media typeapplication/json
object
success
boolean
error
string
message
string
Example
{
"success": false,
"error": "unauthorized",
"message": "Authentication required"
}

Email not verified (verified middleware)

Validation error

Media typeapplication/json
object
success
boolean
error
string
message
string
errors
object
key
additional properties
Array<string>
Example
{
"success": false,
"error": "validation_error",
"message": "The given data was invalid",
"errors": {
"email": [
"The email field is required."
]
}
}