{"id":5029,"date":"2026-03-31T10:47:24","date_gmt":"2026-03-31T10:47:24","guid":{"rendered":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/?page_id=5029"},"modified":"2026-04-01T04:37:38","modified_gmt":"2026-04-01T04:37:38","slug":"api-to-generate-pre-signed-upload-url","status":"publish","type":"page","link":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/content-management\/api-to-generate-pre-signed-upload-url\/","title":{"rendered":"Generate pre-signed upload URL"},"content":{"rendered":"<div class=\"method-copy\">\n<div class=\"method-copy-padding\">\n<h2>Generate Presigned Upload URL<\/h2>\n<p>Generating a presigned upload URL is the first step in the file management lifecycle. This API request starts a file upload process by recording the intended file and returning a time-limited (180 minutes) Amazon S3 presigned PUT URL and a file_uuid. Once this step is complete, you will proceed to upload the actual file to the generated URL and <a href=\"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/content-management\/api-to-verify-file-upload\/\" target=\"_blank\" rel=\"noopener noreferrer\">verify it<\/a>.<\/p>\n<div class=\"table-responsive\">\n<table id=\"table_82937410\" 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_name<\/td>\n<td>String<\/td>\n<td>Name of the file with extension (e.g., report.pdf)<\/td>\n<\/tr>\n<tr>\n<td>content_type<\/td>\n<td>String<\/td>\n<td>Optional MIME type; defaults to application\/octet-stream<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Upload File to Amazon S3 <\/strong><br \/>\nAfter generating the presigned URL, upload the actual file to Amazon S3. Make sure the Content-Type header matches exactly what you specified during the URL generation step.<br \/>\n<strong>Shell Command Example: <\/strong><br \/>\n<em>Bash<\/em><br \/>\ncurl -X PUT \\<br \/>\n-H &#8220;Content-Type: application\/pdf&#8221; \\<br \/>\n-T &#8220;\/path\/to\/your\/report.pdf&#8221; \\<br \/>\n&#8220;{PRESIGNED_URL_FROM_PREVIOUS_STEP}&#8221;\n<\/div>\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\/filemanagement\/generate-presigned-upload-url\/\r\nheaders:-\r\nAuthorization: <api key>\r\nContent-Type: application\/json\r\nSample Post Data:-\r\n{  \r\n\"file_name\": \"report.pdf\",  \r\n\"content_type\": \"application\/pdf\"  \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_name\":\"report.pdf\",\"content_type\":\"application\/pdf\"}' https:\/\/<portal>.hexnodemdm.com\/api\/v1\/filemanagement\/generate-presigned-upload-url\/\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  \"presigned_url\": \"<S3 presigned PUT URL>\", \r\n  \"file_name\": \"<same as request>\", \r\n  \"file_uuid\": \"<UUID string for subsequent confirm step>\" \r\n}\r\n<\/pre>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Generate Presigned Upload URL Generating a presigned upload URL is the first step in the file management lifecycle. This API request starts a file upload process by recording the intended file and returning a time-limited (180 minutes) Amazon S3 presigned PUT URL and a file_uuid. Once this step is complete, you will proceed to upload [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"parent":5031,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"class_list":["post-5029","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/pages\/5029","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=5029"}],"version-history":[{"count":6,"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/pages\/5029\/revisions"}],"predecessor-version":[{"id":5053,"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/pages\/5029\/revisions\/5053"}],"up":[{"embeddable":true,"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/pages\/5031"}],"wp:attachment":[{"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/media?parent=5029"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}