Category Filter
Remove File
This API request creates a remote action, so targeted devices delete listed file paths from their local storage. This is generally used to clean up files that were previously distributed to devices (files that went through the Generate Presigned Upload URL, Upload to Amazon S3, Verify File Upload, and Deploy File lifecycle).
Note: This API is only supported on macOS and Android platforms.
| Argument | Type | Description |
|---|---|---|
| file_paths | Array | Destination path or path/filename to be removed |
| users | Array | IDs of the users |
| usergroups | Array | IDs of the user groups |
| devices | Array | IDs of the devices |
| devicegroups | Array | IDs of the device groups |
(Note: At least one of users, usergroups, devices, or devicegroups must be non-empty).
HTTP Request:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
POST https://<portal>.hexnodemdm.com/api/v1/actions/remove-file/ headers:- Authorization: <api key> Content-Type: application/json Sample Post Data:- { "file_paths": ["/user/local/docs/report.pdf"], "users": [2, 3], "usergroups": [4], "devices": [5, 6], "devicegroups": [12] } |
Shell Command:
|
1 |
curl -H "Authorization: <api key>" -H "Content-Type: application/json" -d '{"file_paths":["/user/local/docs/report.pdf"],"users":[2,3],"usergroups":[4],"devices":[5,6],"devicegroups":[12]}' https://<portal>.hexnodemdm.com/api/v1/actions/remove-file/ |
HTTP Response:
|
1 2 3 |
{ "message": "Action Created" } |