scripts_run_snippet_code_script
Start a script execution on targeted endpoints by sending snippet code and endpoint filters via the Cortex XSIAM public API.
Instructions
Run Snippet Code Script
Initiate a new endpoint script execution action using provided snippet code. Cortex XDR supports sending your request in Base64.
Required license: Cortex XSIAM Premium or Cortex XSIAM Enterprise or Cortex XSIAM Enterprise Plus
[POST /public_api/v1/scripts/run_snippet_code_script] · Script execution
Example request body:
{
"request_data": {
"filters": [
{
"field": "endpoint_id_list",
"operator": "in",
"value": [
"<endpoint ID>"
]
}
],
"snippet_code": "print (\"7\")"
}
}Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"request_data": "<request_data>"
},
"name": "scripts_run_snippet_code_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| request_data | Yes | A dictionary containing the API request fields. |