Change the password for the admin user identified by the current authentication token. Requires the current password and the new password. The new password should meet the same complexity rules as sign-up (see Create Admin Account).
Self-Hosted Only: This endpoint is available only on self-hosted Databrain instances.
Authentication Requirement: This endpoint requires an authenticated admin user. Use the Bearer token from Create Admin JWT.
Authentication
Use a valid admin JWT in the Authorization header. Obtain one via Create Admin JWT.
Bearer token for the admin whose password is being changed.Authorization: Bearer <access_token>
Must be application/json when sending a JSON body.Content-Type: application/json
Request Body
The admin’s current password.
The new password. Should meet the same requirements as sign-up: minimum 8 characters, at least one uppercase, one lowercase, one digit, one special character, no spaces.
Response
On success, the API returns 200 with a JSON object:
Wrapper object for the response payload.
true when the password was changed successfully.
On error, the API returns a JSON object with error.code and error.message and an appropriate HTTP status (400 or 500).
Examples
HTTP Status Code Summary
| Status Code | Description |
|---|
200 | OK – Password changed successfully; data.success is true |
400 | Bad Request – Wrong current password or validation error on new password |
500 | Internal Server Error – Server error or self-hosted-only error |
Possible Errors
| Code | Message | HTTP Status |
|---|
RESET_PASSWORD_ERROR | Error message from password change (e.g. “The current password is not correct!“) | 400 |
SELFHOSTED_APP_ERROR | This feature is only available for self-hosted instances | 500 |
INTERNAL_SERVER_ERROR | Internal server error or GraphQL error message | 500 |