Skip to main content
vschmitt_FTNT
Staff
Staff
February 21, 2025

Technical Tip: How to change local user's password using API

  • February 21, 2025
  • 0 replies
  • 1132 views
Description

 

This article describes the API endpoint to modify the password of local users. The method PUT on existing users will not work to modify the password field. The requester will have a response: HTTP status code 403.

 

In CLI debugging httpsd, the following traces are displayed:

 

[httpsd 9598 - 1739806162 error] _api_cmdb_v2_config[2323] -- Modification of the 'passwd' field of user.local is forbidden.
[httpsd 9598 - 1739806162 warning] api_return_http_result[1307] -- API error 403 raised

 

Scope

 

FortiGate, API, System user.

 

Solution

 

To modify the password, make a POST request:


POST /api/v2/monitor/user/local/change-password
{
"vdom": "root",
"username": "username",
"new_password": "mynewpassword"
}