Skip to main content

Update Admin User

Update an existing admin's passswords.

Endpoint:

POST /admin/update

Headers:

Authorization: Bearer JWT token.

Body:

id: ID of the admin to update (can't be updated).

username: Username of the admin to update (can't be updated).

password: New password for the admin.

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:

{
"message": "Admin updated successfully"
}