User change password
PUT
https://app.sulus.ai/api/user/password
Change the authenticated user password
Authentication
Send a bearer token created on your dashboard's Developer page:
Authorization: Bearer <YOUR_API_KEY>
Request body
current_password
string
Required
Existing password (checked with Hash::check).
Validation:
required|stringnew_password
string
Required
New password; must match confirmation.
Validation:
required|string|min:8|confirmedStored in
users.passwordnew_password_confirmation
string
Required
Must match new_password.
Validation:
required|stringErrors
| Status | Meaning | Body |
|---|---|---|
401 |
Missing or invalid bearer token | |
400 |
Current password mismatch | {"success":false,"message":"Current password is incorrect"} |
422 |
Validation failed | {"message":"The given data was invalid.","errors":{"new_password":["The new password field must be at least 8 characters."]}} |
Notes
- Success body has no data key.
- Wrong current password returns 400 (not 422) with the exact message Current password is incorrect.
curl --request PUT \
--url https://app.sulus.ai/api/user/password \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"current_password": "old-secret-pass",
"new_password": "new-secret-pass",
"new_password_confirmation": "new-secret-pass"
}'
import requests
url = "https://app.sulus.ai/api/user/password"
headers = {"Authorization": "Bearer <YOUR_API_KEY>"}
payload = {
"current_password": "old-secret-pass",
"new_password": "new-secret-pass",
"new_password_confirmation": "new-secret-pass"
}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
url := "https://app.sulus.ai/api/user/password"
payload := strings.NewReader(`{
"current_password": "old-secret-pass",
"new_password": "new-secret-pass",
"new_password_confirmation": "new-secret-pass"
}`)
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <YOUR_API_KEY>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
Response
200
{
"success": true,
"message": "Password changed successfully"
}
Response — PUT
/user/password
200
{
"success": true,
"message": "Password changed successfully"
}