Edit the status of an existing Alert Notification Rule

Cortex XSIAM Platform APIs

patch /platform/notifications/v1/update-rule-status/{rule_uuid}

This endpoint allows a user to modify a rule's status without requiring a full update. A user can either enable or disable an Alert Notification Rule.

Path parameters
rule_uuid String required

Full rule uuid of the Alert Notification Rule

Example: 3053ad1f-0efc-305d-90dd-a305ab4153a4
CLIENT REQUEST
curl -X 'PATCH'
-H 'Accept: application/json'
-H 'Content-Type: application/json'
'https://api-cortex.paloaltonetworks.com/platform/notifications/v1/update-rule-status/{rule_uuid}'
-d '{ "request_data" : { "status" : "enable" } }'
import http.client conn = http.client.HTTPSConnection("api-") payload = "{\"request_data\":{\"status\":\"enable\"}}" headers = { 'content-type': "application/json" } conn.request("PATCH", "%7Bfqdn%7D/platform/notifications/v1/update-rule-status/3053ad1f-0efc-305d-90dd-a305ab4153a4", 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/notifications/v1/update-rule-status/3053ad1f-0efc-305d-90dd-a305ab4153a4") 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\":{\"status\":\"enable\"}}" response = http.request(request) puts response.read_body
const data = JSON.stringify({ "request_data": { "status": "enable" } }); 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/notifications/v1/update-rule-status/3053ad1f-0efc-305d-90dd-a305ab4153a4"); xhr.setRequestHeader("content-type", "application/json"); xhr.send(data);
HttpResponse<String> response = Unirest.patch("https://api-/%7Bfqdn%7D/platform/notifications/v1/update-rule-status/3053ad1f-0efc-305d-90dd-a305ab4153a4") .header("content-type", "application/json") .body("{\"request_data\":{\"status\":\"enable\"}}") .asString();
import Foundation let headers = ["content-type": "application/json"] let parameters = ["request_data": ["status": "enable"]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api-/%7Bfqdn%7D/platform/notifications/v1/update-rule-status/3053ad1f-0efc-305d-90dd-a305ab4153a4")! 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/notifications/v1/update-rule-status/3053ad1f-0efc-305d-90dd-a305ab4153a4", 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\":{\"status\":\"enable\"}}", 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/notifications/v1/update-rule-status/3053ad1f-0efc-305d-90dd-a305ab4153a4"); 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\":{\"status\":\"enable\"}}"); CURLcode ret = curl_easy_perform(hnd);
var client = new RestClient("https://api-/%7Bfqdn%7D/platform/notifications/v1/update-rule-status/3053ad1f-0efc-305d-90dd-a305ab4153a4"); var request = new RestRequest(Method.PATCH); request.AddHeader("content-type", "application/json"); request.AddParameter("application/json", "{\"request_data\":{\"status\":\"enable\"}}", ParameterType.RequestBody); IRestResponse response = client.Execute(request);
Body parameters
application/json

Enumerates the various para meters required for updating the status of a rule

request_dataobject
statusstringrequired

Value of updated status {enable|disable}

REQUEST
{ "request_data": { "status": "enable" } }
Responses

Body
application/json
RESPONSE
null

Body
application/json
dataobject
err_msgstringrequired

Error message describing the issue

metadataobject
err_extrastringrequired

Additional error details

err_codeintegerrequired

HTTP error code

RESPONSE
{ "data": { "err_msg": "The request contains invalid or missing parameters.", "metadata": { "err_extra": "Alert notification rule id 305 was not found.", "err_code": 400 } } }

Body
application/json
RESPONSE
{ "reply": { "err_code": 401, "err_msg": "Public API request unauthorized", "err_extra": null } }

Body
application/json
replyobject
err_msgstring
err_extrastring
err_codeinteger
RESPONSE
{ "reply": { "err_code": 403, "err_msg": "Forbidden. Access was denied to this resource.", "err_extra": "Insufficient permissions for api key" } }