Get Script Execution Status

Cortex XDR REST API

post /public_api/v1/scripts/get_script_execution_status

Retrieve the status of a script execution action.

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_execution_status" \ -d '{ "request_data" : { "action_id" : "action_id" } }'
Response
{ "reply": { "general_status": "PENDING", "endpoints_pending": 1, "endpoints_canceled": 0, "endpoints_in_progress": 0, "endpoints_timeout": 0, "endpoints_failed": 0, "endpoints_completed_successfully": 0, "endpoints_pending_abort": 0, "endpoints_aborted": 0, "endpoints_expired": 0 } }
Request
Body
optional
Example: {"request_data":{"action_id":""}}
request_data
required
A dictionary containing the API request fields.
action_id
required
String
Identifier of the action, can be found in Cortex XDR console Response > Action Center > Action ID field.
Responses

Successful response

Body
reply
optional
JSON object containing the query result.
general_status
optional
String
General status of the action, considering the status of all the endpoints.
endpoints_pending
optional
Integer
Number of endpoints in pending status.
endpoints_canceled
optional
Integer
Number of endpoints in “canceled” status.
endpoints_in_progress
optional
Integer
Number of endpoints in “in progress” status.
endpoints_timeout
optional
Integer
Number of endpoints in “timeout” status.
endpoints_failed
optional
Integer
Number of endpoints in “failed” status.
endpoints_completed_successfully
optional
Integer
Number of endpoints in “completed successfully” status.
endpoints_pending_abort
optional
Integer
Number of endpoints in “pending abort” status.
endpoints_aborted
optional
Integer
Number of endpoints in “aborted” status.
endpoints_expired
optional
Integer
Number of endpoints in “expired” status.
error_message
optional
String
Error message regarding permissions for running APIs or stating that the action doesn’t exist.

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.