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

Body parameters
request_dataObjectrequired

A dictionary containing the API request fields.

script_uidString

Unique identifier of the script, returned by the Get Scripts API per script.

REQUEST BODY
{ "request_data": { "script_uid": "<unique ID>" } }
CURL
curl -X 'POST'
-H 'Accept: application/json'
-H 'Content-Type: application/json'
'https://api-yourfqdn/public_api/v1/scripts/get_script_metadata'
-d ''
Responses

Successful response

Body
replyObject

JSON object containing the query result.

script_idString

Script ID.

nameString

Name of script.

descriptionString

Description of script.

modification_dateInteger

Timestamp of when the script was last modified.

created_byString

Name of the user who created the script.

is_high_riskBoolean

Whether the script has a high-risk outcome.

windows_supportedBoolean

Whether the script can be executed on Windows OS.

linux_supportedBoolean

Whether the script can be executed on Linux OS.

macos_supportedBoolean

Whether the script can be executed on macOS.

script_uidString

GUID, global ID of the script, used toidentify the script when executing.

entry_pointString

name of the entry point selected for the script defined as run.

script_inputArray
nameString
typeString
friendly_nameString
script_output_typeString (Enum)

Type of output.

Allowed values:"auto_detect""dictionary""number_list""number""string""string_list""boolean_list""ip""ip_list""boolean"
script_output_dictionary_definitionsArray

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_nameString
nameString
typeString
RESPONSE
{ "reply": { "script_id": "<script ID>", "name": "list_directories", "description": "List all directories under path", "modification_date": 1585074627259, "created_by": "Palo Alto Networks", "is_high_risk": false, "windows_supported": true, "linux_supported": true, "macos_supported": true, "script_uid": "<unique ID>", "entry_point": "run", "script_input": [ { "name": "path", "type": "string" }, { "friendly_name": "Number of levels", "name": "num_levels", "type": "number" } ], "script_output_type": "dictionary", "script_output_dictionary_definitions": [ { "friendly_name": "Number Of Processes", "name": "output_2", "type": "number" }, { "friendly_name": "Name", "name": "output_1", "type": "string" } ] } }

Bad Request. Got an invalid JSON.

Body
err_codeString

HTTP response code.

err_msgString

Error message.

Example:"{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}"
err_extraString

Additional information describing the error.

RESPONSE
{ "err_code": "err_code_example", "err_msg": "{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}", "err_extra": "err_extra_example" }

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

Body
err_codeString

HTTP response code.

err_msgString

Error message.

Example:"{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}"
err_extraString

Additional information describing the error.

RESPONSE
{ "err_code": "err_code_example", "err_msg": "{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}", "err_extra": "err_extra_example" }

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

Body
err_codeString

HTTP response code.

err_msgString

Error message.

Example:"{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}"
err_extraString

Additional information describing the error.

RESPONSE
{ "err_code": "err_code_example", "err_msg": "{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}", "err_extra": "err_extra_example" }

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

Body
err_codeString

HTTP response code.

err_msgString

Error message.

Example:"{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}"
err_extraString

Additional information describing the error.

RESPONSE
{ "err_code": "err_code_example", "err_msg": "{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}", "err_extra": "err_extra_example" }

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

Body
err_codeString

HTTP response code.

err_msgString

Error message.

Example:"{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}"
err_extraString

Additional information describing the error.

RESPONSE
{ "err_code": "err_code_example", "err_msg": "{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}", "err_extra": "err_extra_example" }