This endpoint allows updating various user details. Please note that you must pass an empty string for the 'role_id' field if you are attempting to remove a role from a user. For the 'user_groups' field, please pass an empty list to remove user group associations for the provided user.
user_email
String
required
Full email of the user
Full email of the user
userEmail_example
curl -X 'PATCH'
-H
'Accept: application/json'
-H
'Content-Type: application/json'
'https://api-cortex.paloaltonetworks.com/platform/iam/v1/user/{user_email}'
-d
'{
"request_data" : {
"phone_number" : "408-753-4000",
"status" : "Active",
"role_id" : "role_name_123",
"is_hidden" : true,
"user_groups" : [ "user_groups_123" ]
}
}'
import http.client
conn = http.client.HTTPSConnection("api-")
payload = "{\"request_data\":{\"phone_number\":\"408-753-4000\",\"status\":\"Active\",\"role_id\":\"role_name_123\",\"is_hidden\":true,\"user_groups\":[\"user_groups_123\"]}}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "%7Bfqdn%7D/platform/iam/v1/user/%7Buser_email%7D", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api-/%7Bfqdn%7D/platform/iam/v1/user/%7Buser_email%7D")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\"request_data\":{\"phone_number\":\"408-753-4000\",\"status\":\"Active\",\"role_id\":\"role_name_123\",\"is_hidden\":true,\"user_groups\":[\"user_groups_123\"]}}"
response = http.request(request)
puts response.read_bodyconst data = JSON.stringify({
"request_data": {
"phone_number": "408-753-4000",
"status": "Active",
"role_id": "role_name_123",
"is_hidden": true,
"user_groups": [
"user_groups_123"
]
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("PATCH", "https://api-/%7Bfqdn%7D/platform/iam/v1/user/%7Buser_email%7D");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);HttpResponse<String> response = Unirest.patch("https://api-/%7Bfqdn%7D/platform/iam/v1/user/%7Buser_email%7D")
.header("content-type", "application/json")
.body("{\"request_data\":{\"phone_number\":\"408-753-4000\",\"status\":\"Active\",\"role_id\":\"role_name_123\",\"is_hidden\":true,\"user_groups\":[\"user_groups_123\"]}}")
.asString();import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["request_data": [
"phone_number": "408-753-4000",
"status": "Active",
"role_id": "role_name_123",
"is_hidden": true,
"user_groups": ["user_groups_123"]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://api-/%7Bfqdn%7D/platform/iam/v1/user/%7Buser_email%7D")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-/%7Bfqdn%7D/platform/iam/v1/user/%7Buser_email%7D",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => "{\"request_data\":{\"phone_number\":\"408-753-4000\",\"status\":\"Active\",\"role_id\":\"role_name_123\",\"is_hidden\":true,\"user_groups\":[\"user_groups_123\"]}}",
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 *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "https://api-/%7Bfqdn%7D/platform/iam/v1/user/%7Buser_email%7D");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"request_data\":{\"phone_number\":\"408-753-4000\",\"status\":\"Active\",\"role_id\":\"role_name_123\",\"is_hidden\":true,\"user_groups\":[\"user_groups_123\"]}}");
CURLcode ret = curl_easy_perform(hnd);var client = new RestClient("https://api-/%7Bfqdn%7D/platform/iam/v1/user/%7Buser_email%7D");
var request = new RestRequest(Method.PATCH);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"request_data\":{\"phone_number\":\"408-753-4000\",\"status\":\"Active\",\"role_id\":\"role_name_123\",\"is_hidden\":true,\"user_groups\":[\"user_groups_123\"]}}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);Request object for editing an existing user
request_dataobjectrequiredThe data fields to update for the user
The data fields to update for the user
user_first_namestringThe user's first name
The user's first name
user_last_namestringThe user's last name
The user's last name
role_idstringThe unique identifier of the role to assign to the user. Use an empty string to remove the role.
The unique identifier of the role to assign to the user. Use an empty string to remove the role.
phone_numberstringThe user's contact phone number
The user's contact phone number
statusstringThe user's account status (e.g., 'Active', 'Disabled')
The user's account status (e.g., 'Active', 'Disabled')
is_hiddenbooleanWhether the user should be hidden from certain UI views
Whether the user should be hidden from certain UI views
user_groupsarray[string]A list of unique identifiers for the groups the user belongs to. Use an empty list to remove all group associations.
A list of unique identifiers for the groups the user belongs to. Use an empty list to remove all group associations.
{
"request_data": {
"phone_number": "408-753-4000",
"status": "Active",
"role_id": "role_name_123",
"is_hidden": true,
"user_groups": [
"user_groups_123"
]
}
}