palbaseDocs

Palbase Machines · API

POST/databases/{name}/password

Make a password new

Makes the owner's or the application's password new and answers the credentials with it, shown this once — the other login carries no password, [YOUR-PASSWORD] in its URLs; the new password works once the database has taken it, a few seconds after. The application's is set on its second login, and the machines given the database move to it with none of their connections refused; the old login keeps working until the next change — to shut out a leaked application password, make it new twice. A change waits for the one before it to reach the database (409 password_change_pending, with Retry-After), as does the first while the database starts. Emits database.password_changed.

Called by your server, with the project's secret key.

Path

namestring · requiredThe database's name: lowercase letters, digits and dashes, starting with a letter and not ending with a dash, 32 at most.

Request body

role"app" | "owner" · requiredowner: the database's owner; app: the application's login, the one the machines given the database are started with.
curl
curl -X POST "https://<your-ref>.palbase.studio/databases/<name>/password" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"role":"app"}'

Responses

200How to connect, with the new password

400Validation failed or a required field is missing

401Missing or invalid API key

403Not the project's secret key; or the request requires elevated owner authentication (`owner_only`, `insufficient_user_authentication`).

404The project has no database of this name

409The project already has a database of this name (or one being purged), the environment as many databases as it may, or no room left for this one; a password change is still on its way to the database; or a machine is given the database; or the database is moving to another size, cannot start (a change of its size waits for a restore that brings it back), holds more than the one asked, or would have too few connections for the copies of the machines given it; or, to the console, the database is being brought back to a moment, cannot start, or has run its awake hours for the month

429Over the project's request limit, or its machine time for this period is used up

503Temporarily unavailable; retrying is safe after Retry-After

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

Operation ChangeDatabasePassword of machines's contract.