palbaseDocs

Palbase Auth API · API

POST/auth/password/set

Add a first password to the signed-in account

Gives an account that has no password (social, passkey or phone sign-in) its first one. The user must have signed in within the last 5 minutes (403 reauthentication_required otherwise). An account that already has a password gets 409 password_already_set and should use POST /auth/password/change. The password is checked against the project's policy and known breaches; 503 means a check or the server's hashing capacity is momentarily unavailable and the same request can be retried (see Retry-After). A guest gets 409 anonymous_user: it takes a password with an address, by POST /auth/anonymous/convert. An account whose email address is not confirmed is refused (403 email_unconfirmed): no sign-in method is added to it until its address is confirmed, as its owner, proving the address, takes the account as it was opened.

Called by a signed-in user of your app, with their token and the publishable key.

Request body

new_passwordstring · requiredThe password to set; checked against the project's password policy and known breaches.
curl
curl -X POST "https://<your-ref>.palbase.studio/auth/password/set" \
  -H "apikey: $PALBASE_PUBLISHABLE_KEY" \
  -H "authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "content-type: application/json" \
  -d '{"new_password":"string"}'

Responses

200Password set

400Validation failed or required field missing

401Missing, invalid, or expired credentials

403Authenticated but not permitted (banned, hook denial, role mismatch)

409Conflict with current resource state (duplicate, race)

503Downstream dependency unavailable (typically HIBP / breach service)

defaultAn error: the envelope names it (`error`) and explains it (`error_description`).

Operation SetPassword of auth's contract.