Start policy for immediate remediation

Schedule a policy for immediate remediation.

post
/policies/{id}/action

https://console.automox.com/api/policies/{id}/action
Request
Response
Request
Path Parameters
id
required
integer
Policy ID for the applicable policy
Headers
Authorization: Bearer
required
string
Your Automox API key for authentication Format: Authorization: Bearer your_automox_api_key
Query Parameters
o
required
string
Organization ID for the applicable Policy and Server
action
required
string
Specify the action to be taken. Possible values: remediateAll remediateServer Format: action=remediateServer
serverId
optional
integer
Specify the specific Server to run the policy for. Only applicable when action is set to "remediateServer" Format: serverId=123456
Response
200: OK

Example Requests

cURL
Python http.client
Python requests
C#
PowerShell
cURL
curl -X POST \
'https://console.automox.com/api/policies/12345/action?o=0000&action=remediateServer&serverId=123456' \
-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("POST", "api,policies,12345,action", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Python requests
import requests
url = "https://console.automox.com/api/policies/12345/action"
querystring = {"o":"0000","action":"remediateServer","serverId":"123456"}
headers = {
'Authorization': "Bearer your_automox_api_key"
}
response = requests.request("POST", url, headers=headers, params=querystring)
print(response.text)
C#
var client = new RestClient("https://console.automox.com/api/policies/12345/action?o=0000&action=remediateServer&serverId=123456");
var request = new RestRequest(Method.POST);
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/policies/12345/action?o=0000&action=remediateServer&serverId=123456"
Invoke-WebRequest -Method POST -Uri $url -Headers $headers