Update user password
import requests
url = "https://{FUSION HOST}/api/users/{id}"
payload = {
"password": { "empty": True },
"passwordConfirm": { "empty": True }
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.patch("https://{FUSION HOST}/api/users/{id}")
.header("Content-Type", "application/json")
.body("{\n \"password\": {\n \"empty\": true\n },\n \"passwordConfirm\": {\n \"empty\": true\n }\n}")
.asString();const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({password: {empty: true}, passwordConfirm: {empty: true}})
};
fetch('https://{FUSION HOST}/api/users/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://{FUSION HOST}/api/users/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"password\": {\n \"empty\": true\n },\n \"passwordConfirm\": {\n \"empty\": true\n }\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{FUSION HOST}/api/users/{id}"
payload := strings.NewReader("{\n \"password\": {\n \"empty\": true\n },\n \"passwordConfirm\": {\n \"empty\": true\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{FUSION HOST}/api/users/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'password' => [
'empty' => true
],
'passwordConfirm' => [
'empty' => true
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request PATCH \
--url https://{FUSION HOST}/api/users/{id} \
--header 'Content-Type: application/json' \
--data '
{
"password": {
"empty": true
},
"passwordConfirm": {
"empty": true
}
}
'{
"id": "fe0885f2-8885-4c46-a3ea-8e5d0041c293",
"username": "admin",
"realmName": "ldap-internal",
"createdAt": "2025-09-23T17:48:07Z",
"updatedAt": "2025-10-31T12:28:04Z",
"roleNames": [
"search",
"developer"
],
"timezone": "Pacific Time (US & Canada)",
"permissions": [
{
"methods": [],
"path": "/",
"params": {}
}
]
}{
"id": "fe0885f2-8885-4c46-a3ea-8e5d0041c293",
"username": "admin",
"realmName": "ldap-internal",
"createdAt": "2025-09-23T17:48:07Z",
"updatedAt": "2025-10-31T12:28:04Z",
"roleNames": [
"search",
"developer"
],
"timezone": "Pacific Time (US & Canada)",
"permissions": [
{
"methods": [],
"path": "/",
"params": {}
}
]
}{
"id": "fe0885f2-8885-4c46-a3ea-8e5d0041c293",
"username": "admin",
"realmName": "ldap-internal",
"createdAt": "2025-09-23T17:48:07Z",
"updatedAt": "2025-10-31T12:28:04Z",
"roleNames": [
"search",
"developer"
],
"timezone": "Pacific Time (US & Canada)",
"permissions": [
{
"methods": [],
"path": "/",
"params": {}
}
]
}Update user password
Normal users can update only their own password; admin users can change any user password.
PATCH
/
users
/
{id}
Update user password
import requests
url = "https://{FUSION HOST}/api/users/{id}"
payload = {
"password": { "empty": True },
"passwordConfirm": { "empty": True }
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.patch("https://{FUSION HOST}/api/users/{id}")
.header("Content-Type", "application/json")
.body("{\n \"password\": {\n \"empty\": true\n },\n \"passwordConfirm\": {\n \"empty\": true\n }\n}")
.asString();const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({password: {empty: true}, passwordConfirm: {empty: true}})
};
fetch('https://{FUSION HOST}/api/users/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://{FUSION HOST}/api/users/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"password\": {\n \"empty\": true\n },\n \"passwordConfirm\": {\n \"empty\": true\n }\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{FUSION HOST}/api/users/{id}"
payload := strings.NewReader("{\n \"password\": {\n \"empty\": true\n },\n \"passwordConfirm\": {\n \"empty\": true\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{FUSION HOST}/api/users/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'password' => [
'empty' => true
],
'passwordConfirm' => [
'empty' => true
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request PATCH \
--url https://{FUSION HOST}/api/users/{id} \
--header 'Content-Type: application/json' \
--data '
{
"password": {
"empty": true
},
"passwordConfirm": {
"empty": true
}
}
'{
"id": "fe0885f2-8885-4c46-a3ea-8e5d0041c293",
"username": "admin",
"realmName": "ldap-internal",
"createdAt": "2025-09-23T17:48:07Z",
"updatedAt": "2025-10-31T12:28:04Z",
"roleNames": [
"search",
"developer"
],
"timezone": "Pacific Time (US & Canada)",
"permissions": [
{
"methods": [],
"path": "/",
"params": {}
}
]
}{
"id": "fe0885f2-8885-4c46-a3ea-8e5d0041c293",
"username": "admin",
"realmName": "ldap-internal",
"createdAt": "2025-09-23T17:48:07Z",
"updatedAt": "2025-10-31T12:28:04Z",
"roleNames": [
"search",
"developer"
],
"timezone": "Pacific Time (US & Canada)",
"permissions": [
{
"methods": [],
"path": "/",
"params": {}
}
]
}{
"id": "fe0885f2-8885-4c46-a3ea-8e5d0041c293",
"username": "admin",
"realmName": "ldap-internal",
"createdAt": "2025-09-23T17:48:07Z",
"updatedAt": "2025-10-31T12:28:04Z",
"roleNames": [
"search",
"developer"
],
"timezone": "Pacific Time (US & Canada)",
"permissions": [
{
"methods": [],
"path": "/",
"params": {}
}
]
}Path Parameters
The user ID. Note that this is different than the username. Use GET /users to get the list of user IDs.
Body
application/json
Response
OK
Example:
"fe0885f2-8885-4c46-a3ea-8e5d0041c293"
Example:
"admin"
Example:
"ldap-internal"
Example:
"2025-09-23T17:48:07Z"
Example:
"2025-10-31T12:28:04Z"
Indicates which roles are dynamically applied to users in the realm.
Example:
["search", "developer"]
Example:
"Pacific Time (US & Canada)"
Show child attributes
Show child attributes
Was this page helpful?
⌘I