Get Script Metadata

Cortex XDR REST API

post /public_api/v1/scripts/get_script_metadata

Get the full definitions of a specific script in the scripts library.

Required license: Cortex XDR Pro per Endpoint or Cortex XDR Pro per GB

CURL
curl -X POST \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ "https://api-yourfqdn/public_api/v1/scripts/get_script_metadata" \ -d '{ "request_data" : { "script_uid" : "script_uid" } }'
Request
Body
optional
Example: {"request_data":{"script_uid":""}}
request_data
required
A dictionary containing the API request fields.
script_uid
required
String
Unique identifier of the script, returned by the Get Scripts API per script.
Responses

Successful response

Body
reply
optional
JSON object containing the query result.
script_id
optional
String
Script ID.
name
optional
String
Name of script.
description
optional
String
Description of script.
modification_date
optional
Integer
Timestamp of when the script was last modified.
created_by
optional
String
Name of the user who created the script.
is_high_risk
optional
Boolean
Whether the script has a high-risk outcome.
windows_supported
optional
Boolean
Whether the script can be executed on Windows OS.
linux_supported
optional
Boolean
Whether the script can be executed on Linux OS.
macos_supported
optional
Boolean
Whether the script can be executed on macOS.
script_uid
optional
String
GUID, global ID of the script, used toidentify the script when executing.
entry_point
optional
String
name of the entry point selected for the script defined as run.
script_input
optional
Array
name
optional
String
type
optional
String
friendly_name
optional
String
script_output_type
optional
String (Enum)
Type of output.
Allowed values:
auto_detect
dictionary
number_list
number
string
string_list
boolean_list
ip
ip_list
boolean
script_output_dictionary_definitions
optional
Array
When the script_output_type is a dictionary an array with friendly_name, name, and type for each output is returned. The field is empty in all other cases.
friendly_name
optional
String
name
optional
String
type
optional
String

Bad Request. Got an invalid JSON.

Body
The query result upon error.
err_code
optional
String
HTTP response code.
err_msg
optional
String
Error message.
Example: {"line": 1, "column": 19, "message": "no viable alternative at input '|alter2'"}
err_extra
optional
String
Additional information describing the error.

Unauthorized access. An issue occurred during authentication. This can indicate an incorrect key, id, or other invalid authentication parameters.

Body
The query result upon error.
err_code
optional
String
HTTP response code.
err_msg
optional
String
Error message.
Example: {"line": 1, "column": 19, "message": "no viable alternative at input '|alter2'"}
err_extra
optional
String
Additional information describing the error.

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

Body
The query result upon error.
err_code
optional
String
HTTP response code.
err_msg
optional
String
Error message.
Example: {"line": 1, "column": 19, "message": "no viable alternative at input '|alter2'"}
err_extra
optional
String
Additional information describing the error.

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

Body
The query result upon error.
err_code
optional
String
HTTP response code.
err_msg
optional
String
Error message.
Example: {"line": 1, "column": 19, "message": "no viable alternative at input '|alter2'"}
err_extra
optional
String
Additional information describing the error.

Internal server error. A unified status for API communication type errors.

Body
The query result upon error.
err_code
optional
String
HTTP response code.
err_msg
optional
String
Error message.
Example: {"line": 1, "column": 19, "message": "no viable alternative at input '|alter2'"}
err_extra
optional
String
Additional information describing the error.