List all policy stats

Retrieve policy compliance statistics for all policies

get
/policystats

https://console.automox.com/api/policystats
Request
Response
Request
Headers
Authorization: Bearer
required
string
Your Automox API Key for authentication. Format: Authorization: Bearer your_automox_api_key
Query Parameters
o
optional
integer
Organization ID for retrieving policy stats. Omit this to retrieve stats for policies in all organizations that the authenticated user can access
Response
200: OK
{
"type": "array",
"items": {
"type": "object",
"properties": {
"compliant": {
"type": "integer",
"format": "int64"
},
"noncompliant": {
"type": "integer",
"format": "int64"
},
"organization_id": {
"type": "integer",
"format": "int64"
},
"pending": {
"type": "integer",
"format": "int64"
},
"policy_id": {
"type": "integer",
"format": "int64"
},
"policy_name": {
"type": "string"
},
"policy_type_name": {
"type": "string"
}
}
}
}

Example Requests

cURL
Python http.client
Python requests
C#
PowerShell
cURL
curl -X GET \
'https://console.automox.com/api/policystats?o=0000' \
-H 'Authorization: Bearer your_automox_api_key'
Python http.client
import http.client
conn = http.client.HTTPConnection("console,automox,com")
headers = {
'Authorization': "Bearer your_automox_api_key"
}
conn.request("GET", "api,policystats", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Python requests
import requests
url = "https://console.automox.com/api/policystats"
querystring = {"o":"0000"}
headers = {
'Authorization': "Bearer your_automox_api_key"
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
C#
var client = new RestClient("https://console.automox.com/api/policystats?o=0000");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer your_automox_api_key");
IRestResponse response = client.Execute(request);
PowerShell
$apiKey = 'your_automox_api_key'
$headers = @{ "Authorization" = "Bearer $apiKey" }
$url = "https://console.automox.com/api/policystats?o=0000"
Invoke-WebRequest -Method GET -Uri $url -Headers $headers