{"id":5037,"date":"2026-03-31T11:20:22","date_gmt":"2026-03-31T11:20:22","guid":{"rendered":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/?page_id=5037"},"modified":"2026-04-01T04:38:21","modified_gmt":"2026-04-01T04:38:21","slug":"file-deployment-via-api","status":"publish","type":"page","link":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/actions\/file-deployment-via-api\/","title":{"rendered":"Deploy Files"},"content":{"rendered":"<div class=\"method-copy\">\n<div class=\"method-copy-padding\">\n<h2>Deploy File<\/h2>\n<p>This API request creates a deploy-file action to copy file(s) to a destination path on targeted devices or users.<br \/>\n<strong>Prerequisite:<\/strong> Before deploying a file, it must be fully uploaded and cataloged on the server. This involves <a href=\"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/content-management\/api-to-generate-pre-signed-upload-url\/\" target=\"_blank\" rel=\"noopener noreferrer\">Generate Presigned Upload URL<\/a>, uploading the file via the Amazon S3 URL, and confirming it via <a href=\"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/content-management\/api-to-verify-file-upload\/\" target=\"_blank\" rel=\"noopener noreferrer\">Verify File Upload<\/a>.<br \/>\n<strong>Note:<\/strong> This API is only supported on macOS and Android platforms.<\/p>\n<div class=\"table-responsive\">\n<table id=\"table_73829104\" class=\"table table-bordered\" width=\"100%\">\n<thead>\n<tr>\n<th width=\"15%\"><strong>Argument<\/strong><\/th>\n<th width=\"12%\"><strong>Type<\/strong><\/th>\n<th width=\"30%\"><strong>Description<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>file_ids<\/td>\n<td>Array<\/td>\n<td>IDs of the files to deploy (must be active and exist)<\/td>\n<\/tr>\n<tr>\n<td>file_path<\/td>\n<td>String<\/td>\n<td>Destination path on the device (leading \/ added if missing)<\/td>\n<\/tr>\n<tr>\n<td>users<\/td>\n<td>Array<\/td>\n<td>IDs of the users<\/td>\n<\/tr>\n<tr>\n<td>usergroups<\/td>\n<td>Array<\/td>\n<td>IDs of the user groups<\/td>\n<\/tr>\n<tr>\n<td>devices<\/td>\n<td>Array<\/td>\n<td>IDs of the devices<\/td>\n<\/tr>\n<tr>\n<td>devicegroups<\/td>\n<td>Array<\/td>\n<td>IDs of the device groups<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><em>(Note: At least one of users, usergroups, devices, or devicegroups must be non-empty).<\/em><\/p>\n<\/div>\n<\/div>\n<div class=\"method-example\">\n<div class=\"curl-text\">curl<\/div>\n<div class=\"code-curl code-div active-code\">\n<div class=\"method-example-part\">\n<p>HTTP Request:<\/p>\n<pre class=\"lang:default decode:true\">POST https:\/\/<portal>.hexnodemdm.com\/api\/v1\/actions\/deploy-file\/\r\nheaders:-\r\nAuthorization: <api key>\r\nContent-Type: application\/json\r\nSample Post Data:-\r\n{  \r\n\"file_ids\": [101, 102],  \r\n\"file_path\": \"\/user\/local\/docs\/\",  \r\n\"users\": [2, 3],  \r\n\"usergroups\": [4],  \r\n\"devices\": [5, 6],  \r\n\"devicegroups\": [12]  \r\n}\r\n<\/pre>\n<p>Shell Command:<\/p>\n<pre class=\"lang:default decode:true\"> curl -H \"Authorization: <api key>\" -H \"Content-Type: application\/json\" -d '{\"file_ids\":[101, 102],\"file_path\":\"\/user\/local\/docs\/\",\"users\":[2,3],\"usergroups\":[4],\"devices\":[5,6],\"devicegroups\":[12]}' https:\/\/<portal>.hexnodemdm.com\/api\/v1\/actions\/deploy-file\/\r\n<\/pre>\n<\/div>\n<\/div>\n<div class=\"code-curl code-div active-code\">\n<div class=\"method-example-part\">\n<p>HTTP Response:<\/p>\n<pre class=\"lang:default decode:true\">{ \r\n  \"message\": \"Action Created\" \r\n}\r\n<\/pre>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Deploy File This API request creates a deploy-file action to copy file(s) to a destination path on targeted devices or users. Prerequisite: Before deploying a file, it must be fully uploaded and cataloged on the server. This involves Generate Presigned Upload URL, uploading the file via the Amazon S3 URL, and confirming it via Verify [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"parent":3698,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"class_list":["post-5037","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/pages\/5037","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/comments?post=5037"}],"version-history":[{"count":5,"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/pages\/5037\/revisions"}],"predecessor-version":[{"id":5058,"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/pages\/5037\/revisions\/5058"}],"up":[{"embeddable":true,"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/pages\/3698"}],"wp:attachment":[{"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/media?parent=5037"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}