How do I create a worklet through Automox API?
There is a way to create worklets via API! To start, head to this page: https://developer.automox.com/openapi/axconsole/operation/createPolicy/
You must select "custom" under the policy_type_name field:
"custom" signifies "worklet". The other options are "patch" and "required_software".
Here is an example of one that works (that is Mac/Linux based, mind you):
curl -vv 'https://console.automox.com/api/policies?o=####' \
-H 'authorization: Bearer <api_key>' \
-H 'content-type: application/json' \
--data-raw '{"name":"Test Worklet 2","policy_type_name":"custom","organization_id":####,"configuration":{"os_family":"Windows","remediation_code":"# remediate","evaluation_code":"# test","installation_code":"","use_scheduled_timezone":false,"auto_reboot":false,"notify_reboot_user":false},"schedule_days":254,"schedule_weeks_of_month":62,"schedule_months":8190,"schedule_time":"00:00","notes":"","create_time":"","server_groups":[]}'
Here is another API test that works (through Postman using the "Payload" option in the API documentation):
{
"name": "Worklet Test AD 711 Number 2",
"policy_type_name": "custom",
"organization_id": <org_id>,
"schedule_days": 42,
"schedule_weeks_of_month": 20,
"schedule_months": 4680,
"schedule_time": "12:00",
"configuration": {
"os_family": "Windows",
"auto_patch": true,
"notify_user": true,
"remediation_code":"# remediate",
"evaluation_code":"# test",
"auto_reboot": true,
"patch_rule": "all",
"filter_type": "all",
"missed_patch_window": false,
"device_filters_enabled": true,
"device_filters": [
{
"field": "tag",
"op": "in",
"value": [
"Windows",
"Win10"
]
}
],
"include_optional": true,
"notify_reboot_user": true,
"notify_deferred_reboot_user": true,
"custom_notification_patch_message": "Important updates are going to be installed!",
"custom_notification_patch_message_mac": "Important updates are going to be installed!",
"custom_notification_reboot_message": "Reboot needed to finish installing updates!",
"custom_notification_reboot_message_mac": "Reboot needed to finish installing updates!",
"custom_notification_max_delays": 3,
"custom_notification_deferment_periods": [
1,
4,
8
],
"custom_pending_reboot_notification_message": "Your computer needs to reboot to install updates!",
"custom_pending_reboot_notification_message_mac": "Your computer needs to reboot to install updates!",
"custom_pending_reboot_notification_deferment_periods": [
1,
4,
8
],
"notify_user_message_timeout": 15,
"notify_deferred_reboot_user_message_timeout": 15,
"notify_user_auto_deferral_enabled": true,
"notify_deferred_reboot_user_auto_deferral_enabled": true
},
"server_groups": [
],
"notes": "Here are some notes"
}
Comments
0 comments
Article is closed for comments.