Delete API Keys

Cortex XSIAM Platform APIs

post /public_api/v1/api_keys/delete

Delete API Keys by ID.

Required license: Cortex XSIAM Premium or Cortex XSIAM Enterprise or Cortex XSIAM NG SIEM or Cortex XSIAM Enterprise Plus.

Request headers
authorization String required

api_key

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

api_key_id

Example: 2841
x-xdr-timestamp String required

timestamp in milliseconds

Example: xXdrTimestamp_example
x-xdr-nonce String required

64 byte random string

Example: xXdrNonce_example
x-child-tenant-id String required

child tenant ID

Example: xChildTenantId_example
CLIENT REQUEST
curl -X 'POST'
-H 'Accept: application/json'
-H 'Content-Type: application/json'
-H 'authorization: DCdIeow0xm73EwnxjPza1tdHTfZQv2eH7bTKlTPkgBHLj8aSjFzjgTE9bQUK1DidlWLrnYRhaYQ4PCIyNrNJbMUC6DOWi8ANIn1JWpMTE2neGvoDIRsKUbj6pJ1z7Gmr' -H 'x-xdr-auth-id: 2841' -H 'x-xdr-timestamp: xXdrTimestamp_example' -H 'x-xdr-nonce: xXdrNonce_example' -H 'x-child-tenant-id: xChildTenantId_example'
'https://api-yourfqdn/public_api/v1/api_keys/delete'
-d ''
import http.client conn = http.client.HTTPSConnection("api-yourfqdn") payload = "{\"request_data\":{\"filters\":[{\"field\":\"id\",\"operator\":\"in\",\"value\":[0]}]}}" headers = { 'authorization': "DCdIeow0xm73EwnxjPza1tdHTfZQv2eH7bTKlTPkgBHLj8aSjFzjgTE9bQUK1DidlWLrnYRhaYQ4PCIyNrNJbMUC6DOWi8ANIn1JWpMTE2neGvoDIRsKUbj6pJ1z7Gmr", 'x-xdr-auth-id': "2841", 'x-xdr-timestamp': "SOME_STRING_VALUE", 'x-xdr-nonce': "SOME_STRING_VALUE", 'x-child-tenant-id': "SOME_STRING_VALUE", 'content-type': "application/json" } conn.request("POST", "/public_api/v1/api_keys/delete", payload, 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/v1/api_keys/delete") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Post.new(url) request["authorization"] = 'DCdIeow0xm73EwnxjPza1tdHTfZQv2eH7bTKlTPkgBHLj8aSjFzjgTE9bQUK1DidlWLrnYRhaYQ4PCIyNrNJbMUC6DOWi8ANIn1JWpMTE2neGvoDIRsKUbj6pJ1z7Gmr' request["x-xdr-auth-id"] = '2841' request["x-xdr-timestamp"] = 'SOME_STRING_VALUE' request["x-xdr-nonce"] = 'SOME_STRING_VALUE' request["x-child-tenant-id"] = 'SOME_STRING_VALUE' request["content-type"] = 'application/json' request.body = "{\"request_data\":{\"filters\":[{\"field\":\"id\",\"operator\":\"in\",\"value\":[0]}]}}" response = http.request(request) puts response.read_body
const data = JSON.stringify({ "request_data": { "filters": [ { "field": "id", "operator": "in", "value": [ 0 ] } ] } }); const xhr = new XMLHttpRequest(); xhr.withCredentials = true; xhr.addEventListener("readystatechange", function () { if (this.readyState === this.DONE) { console.log(this.responseText); } }); xhr.open("POST", "https://api-yourfqdn/public_api/v1/api_keys/delete"); xhr.setRequestHeader("authorization", "DCdIeow0xm73EwnxjPza1tdHTfZQv2eH7bTKlTPkgBHLj8aSjFzjgTE9bQUK1DidlWLrnYRhaYQ4PCIyNrNJbMUC6DOWi8ANIn1JWpMTE2neGvoDIRsKUbj6pJ1z7Gmr"); xhr.setRequestHeader("x-xdr-auth-id", "2841"); xhr.setRequestHeader("x-xdr-timestamp", "SOME_STRING_VALUE"); xhr.setRequestHeader("x-xdr-nonce", "SOME_STRING_VALUE"); xhr.setRequestHeader("x-child-tenant-id", "SOME_STRING_VALUE"); xhr.setRequestHeader("content-type", "application/json"); xhr.send(data);
HttpResponse<String> response = Unirest.post("https://api-yourfqdn/public_api/v1/api_keys/delete") .header("authorization", "DCdIeow0xm73EwnxjPza1tdHTfZQv2eH7bTKlTPkgBHLj8aSjFzjgTE9bQUK1DidlWLrnYRhaYQ4PCIyNrNJbMUC6DOWi8ANIn1JWpMTE2neGvoDIRsKUbj6pJ1z7Gmr") .header("x-xdr-auth-id", "2841") .header("x-xdr-timestamp", "SOME_STRING_VALUE") .header("x-xdr-nonce", "SOME_STRING_VALUE") .header("x-child-tenant-id", "SOME_STRING_VALUE") .header("content-type", "application/json") .body("{\"request_data\":{\"filters\":[{\"field\":\"id\",\"operator\":\"in\",\"value\":[0]}]}}") .asString();
import Foundation let headers = [ "authorization": "DCdIeow0xm73EwnxjPza1tdHTfZQv2eH7bTKlTPkgBHLj8aSjFzjgTE9bQUK1DidlWLrnYRhaYQ4PCIyNrNJbMUC6DOWi8ANIn1JWpMTE2neGvoDIRsKUbj6pJ1z7Gmr", "x-xdr-auth-id": "2841", "x-xdr-timestamp": "SOME_STRING_VALUE", "x-xdr-nonce": "SOME_STRING_VALUE", "x-child-tenant-id": "SOME_STRING_VALUE", "content-type": "application/json" ] let parameters = ["request_data": ["filters": [ [ "field": "id", "operator": "in", "value": [0] ] ]]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api-yourfqdn/public_api/v1/api_keys/delete")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" 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-yourfqdn/public_api/v1/api_keys/delete", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{\"request_data\":{\"filters\":[{\"field\":\"id\",\"operator\":\"in\",\"value\":[0]}]}}", CURLOPT_HTTPHEADER => [ "authorization: DCdIeow0xm73EwnxjPza1tdHTfZQv2eH7bTKlTPkgBHLj8aSjFzjgTE9bQUK1DidlWLrnYRhaYQ4PCIyNrNJbMUC6DOWi8ANIn1JWpMTE2neGvoDIRsKUbj6pJ1z7Gmr", "content-type: application/json", "x-child-tenant-id: SOME_STRING_VALUE", "x-xdr-auth-id: 2841", "x-xdr-nonce: SOME_STRING_VALUE", "x-xdr-timestamp: SOME_STRING_VALUE" ], ]); $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, "POST"); curl_easy_setopt(hnd, CURLOPT_URL, "https://api-yourfqdn/public_api/v1/api_keys/delete"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "authorization: DCdIeow0xm73EwnxjPza1tdHTfZQv2eH7bTKlTPkgBHLj8aSjFzjgTE9bQUK1DidlWLrnYRhaYQ4PCIyNrNJbMUC6DOWi8ANIn1JWpMTE2neGvoDIRsKUbj6pJ1z7Gmr"); headers = curl_slist_append(headers, "x-xdr-auth-id: 2841"); headers = curl_slist_append(headers, "x-xdr-timestamp: SOME_STRING_VALUE"); headers = curl_slist_append(headers, "x-xdr-nonce: SOME_STRING_VALUE"); headers = curl_slist_append(headers, "x-child-tenant-id: SOME_STRING_VALUE"); headers = curl_slist_append(headers, "content-type: application/json"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"request_data\":{\"filters\":[{\"field\":\"id\",\"operator\":\"in\",\"value\":[0]}]}}"); CURLcode ret = curl_easy_perform(hnd);
var client = new RestClient("https://api-yourfqdn/public_api/v1/api_keys/delete"); var request = new RestRequest(Method.POST); request.AddHeader("authorization", "DCdIeow0xm73EwnxjPza1tdHTfZQv2eH7bTKlTPkgBHLj8aSjFzjgTE9bQUK1DidlWLrnYRhaYQ4PCIyNrNJbMUC6DOWi8ANIn1JWpMTE2neGvoDIRsKUbj6pJ1z7Gmr"); request.AddHeader("x-xdr-auth-id", "2841"); request.AddHeader("x-xdr-timestamp", "SOME_STRING_VALUE"); request.AddHeader("x-xdr-nonce", "SOME_STRING_VALUE"); request.AddHeader("x-child-tenant-id", "SOME_STRING_VALUE"); request.AddHeader("content-type", "application/json"); request.AddParameter("application/json", "{\"request_data\":{\"filters\":[{\"field\":\"id\",\"operator\":\"in\",\"value\":[0]}]}}", ParameterType.RequestBody); IRestResponse response = client.Execute(request);
Body parameters
application/json
request_dataobjectrequired
filtersarray

An array of filter fields.

[
fieldobject (Enum)

Identifies the API Key field the filter is matching. Filters are based on the following keyword:

  • id: The API Key ID.
Allowed values:"id"
operatorobject (Enum)

Identifies the comparison operator you want to use for this filter. Valid keyword is: in

  • id: Integer representing the API Key ID.
Allowed values:"in"
valuearray[integer]

Array of API Key IDs.

]
REQUEST
{ "request_data": { "filters": [ { "field": "id", "operator": "in", "value": [ 121, 134 ] } ] } }
Responses

OK

Body
application/json
replyobject
update_countinteger

The number of API Keys deleted.

RESPONSE
{ "reply": { "update_count": 2 } }

Bad Request. Invalid Input.

Unauthorized access. User does not have the required license type to run this API.

Forbidden access. The provided API Key does not have the required RBAC permissions to run this API.

Internal Server Error.