Skip to main content

Update Admin User

Update an existing admin user's password.

Endpoint

POST /admin/update

Authentication

HeaderValue
AuthorizationBearer <jwt_token>
Content-Typeapplication/json

Request Body

FieldTypeRequiredDescription
idstringID of the admin to update (cannot be changed)
usernamestringUsername of the admin to update (cannot be changed)
passwordstringNew password for the admin

Example Request

curl -X POST \
'http://localhost:9000/admin/update' \
-H 'Authorization: Bearer <jwt_token>' \
-H 'Content-Type: application/json' \
-d '{
"id": "67ffc3f5a2120e73468ce66c",
"username": "admin",
"password": "newpassword123"
}'

Response

Success Response (200 OK)

{
"message": "Admin updated successfully"
}

Response Fields

FieldTypeDescription
messagestringConfirmation message indicating successful admin update

Notes

  • Only admin users can update admin passwords
  • The id and username fields are used for identification and cannot be changed
  • Password changes take effect immediately
  • New passwords should follow security best practices
  • The admin will need to re-authenticate with the new password