Change password (authenticated)
/v1/auth/change-passwordRequest body
current_password *stringCurrent password
new_password *stringNew password (8-128 chars, must contain uppercase, lowercase, digit, and special character)
Code samples
curl -X POST "https://api.canopy.dev/v1/auth/change-password" \
-H "Content-Type: application/json" \
-d '{
"current_password": "string",
"new_password": "string"
}'const response = await fetch("https://api.canopy.dev/v1/auth/change-password", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"current_password": "string",
"new_password": "string"
}),
});
const data = await response.json();import requests
response = requests.post(
"https://api.canopy.dev/v1/auth/change-password",
headers={
"Content-Type": "application/json"
},
json={
"current_password": "string",
"new_password": "string",
},
)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
payload := map[string]interface{}{
"current_password": "string",
"new_password": "string",
}
body, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", "https://api.canopy.dev/v1/auth/change-password", bytes.NewBuffer(body))
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
}Responses
200 Password changed
{
"message": "string"
}application/json
message *string
401 Invalid or expired token
403 This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)