Self-Hosted APIs
Change your password
Change the password of the signed-in user on self-hosted Databrain.
POST
The password changes for the user of the access token. Any signed-in user can change their own password.
curl --request POST https://databrain-api.example.com/api/v2/service-token/reset-password \ --header "Authorization: Bearer $ADMIN_ACCESS_TOKEN" \ --header "Content-Type: application/json" \ --data '{ "currentPassword": "<current password>", "password": "<new password>" }'Before you start
- Self-hosted only.
- You have an access token from Create an admin JWT.
AdminJwtheader
AuthorizationBearer <JWT>Self-hosted only: the admin JWT from Create admin JWT.
Body
The current password.
The new password: at least 8 characters, with an upper-case letter, a lower-case letter, a number and a special character, and no spaces.
Response
{ "data": { "success": true } }Sessions are not signed out. Access tokens you already have keep working until they expire.
Errors
| Status | error.code | Why |
|---|---|---|
| 400 | RESET_PASSWORD_ERROR | The new password is too weak, a field is missing, or The current password is not correct! |
| 400 | LICENSE_EXPIRED | The licence key expired |
| 401 | UNAUTHORIZED | No access token was sent |
| 500 | SELFHOSTED_APP_ERROR | You called it on Databrain cloud |
| 500 | INTERNAL_SERVER_ERROR | The password was not changed |
curl -X POST 'https://databrain-api.example.com/api/v2/service-token/reset-password' \ -H 'Content-Type: application/json' \ -d '{ "currentPassword": "<current password>", "password": "<new password>"}'Example Response
{ "data": { "success": true }}