Example Script Downloads

This page contains links to download all the example scripts found on API reference pages. Use any of the following files or scripts as examples to run directly in your own environment. Note that you may need to modify some of the values, such as the server address, to enable these scripts to run in your own environment.

Depending on your browser settings, this linked file may open in a separate tab instead of downloading directly to your machine. If this happens, use the Save As option in your browser to save the file locally.

All Python examples are formatted for Python version 3.0 and higher, up to the latest Python version. If you are using versions of Python earlier than 3.0, ensure you manually remove parentheses for the print statements in this sample. For example, the print (response.content) statement updates to print response.content.

Custom Rules API

Endpoint

Download Links

customRules/decisionFeature/live

Example 1 Python script

customRules/decisionFeature/deleted

Example 1 Python script

customRules/rootCauses

Example 1 Python script

customRules/getMalopDetectionTypes

Example 1 Python script

customRules/decisionFeature/create

Request template JSON file

customRules/decisionFeature/create

Example 1 JSON file

customRules/decisionFeature/create

Example 1 Python script

customRules/decisionFeature/update

Example 1 JSON file

customRules/decisionFeature/update

Example 1 Python script

customRules/history/:rule id

Example 1 Python script

Threat Intel API

Endpoint

Download Links

classification_v1/file_batch

Request template JSON file

Example 1 request JSON file

Example 1 Python script

classification_v1/domain_batch

Request template JSON file

Example 1 request JSON file

Example 1 Python script

classification_v1/ip_batch

Request template JSON file

Example 1 request JSON file

Example 1 Python script

download_v1/productClassifications

Example 1 Python script

download_v1/process_classifications

Example 1 Python script

download_v1/process_hierarchy

Example 1 Python script

download_v1/file_extension

Example 1 Python script

download_v1/port

Example 1 Python script

download_v1/ip_reputation

Example 1 Python script

download_v1/domain_reputation

Example 1 Python script

download_v1/:API name/service

Request Python script

Sensor Management API

Endpoint

Download Links

sensors/query

Request template JSON file

Example 1 request JSON file

Example 1 Python script

Example 2 request JSON file

Example 2 Python script

Example 3 request JSON file

Example 3 Python script

Example 4 request JSON file

Example 4 Python script

Example 5 request JSON file

Example 5 Python script

Example 6 request JSON  ile

Example 6 Python script

sensors/allActions

Example Python script

sensors/action/setRansomwareMode

Request template JSON file

Example 1 request JSON file

Example 1 Python script

Example 2 request JSON file

Example 2 Python script

sensors/action/setPreventionMode

Request template JSON file

Example 1 request JSON file

Example 1 Python script

Example 2 request JSON file

Example 2 Python script

sensors/action/set-antimalware-status

Request template JSON file

Example 1 request JSON file

Example 1 Python script

Example 2 request JSON syntax file

Example 2 Python script

Example 3 request JSON file

Example 3 Python script

Example 4 request JSON file

Example 4 Python script

Example 5 request JSON syntax file

Example 5 Python script

sensors/action/set-PowershellProtection-status

Request template JSON file

Example 1 request JSON syntax file

Example 1 Python script

Example 2 request JSON file

Example 2 Python script

Example 3 request JSON file

Example 3 Python script

sensors/action/startCollection

Request template JSON file

Example 1 request JSON file

Example 1 Python script

Example 2 request JSON file

Example 2 Python script

sensors/action/stopCollection

Request template JSON file

Example 1 request JSON file

Example 1 Python script

Example 2 JSON file

Example 2 Python script

sensors/action/delete

Request template JSON file

Example 1 request JSON syntax file

Example 1 Python script

sensors/action/purgeSensors

Request template JSON file

Example 1 request JSON syntax file

Example 1 Python script

sensors/action/revertPurgedSensors

Request template JSON file

Example 1 request JSON syntax file

Example 1 Python script

sensors/action/restart

Request template JSON file

Example 1 request JSON file

Example 1 Python script

Example 2 JSON file

Example 2 Python script

sensors/action/fetchLogs

Request template JSON file

Example request JSON file

Example Python script

sensors/action/download-logs/:batchID

Example Python script

sensors/download/csv

Example Python script

sensors/action/upgrade

Request template JSON file

Example 1 request JSON file

Example 1 Python script

Example 2 request JSON file

Example 2 Python script

sensors/abort/:batchID

