API Reference
Change own password
Requires current password for verification.
PUT /api/users/me/password
Requires current password for verification.
Operation ID: changeOwnPassword
Authentication
Option 1
- BearerAuth (
http bearer) API key token. Create via POST /api/api-keys. Format:envoy_<hex>
Option 2
- CookieAuth (
apiKey) Session cookie set after login + TOTP verification
Request body
The request body is required.
application/json
- Type:
object - Properties:
current_password(string,required)new_password(string,required)
Success responses
200
Password changed
Content type: application/json
- Type:
object - Properties:
success(boolean)
Error responses
400
Validation error
Content type: application/json
- Reference:
Error- Type:
object - Properties:
error(string)- Example:
NOT_FOUND
- Example:
message(string)- Example:
Resource not found
- Example:
- Type:
Example:
{
"error": "VALIDATION_ERROR",
"message": "Invalid input"
}401
Current password incorrect
429
Too many requests
Content type: application/json
- Reference:
Error- Type:
object - Properties:
error(string)- Example:
NOT_FOUND
- Example:
message(string)- Example:
Resource not found
- Example:
- Type:
Example:
{
"error": "RATE_LIMITED",
"message": "Too many failed TOTP attempts. Try again later."
}Examples
cURL
curl --request PUT \
--url 'https://your-envoy.example.com/api/users/me/password' \
--header 'Authorization: Bearer $API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"current_password": "string",
"new_password": "string"
}'JavaScript (fetch)
const response = await fetch('https://your-envoy.example.com/api/users/me/password', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"current_password": "string",
"new_password": "string"
}),
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = response.status === 204 ? null : await response.json();
console.log(data);