Scheduled daily device reboot not available in Console: use Esper API with external scheduler
Android
The Esper Console does not include a built-in scheduler for recurring device reboots. If you need to reboot devices at a fixed time every day, you can use the Esper API combined with an external scheduler to automate this task.
Before you begin
- Verify that your devices are enrolled in Esper and online.
- Generate an API key if you don't have one. Go to Console → Settings → API Key Management and create a new key with appropriate permissions.
- Identify the device IDs or group ID for the devices you want to reboot.
Step 1: Get your API key
- In the Esper Console, navigate to Settings → API Key Management.
- Create a new API key or copy an existing one.
- Keep this key secure — you'll use it to authenticate API requests.
Step 2: Retrieve the list of devices in your group (optional)
If you're rebooting all devices in a group, retrieve the device list first:
GET https://{tenant}.esper.cloud/api/v0/enterprise/{enterprise_id}/device/?group={group_id}
Replace {tenant}, {enterprise_id}, and {group_id} with your actual values. This returns a list of device IDs you'll need for the next step.
Step 3: Call the Esper API reboot command
Send a POST request to the reboot endpoint for each device:
POST https://{tenant}.esper.cloud/api/v0/enterprise/{enterprise_id}/devices/{device_id}/command/
Body:
{
"command_type": "REBOOT"
}
Include your API key in the request headers for authentication. For full details on headers and payload options, see the Scheduling API Commands guide.
Step 4: Set up an external scheduler
Wrap the API calls in a script and schedule it to run at your desired time. Choose one of these approaches:
-
Linux/macOS cron job: Create a cron job that runs at 4:00 AM daily. Example:
0 4 * * * /usr/bin/python3 /path/to/reboot_script.py - Windows Task Scheduler: Create a scheduled task to run a batch file or PowerShell script at your desired time.
- Cloud automation tools: Use GitHub Actions, AWS EventBridge + Lambda, or similar services to trigger your API calls on a schedule.
Step 5: Verify the scheduled reboot
- After the first scheduled run, go to Devices & Groups → [Device Name] → Commands History.
- Confirm that a REBOOT command was received and executed successfully at the expected time.
- Check the device's last-seen timestamp to verify it rebooted.
Troubleshooting
API returns "401 Unauthorized"
Your API key is invalid or has insufficient permissions. Regenerate or verify the key under Console → Settings → API Key Management.
REBOOT command shows as "Queued" and doesn't execute
The device may be offline at the scheduled time. Commands queue and execute on the next check-in, which may not align with your intended reboot window. Verify device connectivity before the scheduled reboot time, or use a scheduler that retries if the device is offline.
Multiple devices are not responding to reboot commands
Ensure devices are online and actively managed (not deprovisioned). Check device connectivity in Devices & Groups before the scheduled window.
Still need help?
If you need assistance designing or debugging your reboot script, contact Esper Support. Our team can help you troubleshoot API issues or recommend the best scheduler for your infrastructure.
Please sign in to leave a comment.
Comments
0 comments