Create a schedule to execute Remote Restart or Shutdown on devices in groups

Open in ChatGPT Open in ChatGPT to ask questions about this page
Open in Claude Open in Claude to ask questions about this page
Copy as MarkdownCopy this page as markdown to use with AI assistants
View as Markdown Open this page as markdown in a new tab

Create the scheduler for the restart and shutdown action to perform in the devices or groups

Request URL

https://{server-hostname}:8383/api/v1/mdm/actions/scheduled/{action_name}

Scope

MDMDeviceMgmt.CREATECopied!

Header

Authorization: d92d4xxxxxxxxxxxxx15f52

Request Parameters

- Request Headers

Content-TypestringMandatory
application/jsonapplication/jsonCopied!
AcceptstringMandatory
application/jsonapplication/jsonCopied!

- Path Parameters

action_namestringMandatory

Name of the scheduled action

- Request Body

application/json
JSON Object
Hide Sub-Attributes
groupsarrayMandatory

Array of group IDs with devices that need to be restarted or shutdown (required)

time_zonestringOptional

Timezone for which the scheduled action is to be executed (required)

schedule_paramsJSON ObjectOptional

Parameters for the schedule (required)

Show Sub-Attributes
schedule_typestringOptional

Schedule Type: Daily, Weekly, or Monthly

daily_interval_typestringOptional

Type of daily schedule: everyday, weekDays, or alternativeDays (Daily only)

daily_timestringOptional

Execution time for daily type schedule (Daily only)

days_of_weekstringOptional

Comma-separated days of the week (Weekly only)

weekly_timestringOptional

Execution time for weekly type schedule (Weekly only)

monthly_performstringOptional

Type of monthly schedule: WeekDay or Day (Monthly only)

monthly_daystringOptional

Day of the month for execution (Monthly only)

monthly_timestringOptional

Execution time for monthly type schedule (Monthly only)

monthly_week_daystringOptional

Day of the week for monthly type schedule (Monthly only)

monthly_week_numstringOptional

Execution week for monthly type schedule (Monthly only)

months_liststringOptional

Comma-separated list of months for monthly schedule (Monthly only)

scheduler_disabledstringOptional

Value indicating whether the schedule is disabled

reason_messagestringOptional

Reason for scheduling the action, used for auditing purposes (required)

execution_typeintegerOptional

Type of execution: 1 = Once, 2 = Repeat (required)

expirylongOptional

Time in milliseconds at which the scheduled command expires (required)

schedule_once_timelongOptional

Current time in milliseconds when action is scheduled to be executed once (required)

action_namestringOptional

Name of the action: restart or shutdown

Sample Request

Curl
Java
Python
Deluge
PowerShell
Copied!
curl --request POST \
  --url https://appdomain/api/v1/mdm/actions/scheduled/{action_name} \
  --header 'Accept: application/json' \
  --header 'Authorization:  d92d4xxxxxxxxxxxxx15f52' \
  --header 'Content-Type: application/json' \
  --data '{"schedule_params":{"schedule_type":"Daily","daily_time":"10/25/2018, 15:30","daily_interval_type":"everyDay"},"reason_message":"Maintenance","action_name":"restart","groups":["9007199254741037","9007199254741038","9007199254741039"],"execution_type":2,"expiry":600000,"time_zone":"America/Los_Angeles","schedule_once_time":1627970696000}'

Sample Request Body

Create a daily restart schedule for 3 device groups

Copied!
  {
    "schedule_params": {
      "schedule_type": "Daily",
      "daily_time": "10/25/2018, 15:30",
      "daily_interval_type": "everyDay"
    },
    "reason_message": "Maintenance",
    "action_name": "restart",
    "groups": [
      "9007199254741037",
      "9007199254741038",
      "9007199254741039"
    ],
    "execution_type": 2,
    "expiry": 600000,
    "time_zone": "America/Los_Angeles",
    "schedule_once_time": 1627970696000
  }
                
Show full

Create a weekly shutdown schedule on Mon/Wed/Fri

Copied!
  {
    "schedule_params": {
      "days_of_week": "1,3,5",
      "schedule_type": "Weekly",
      "weekly_time": "1800"
    },
    "reason_message": "End of day shutdown",
    "action_name": "shutdown",
    "groups": [
      "9007199254741052",
      "9007199254741053"
    ],
    "execution_type": 2,
    "expiry": 600000,
    "time_zone": "America/New_York",
    "schedule_once_time": 1627970696000
  }
                
Show full

Possible Response Codes

202HTTP code

Sample Response: HTTP 202

Copied!
202 Accepted
Show full

Duration: 1 minute | Threshold: 30 | Lock period: 5 minutes

Duration - Time window for the threshold.
Threshold - Number of API calls allowed within the specified duration.
Lock Period - Wait time before consecutive API requests.