Example Python script

sensors/action/archive

Request template JSON file

Example 1 request JSON file

Example 1 Python script

sensors/action/unarchive

Request template JSON file

Example 1 request JSON file

Example 1 Python script

tagging/process_tags

Create Sensor request template JSON file

Create Sensor Tags Example 1 request JSON file

Create Sensor Tags Example 1 Python script

Create Sensor Tags Example 2 request JSON syntax file

Create Sensor Tags Example 2 Python script

Update Sensor Tags request template JSON file

Update Sensor Tags Example 1 request JSON file

Update Sensor Tags Example 1 Python script

Update Sensor Tags Example 2 request JSON file

Update Sensor Tags Example 2 Python script

Delete Sensor Tags request template JSON file

Delete Sensor Tags Example 1 request JSON file

Delete Sensor Tags Example 1 Python script

Delete Sensor Tags Example 2 request JSON file

Delete Sensor Tags Example 2 Python script

sensors/tagging/:machineName

Example Python script

groups (GET)

Example Python script

groups (POST)

Example 1 request JSON file

Example 1 Python script

Example 2 request JSON file

Example 2 Python script

groups/:group ID

Request template JSON file

Example 1 request JSON file

Example 1 Python script

sensors/action/addToGroup

Request template JSON file

Example 1 request JSON file

Example 1 Python script

sensors/action/removeFromGroup

Request template JSON file

Example 1 request JSON file

Example 1 Python script

groups/:group ID

Example Python script

policies (POST)

Request template JSON file

Example 1 request JSON file

Example 1 Python script

policies (GET)

Example 1 Python script

Incident Response API

Endpoint

Download Links

irtools/upload

Example 1 Python script

Example 2 Python script

Example 3 Python script

Example 4 Python script

Example 5 Python script

Example 6 Python script

irtools/packages

Example Python script

irtools/credentials

Example Python script

sensors/action/getPackagesDeployment

Template JSON syntax file

Example 1 request JSON syntax file

Example 1 request Python script

Example 2 request JSON syntax file

Example 2 request Python script

sensors/action/runIRTool

Template request JSON syntax file

Example 1 request JSON syntax file

Example 1 request Python script

Example 2 request JSON syntax file

Example 2 request Python script

Example 3 request JSON syntax file

Example 3 request Python script

sensors/actions/getRunIRToolStatus?:batchID

Example 1 request Python script

sensors/action/getIRToolResults

Template request JSON syntax file

Example 1 request JSON syntax file

Example 1 request Python script

Example 2 request JSON syntax file

Example 2 request Python script

irtools/delete

Template request JSON syntax file

Example 1 request JSON syntax file

Example 1 request Python script

forensics/forensicsTools

Example 1 Python script

forensics/uploadForensicTool

Template JSON syntax file

Example 1 request JSON syntax file

Example 1 request Python script

forensics/getForensicToolDeploymentStatus

Template JSON syntax file

Example 1 request JSON syntax file

Example 1 request Python script

forensics/runForensicTool

Template JSON syntax file

Example 1 request JSON syntax file

Example 1 request Python script

forensics/runForensicToolWithInputFile

Example 1 request Python script

forensics/getForensicToolRunStatus/:batchId

Example 1 request Python script

forensics/deleteForensicTool

Template JSON syntax file

Example 1 request JSON syntax file

Example 1 request Python script

Query API Examples

Example Type

Download Links

Actions on a Target

Example 1 request JSON file

Example 1 Python script

Example 2 request JSON file

Example 2 Python script

Asset Mapping

Example 1 request JSON file

Example 1 Python script

Example 2 request JSON file

Example 2 Python script

Example 3 request JSON syntax file

Example 3 Python script

Credential Theft

Example 1 request JSON file

Example 1 Python script

Example 2 request JSON syntax file

Example 2 Python script

Example 3 request JSON syntax file

Example 3 Python script

Data Theft

Example request JSON file

Example Python script

DMG files

Example 1 request JSON syntax file

Example 1 Python script

Example 2 request JSON file

Example 2 Python script

Example 3 request JSON file

Example 3 Python script

Foothold

Example 1 request JSON file

Example 1 Python script

Example 2 request JSON file

Example 2 Python script

Generic Queries

Example 1 request JSON file

Example 1 Python script

Example 2 request JSON file

Example 2 Python script

Example 3 request JSON file

