How to Change Qualys User Password Using API
To change a Qualys user password using the API, send a POST request to /api/2.0/fo/user/change_password/index.php with the required headers, authenticate using your username and password, and include the new password in the JSON request body using the newPassword key.
API Endpoint
Use the following endpoint:
{URL}/api/2.0/fo/user/change_password/index.php
Replace {URL} with the appropriate Qualys platform URL. Identify your platform URL using the Qualys Platform Identification resource.
Required Headers
Include the following headers in the API request:
X-Requested-With: Curl
Content-Type: application/json
Authentication
Authenticate the request using your username and password with the -u option in the curl command.
Request Body
Send the new password in JSON format using the newPassword key.
Example 1:
{"newPassword": "New_password_value"}
Complete Curl CommandComplete Curl Command
API Request
curl -u "username:password" -H "X-Requested-With: Curl" -H "Content-Type: application/json" -X POST "{URL}/api/2.0/fo/user/change_password/index.php" -d "{\"newPassword\": \"New_password_value\"}"
Example 2:
API Request
curl -u "test_ml21:password" -H "X-Requested-With: Curl" -H "Content-Type: application/json" -X POST "https://qualysapi.qualys.com/api/2.0/fo/user/change_password/index.php" -d "{\"newPassword\": \"Qualys@123\"}"
In this example:
- Username: test_ml21
- Old Password: password
- New Password: Qualys@123
- API URL: https://qualysapi.qualys.com
• Replace {URL} with the correct Qualys platform URL for your subscription.
• Ensure the request body uses valid JSON formatting.
• Include both required headers in every request.
Related Topics