Delete an AppSec policy

Cortex XSIAM Platform APIs

delete /public_api/appsec/v1/policies/{policyId}

Deletes an Application Security policy by its policy ID.

Required license:

Cortex XSIAM Premium. In Cortex XSIAM Enterprise and Cortex NG SIEM, requires the Cortex Cloud Posture Management add-on. Not supported in XSIAM Enterprise Plus.

Path parameters
policyId String required

Unique identifier for the policy

Example: d4e5f6a7-b8c9-0123-def0-1234567890ab
Request headers
Authorization String required

{api_key}

Example: your_api_key_here
x-xdr-auth-id String required

{api_key_id}

Example: 1
CLIENT REQUEST
curl -X 'DELETE'
-H 'Accept: application/json'
-H 'Authorization: your_api_key_here' -H 'x-xdr-auth-id: 1'
'https://api-yourfqdn/public_api/appsec/v1/policies/{policyId}'
import http.client conn = http.client.HTTPSConnection("api-yourfqdn") headers = { 'Authorization': "your_api_key_here", 'x-xdr-auth-id': "1" } conn.request("DELETE", "/public_api/appsec/v1/policies/d4e5f6a7-b8c9-0123-def0-1234567890ab", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
require 'uri' require 'net/http' require 'openssl' url = URI("https://api-yourfqdn/public_api/appsec/v1/policies/d4e5f6a7-b8c9-0123-def0-1234567890ab") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Delete.new(url) request["Authorization"] = 'your_api_key_here' request["x-xdr-auth-id"] = '1' response = http.request(request) puts response.read_body
const data = null; const xhr = new XMLHttpRequest(); xhr.withCredentials = true; xhr.addEventListener("readystatechange", function () { if (this.readyState === this.DONE) { console.log(this.responseText); } }); xhr.open("DELETE", "https://api-yourfqdn/public_api/appsec/v1/policies/d4e5f6a7-b8c9-0123-def0-1234567890ab"); xhr.setRequestHeader("Authorization", "your_api_key_here"); xhr.setRequestHeader("x-xdr-auth-id", "1"); xhr.send(data);
HttpResponse<String> response = Unirest.delete("https://api-yourfqdn/public_api/appsec/v1/policies/d4e5f6a7-b8c9-0123-def0-1234567890ab") .header("Authorization", "your_api_key_here") .header("x-xdr-auth-id", "1") .asString();
import Foundation let headers = [ "Authorization": "your_api_key_here", "x-xdr-auth-id": "1" ] let request = NSMutableURLRequest(url: NSURL(string: "https://api-yourfqdn/public_api/appsec/v1/policies/d4e5f6a7-b8c9-0123-def0-1234567890ab")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "DELETE" request.allHTTPHeaderFields = headers 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-yourfqdn/public_api/appsec/v1/policies/d4e5f6a7-b8c9-0123-def0-1234567890ab", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "DELETE", CURLOPT_HTTPHEADER => [ "Authorization: your_api_key_here", "x-xdr-auth-id: 1" ], ]); $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, "DELETE"); curl_easy_setopt(hnd, CURLOPT_URL, "https://api-yourfqdn/public_api/appsec/v1/policies/d4e5f6a7-b8c9-0123-def0-1234567890ab"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "Authorization: your_api_key_here"); headers = curl_slist_append(headers, "x-xdr-auth-id: 1"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd);
var client = new RestClient("https://api-yourfqdn/public_api/appsec/v1/policies/d4e5f6a7-b8c9-0123-def0-1234567890ab"); var request = new RestRequest(Method.DELETE); request.AddHeader("Authorization", "your_api_key_here"); request.AddHeader("x-xdr-auth-id", "1"); IRestResponse response = client.Execute(request);
Responses

Ok

Body
application/json
messagestringrequired
RESPONSE
{ "message": "Policy 'd4e5f6a7-b8c9-0123-def0-1234567890ab' was successfully deleted" }