Device policy run results

Retrieve the results of a policy at the device level for a given execution token

SecuritybearerAuth
Request
path Parameters
policy_uuid
required
string <uuid>

Policy UUID

Examples:
56c0ba07-69f2-4f7c-b0a1-2bb0ed68578e
exec_token
required
string <uuid>

Execution Token

Examples:
10af9475-fd20-4189-bb9c-e1c707ff2670
query Parameters
org
required
string <uuid>

Organization UUID

Examples:
org=56c0ba07-69f2-4f7c-b0a1-2bb0ed68578e
sort
string

Sort by run_time, device_display_name, or result_status

Examples:
sort=run_time:asc
result_status
string

Filter by Policy run result: applied, failed, pending, not_applicable, not_included. Format: result_status:in[]=applied. Available operators: equals, in

Examples:
result_status=applied
device_name
string

Filter by the device name. This will search both device hostname and custom name.Format: device_name:like=WIN-RM1OMA6IBCA

Examples:
device_name=Marcus' Macbook Pro
page
integer <int32>

The page of results you wish to be returned with page numbers starting at 0. See About Automox API - Pagination

Examples:
page=0
limit
integer <int32> <= 5000

Default is 25, max is 5000

Examples:
limit=25
Responses
200

OK

400

Bad Request

401

Unauthorized

403

Unauthorized Action

404

Not Found

408

Request Timeout

429

Rate Limit

500

Service Unavailable

get/policy-history/policies/{policy_uuid}/{exec_token}
Request samples
$apiKey = 'your_automox_api_key'
$axOrgUUID = 'your_automox_org_uuid'
$axPolicyUUID = 'your_policy_uuid'
$axExecToken = 'your_execution_token'
$query = '?org=' + $axOrgUUID
$headers = @{
  "Authorization" = "Bearer $apiKey"
  "Content-Type" = "application/json"
  }
$url = "https://policyreport.automox.com/policy-history/policies/$axPolicyUUID/$axExecToken"
$response = (Invoke-WebRequest -Method Get -Uri ($url + $query) -Headers $headers).Content
Response samples
application/json
{
  • "metadata": {
    • "current_page": 0,
    • "total_pages": 100,
    • "total_count": 1300,
    • "limit": 25,
    • "links": {
      • "previous": "",
      • "next": "policyreport.automox.com?page=1&limit=25"
      }
    },
  • "data": [
    • {
      • "device_id": 250624,
      • "device_uuid": "56c0ba07-69f2-4f7c-b0a1-2bb0ed68578e",
      • "hostname": "WIN-RM1OMA6IBCA",
      • "custom_name": "Marcus' Macbook Pro",
      • "display_name": "Marcus' Macbook Pro",
      • "result_status": "success",
      • "result-reason": "",
      • "run_time": "2024-03-27T12:23:45Z",
      • "event_time": "2024-03-27T12:23:45Z",
      • "patches": [
        • "KB123456",
        • "KB234567"
        ],
      • "stdout": "Successfully installed KB123456\nSuccessfully installed KB234567\n",
      • "stderr": "",
      • "error_code": 1,
      • "device_deleted_at": "2024-03-27T12:23:45Z",
      • "policy_uuid": "56c0ba07-69f2-4f7c-b0a1-2bb0ed68578e",
      • "policy_name": "Patch Tuesday",
      • "policy_type": "patch"
      }
    ]
}