Moonborn — API · auth
Change the current user password (HIBP + Argon2id rehash)
POST/v1/auth/change_passwordscope · Bearer (API key or session JWT)
Request body
| Field | Type | Description |
|---|---|---|
| currentPasswordreq | string | |
| newPasswordreq | string |
Responses
204Changed
422Validation / breach failure
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string |
Examples
cURL
curl -X POST https://api.moonborn.co/v1/auth/change_password \
-H "Authorization: Bearer $MOONBORN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"currentPassword": "<string>",
"newPassword": "<string>"
}'TypeScript
import Moonborn from '@moonborn/sdk';
const client = new Moonborn({ apiKey: process.env.MOONBORN_API_KEY });
const result = await client.auth.changePassword({
currentPassword: "<string>",
newPassword: "<string>",
});Python
import os
from moonborn import Moonborn
client = Moonborn(api_key=os.environ["MOONBORN_API_KEY"])
result = client.auth.change_password(
current_password="<string>",
new_password="<string>",
)