Example 3 Python script

Infection

Example 1 request JSON syntax file

Example 1 Python script

Example 2 request JSON file

Example 2 Python script

Example 3 request JSON file

Example 3 Python script

Example 4 request JSON file

Example 4 Python script

Example 5 request JSON  file

Example 5 Python script

Example 6 request JSON syntax file

Example 6 Python script

Example 7 request JSON syntax file

Example 7 Python script

Example 8 request JSON file

Example 8 Python script

Example 9 request JSON file

Example 9 Python script

Example 10 request JSON file

Example 10 Python script

Example 11 request JSON file

Example 11 Python script

Example 12 Request JSON file

Example 12 Python script

Lateral Movement

Example 1 request JSON syntax file

Example 1 Python script

Example 2 request JSON file

Example 2 Python script

Example 3 request JSON syntax file

Example 3 Python script

Example 4 request JSON file

Example 4 Python script

Example 5 request JSON file

Example 5 Python script

Malicious Communication

Example 1 request JSON syntax file

Example 1 Python script

Example 2 request JSON file

Example 2 Python script

Example 3 JSON syntax file

Example 3 Python script

Example 4 request JSON file

Example 4 Python script

Malicious processes

Example 1 request JSON syntax file

Example 1 Python script

Example 2 request JSON file

Example 2 Python script

Example 3 request JSON file

Example 3 Python script

Example 4 request JSON file

Example 4 Python script

Example 5 request JSON file

Example 5 Python script

Example 6 request JSON syntax file

Example 6 Python script

Example 7 request JSON file

Example 7 Python script

Example 8 request JSON file

Example 8 Python script

Example 9 request JSON syntax file

Example 9 Python script

Example 10 request JSON file

Example 10 Python script

Example 11 request JSON file

Example 11 Python script

Example 12 request JSON file

Example 12 Python script

Example 13 request JSON file

Example 13 Python script

Example 14 request JSON file

Example 14 Python script

MITRE queries

Example 1 request JSON file

Example 1 Python script

Example 2 request JSON file

Example 2 Python script

Example 3 request JSON file

Example 3 Python script

Example 4 request JSON file

Example 4 Python script

Example 5 request JSON file

Example 5 Python script

Example 6 request JSON file

Example 6 Python script

Example 7 request JSON file

Example 7 Python script

Example 8 request JSON file

Example 8 Python script

Example 9 request JSON syntax file

Example 9 Python script

Example 10 request JSON file

Example 10 Python script

Example 11 request JSON file

Example 11 Python script

Example 12 request JSON syntax file

Example 12 Python script

Example 13 request JSON file

Example 13 Python script

Example 14 request JSON file

Example 14 Python script

Example 15 request JSON file

Example 15 Python script

Example 16 request JSON file

Example 16 Python script

Example 17 request JSON file

Example 17 Python script

Example 18 request JSON file

Example 18 Python script

Example 19 request JSON file

Example 19 Python script

Example 20 request JSON file

Example 20 Python script

Example 21 request JSON file

Example 21 Python script

Example 22 request JSON file

Example 22 Python script

Example 23 request JSON file

Example 23 Python script

Narrow Queries

Example 1 request JSON file

Example 1 Python script

Example 2 request JSON file

Example 2 Python script

Penetration Vectors

Example 1 request JSON file

Example 1 Python script

Example 2 request JSON file

Example 2 Python script

Example 3 request JSON file

Example 3 Python script

Privilege Escalation

Example 1 request JSON syntax file

Example 1 Python script

Example 2 request JSON file

Example 2 Python script

Reconnaissance

Example 1 request JSON file

Example 1 Python script

Example 2 request JSON file

Example 2 Python script

Example 3 request JSON syntax file

Example 3 Python script

Example 4 request JSON file

Example 4 Python script

Example 5 request JSON file

Example 5 Python script

Example 6 request JSON file

Example 6 Python script

Example 7 request JSON file

Example 7 Python script

Scanning

Example 1 request JSON file

Example 1 Python script

Example 2 request JSON syntax file

Example 2 Python script

Example 3 request JSON file

Example 3 Python script

WMI-based Queries

Example 1 request JSON file

Example 1 Python script

Example 2 request JSON file

Example 2 Python script

Example 3 request JSON file

Example 3 Python script

Example 4 request JSON file

Example 4 Python script

Example 5 request JSON file

Example 5 Python script