Manually create a new Cortex XSOAR incident or update an existing one.
To update an existing incident, you must update the version parameter. For more information on updating the version parameter, see Optimistic locking and versioning.
To update incident custom fields, they must be in lowercase and without spaces. For example, "Scan IP" should be "scanip".
To get the actual key name, you can go to Cortex XSOAR CLI and run /incident_add and look for the key that you would like to update.
Use createInvestigation: true to start the investigation process automatically upon creating the new incident. This will also run the appropriate playbook based on the incident type.
Authorization
String
required
{api_key}
{api_key}
authorization_example
x-xdr-auth-id
String
required
{api_key_id}
{api_key_id}
xXdrAuthId_example
curl -X 'POST'
-H
'Accept: application/json'
-H
'Content-Type: application/json'
-H
'Authorization: authorization_example'
-H
'x-xdr-auth-id: xXdrAuthId_example'
'https://api-yourfqdn/xsoar/public/v1/incident'
-d
'{
"severity" : 2,
"reason" : "reason",
"closeNotes" : "closeNotes",
"customFields" : {
"key" : "{}"
},
"sla" : 0.8008281904610115,
"rawJSON" : "rawJSON",
"type" : "Unclassified",
"createInvestigation" : true,
"labels" : [ {
"type" : "type",
"value" : "value"
}, {
"type" : "type",
"value" : "value"
} ],
"playbookId" : "playbookId",
"name" : "name",
"closed" : "2000-01-23T04:56:07.000+00:00",
"modified" : "2000-01-23T04:56:07.000+00:00",
"details" : "details",
"closeReason" : "closeReason",
"status" : 2
}'
import http.client
conn = http.client.HTTPSConnection("api-yourfqdn")
payload = "{\"closeNotes\":\"string\",\"closeReason\":\"string\",\"closed\":\"2019-08-24T14:15:22Z\",\"createInvestigation\":true,\"customFields\":{\"property1\":{},\"property2\":{}},\"details\":\"string\",\"labels\":[{\"type\":\"string\",\"value\":\"string\"}],\"modified\":\"2019-08-24T14:15:22Z\",\"name\":\"string\",\"playbookId\":\"string\",\"rawJSON\":\"string\",\"reason\":\"string\",\"severity\":2,\"sla\":0.1,\"status\":2,\"type\":\"Unclassified\"}"
headers = {
'Authorization': "SOME_STRING_VALUE",
'x-xdr-auth-id': "SOME_STRING_VALUE",
'content-type': "application/json"
}
conn.request("POST", "//xsoar/public/v1/incident", 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//xsoar/public/v1/incident")
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"] = 'SOME_STRING_VALUE'
request["x-xdr-auth-id"] = 'SOME_STRING_VALUE'
request["content-type"] = 'application/json'
request.body = "{\"closeNotes\":\"string\",\"closeReason\":\"string\",\"closed\":\"2019-08-24T14:15:22Z\",\"createInvestigation\":true,\"customFields\":{\"property1\":{},\"property2\":{}},\"details\":\"string\",\"labels\":[{\"type\":\"string\",\"value\":\"string\"}],\"modified\":\"2019-08-24T14:15:22Z\",\"name\":\"string\",\"playbookId\":\"string\",\"rawJSON\":\"string\",\"reason\":\"string\",\"severity\":2,\"sla\":0.1,\"status\":2,\"type\":\"Unclassified\"}"
response = http.request(request)
puts response.read_bodyconst data = JSON.stringify({
"closeNotes": "string",
"closeReason": "string",
"closed": "2019-08-24T14:15:22Z",
"createInvestigation": true,
"customFields": {
"property1": {},
"property2": {}
},
"details": "string",
"labels": [
{
"type": "string",
"value": "string"
}
],
"modified": "2019-08-24T14:15:22Z",
"name": "string",
"playbookId": "string",
"rawJSON": "string",
"reason": "string",
"severity": 2,
"sla": 0.1,
"status": 2,
"type": "Unclassified"
});
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//xsoar/public/v1/incident");
xhr.setRequestHeader("Authorization", "SOME_STRING_VALUE");
xhr.setRequestHeader("x-xdr-auth-id", "SOME_STRING_VALUE");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);HttpResponse<String> response = Unirest.post("https://api-yourfqdn//xsoar/public/v1/incident")
.header("Authorization", "SOME_STRING_VALUE")
.header("x-xdr-auth-id", "SOME_STRING_VALUE")
.header("content-type", "application/json")
.body("{\"closeNotes\":\"string\",\"closeReason\":\"string\",\"closed\":\"2019-08-24T14:15:22Z\",\"createInvestigation\":true,\"customFields\":{\"property1\":{},\"property2\":{}},\"details\":\"string\",\"labels\":[{\"type\":\"string\",\"value\":\"string\"}],\"modified\":\"2019-08-24T14:15:22Z\",\"name\":\"string\",\"playbookId\":\"string\",\"rawJSON\":\"string\",\"reason\":\"string\",\"severity\":2,\"sla\":0.1,\"status\":2,\"type\":\"Unclassified\"}")
.asString();import Foundation
let headers = [
"Authorization": "SOME_STRING_VALUE",
"x-xdr-auth-id": "SOME_STRING_VALUE",
"content-type": "application/json"
]
let parameters = [
"closeNotes": "string",
"closeReason": "string",
"closed": "2019-08-24T14:15:22Z",
"createInvestigation": true,
"customFields": [
"property1": [],
"property2": []
],
"details": "string",
"labels": [
[
"type": "string",
"value": "string"
]
],
"modified": "2019-08-24T14:15:22Z",
"name": "string",
"playbookId": "string",
"rawJSON": "string",
"reason": "string",
"severity": 2,
"sla": 0.1,
"status": 2,
"type": "Unclassified"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://api-yourfqdn//xsoar/public/v1/incident")! 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//xsoar/public/v1/incident",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"closeNotes\":\"string\",\"closeReason\":\"string\",\"closed\":\"2019-08-24T14:15:22Z\",\"createInvestigation\":true,\"customFields\":{\"property1\":{},\"property2\":{}},\"details\":\"string\",\"labels\":[{\"type\":\"string\",\"value\":\"string\"}],\"modified\":\"2019-08-24T14:15:22Z\",\"name\":\"string\",\"playbookId\":\"string\",\"rawJSON\":\"string\",\"reason\":\"string\",\"severity\":2,\"sla\":0.1,\"status\":2,\"type\":\"Unclassified\"}",
CURLOPT_HTTPHEADER => [
"Authorization: SOME_STRING_VALUE",
"content-type: application/json",
"x-xdr-auth-id: 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//xsoar/public/v1/incident");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "x-xdr-auth-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, "{\"closeNotes\":\"string\",\"closeReason\":\"string\",\"closed\":\"2019-08-24T14:15:22Z\",\"createInvestigation\":true,\"customFields\":{\"property1\":{},\"property2\":{}},\"details\":\"string\",\"labels\":[{\"type\":\"string\",\"value\":\"string\"}],\"modified\":\"2019-08-24T14:15:22Z\",\"name\":\"string\",\"playbookId\":\"string\",\"rawJSON\":\"string\",\"reason\":\"string\",\"severity\":2,\"sla\":0.1,\"status\":2,\"type\":\"Unclassified\"}");
CURLcode ret = curl_easy_perform(hnd);var client = new RestClient("https://api-yourfqdn//xsoar/public/v1/incident");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "SOME_STRING_VALUE");
request.AddHeader("x-xdr-auth-id", "SOME_STRING_VALUE");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"closeNotes\":\"string\",\"closeReason\":\"string\",\"closed\":\"2019-08-24T14:15:22Z\",\"createInvestigation\":true,\"customFields\":{\"property1\":{},\"property2\":{}},\"details\":\"string\",\"labels\":[{\"type\":\"string\",\"value\":\"string\"}],\"modified\":\"2019-08-24T14:15:22Z\",\"name\":\"string\",\"playbookId\":\"string\",\"rawJSON\":\"string\",\"reason\":\"string\",\"severity\":2,\"sla\":0.1,\"status\":2,\"type\":\"Unclassified\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);closeNotesstringNotes for closing the incident.
Notes for closing the incident.
closeReasonstringThe reason for closing the incident (select from existing predefined values).
The reason for closing the incident (select from existing predefined values).
closedstringdate-timeUse createInvestigation: true to start the investigation process automatically upon creating the new incident. This will also run the appropriate playbook based on the incident type.
Use 'createInvestigation: false
Use createInvestigation: true to start the investigation process automatically upon creating the new incident. This will also run the appropriate playbook based on the incident type.
Use 'createInvestigation: false
createInvestigationbooleanUse createInvestigation: true to start the investigation process automatically upon creating the new incident. This will also run the appropriate playbook based on the incident type.
Use createInvestigation: true to start the investigation process automatically upon creating the new incident. This will also run the appropriate playbook based on the incident type.
customFieldsobject
Additional propertiesobject
detailsstringThe details of the incident.
The details of the incident.
labelsarrayLabels related to incident - each label is composed of a type and value
Labels related to incident - each label is composed of a type and value
typestring
valuestring
modifiedstringdate-timeDate modified.
Date modified.
namestringIncident name.
Incident name.
playbookIdstringThe associated playbook for this incident.
The associated playbook for this incident.
rawJSONstring
reasonstringThe reason an incident was closed.
The reason an incident was closed.
severitynumberdoubleSeverity is the incident severity
Severity is the incident severity
2slanumberdoubleSLAState is the incident SLA at closure time, in minutes.
SLAState is the incident SLA at closure time, in minutes.
statusnumberdoubleIncidentStatus is the status of the incident
IncidentStatus is the status of the incident
2typestringIncident type.
Incident type.
"Unclassified"{
"details": "My test incident",
"name": "My test incident",
"severity": 2,
"type": "Unclassified"
}