{"id":3674,"date":"2018-10-16T10:38:26","date_gmt":"2018-10-16T10:38:26","guid":{"rendered":"http:\/\/34.238.172.127\/?page_id=39"},"modified":"2026-03-18T11:38:03","modified_gmt":"2026-03-18T11:38:03","slug":"create-policy","status":"publish","type":"page","link":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/policies\/create-policy\/","title":{"rendered":"Create Policy"},"content":{"rendered":"<div class=\"method-copy\">\n<div class=\"method-copy-padding\">\n<h2>Create Policy<\/h2>\n<p>Create a new policy.<\/p>\n<div class=\"table-responsive\">\n<table id=\"table_61516733\" class=\"table table-bordered\" width=\"100%\">\n<thead>\n<tr>\n<th width=\"16%\"><strong>Arguments<\/strong><\/th>\n<th width=\"15%\"><strong>Type<\/strong><\/th>\n<th width=\"25%\"><strong>Description<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>name<\/td>\n<td>String<\/td>\n<td>Name of the policy<\/td>\n<\/tr>\n<tr>\n<td>description<\/td>\n<td>String<\/td>\n<td>Description of the policy<\/td>\n<\/tr>\n<tr>\n<td>ios<\/td>\n<td>Dictionary<\/td>\n<td>Optional. If provided this dictionary, provide the following keys:<br \/>\n<strong>password<\/strong>, <strong>restrictions<\/strong>, <strong>advanced_restrictions<\/strong>, <strong>web_content_filter<\/strong>, <strong>wifi<\/strong>, <strong>email<\/strong>, <strong>activesync<\/strong>, <strong>ldap<\/strong>, <strong>caldav<\/strong>, <strong>subscribe_calendar<\/strong>, <strong>carddav<\/strong>, <strong>webclip<\/strong>, <strong>access_point<\/strong>, <strong>applock, wallpaper<\/strong>, <strong>globalproxy<\/strong>, <strong>lock_screen_msg<\/strong>, <strong>app_management<\/strong>. It can be set to null if nothing is configured<\/td>\n<\/tr>\n<tr>\n<td>android<\/td>\n<td>Dictionary<\/td>\n<td>Optional. If provided this dictionary, provide the following keys:<br \/>\n<strong>password<\/strong>, <strong>restrictions<\/strong>, <strong>wifi<\/strong>, <strong>email<\/strong>, <strong>activesync<\/strong>, <strong>applock<\/strong>, <strong>app_management<\/strong> and <strong>wallpaper<\/strong>. It can also be set to null if nothing configured<\/td>\n<\/tr>\n<tr>\n<td>general_settings<\/td>\n<td>Dictionary<\/td>\n<td>Optional. Dictionary for general_settings currently contains only a <strong>location_settings<\/strong> key. Its value is a dictionary that contains keys <strong>trackingdisabled<\/strong> and <strong>interval_minutes<\/strong>.<\/p>\n<div class=\"table-responsive\">\n<table id=\"table_61516733\" class=\"table table-bordered\" width=\"100%\">\n<thead>\n<tr>\n<th width=\"25%\"><strong><span style=\"color: black;\">Key<\/span><\/strong><\/th>\n<th width=\"15%\"><strong><span style=\"color: black;\">Type<\/span><\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><span style=\"color: black;\"> trackingdisabled <\/span><\/td>\n<td><span style=\"color: black;\"> Boolean <\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color: black;\"> interval_minutes <\/span><\/td>\n<td><span style=\"color: black;\"> Integer <\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>policy_targets<\/td>\n<td>Dictionary<\/td>\n<td>Optional. Policy targets support <strong>users<\/strong>, <strong>devices<\/strong>, <strong>usergroups<\/strong> and <strong>devicegroups<\/strong> and values are list of their respective IDs.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\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:\/\/.hexnodemdm.com\/api\/v1\/policy\/ \r\n<\/pre>\n<p>Shell Command:<\/p>\n<pre class=\"lang:default decode:true\">curl -H \"Authorization: \" -H \"Content-Type: application\/json\" -d '{\r\n \"name\": \"Sales Team Policy\",\"description\": \"\",\"ios\": {\r\n \"password\": {\r\n \"allow_simple\": true,\"require_alphanumeric\": false, \"max_failed_attempts\": 4,\"max_grace_period\": 5,\r\n \"max_inactivity\": 2,\"max_pinage_in_days\": 4,\"min_complex_chars\": 1,\"min_length\": 1,\"pin_history\": 4\r\n }} \r\n}' https:\/\/.hexnodemdm.com\/api\/v1\/policy\/ -X POST\r\n<\/pre>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Create Policy Create a new policy. Arguments Type Description name String Name of the policy description String Description of the policy ios Dictionary Optional. If provided this dictionary, provide the following keys: password, restrictions, advanced_restrictions, web_content_filter, wifi, email, activesync, ldap, caldav, subscribe_calendar, carddav, webclip, access_point, applock, wallpaper, globalproxy, lock_screen_msg, app_management. It can be set to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3672,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"class_list":["post-3674","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/pages\/3674","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/comments?post=3674"}],"version-history":[{"count":13,"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/pages\/3674\/revisions"}],"predecessor-version":[{"id":5017,"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/pages\/3674\/revisions\/5017"}],"up":[{"embeddable":true,"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/pages\/3672"}],"wp:attachment":[{"href":"https:\/\/www.hexnode.com\/mobile-device-management\/developers\/wp-json\/wp\/v2\/media?parent=3674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}