# Add a new Restrictions payload configuration to an existing profile To create Restrictions policy ## Endpoints **POST** `/api/v1/mdm/profiles/{profile_id}/payloads/restrictionspolicy` ## Request URL ``` https://{serverurl}/api/v1/mdm/profiles/{profile_id}/payloads/restrictionspolicy ``` ## Scope ``` MDMOnDemand.MDMDeviceMgmt.CREATE ``` ## Header ``` Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52 ``` ## Request Parameters ### Path Parameters - **profile_id** `string` (Mandatory) Unique identifier of the profile. Obtain from the [Create Profile](https://www.manageengine.com/mobile-device-management/help/api/cloud/profiles-create-profile.html) or [Get Profiles](https://www.manageengine.com/mobile-device-management/help/api/cloud/profiles-get-profile.html) response. ### Query Parameters - **t** `long` (Optional) - **ignoreHeader** `boolean` (Optional) - **qlt** `long` (Optional) - **previousTab** `string` (Optional) - **service** `string` (Optional) - **search** `string` (Optional) Free-text search string applied to the default searchable fields of the resource - **all** `boolean` (Optional) - **dc_customerid** `long` (Optional) - **mdm_instance** `string` (Optional) - **signupsrc** `string` (Optional) - **zaaid** `string` (Optional) - **command** `string` (Optional) - **orderby** `string` (Optional) - **sortorder** `string` (Optional) - **select_all** `boolean` (Optional) When true, applies the operation to every record matching the current filter rather than to specific IDs. Default: false - **zoho-internal** `boolean` (Optional) - **dc_instance** `string` (Optional) - **SUBREQUEST** `string` (Optional) - **source** `string` (Optional) - **nocache** `long` (Optional) param to avoid being served from cache - **wms_csrparam** `string` (Optional) CSRF Token ### Request Body `application/json` JSON object containing Restrictions payload configuration. #### Sample Request Body ```json { "allow_app_installation": true, "allow_face_time": true, "allow_assistant": true, "allow_modifi_passcode": true, "allow_use_of_camera": true, "allow_app_removal": true, "allow_airdrop": true, "allow_screen_capture": true, "allow_imessage": true, "allow_sync_while_roaming": true } ``` ## Sample Request ### Curl ```bash curl --request POST \ --url https://appdomain/api/v1/mdm/profiles/{profile_id}/payloads/restrictionspolicy \ --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \ --header 'content-type: application/json' \ --data '{}' ``` ### Java ```java import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.io.IOException; import java.net.http.HttpTimeoutException; public class Main { public static void main(String[] args) { HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://appdomain/api/v1/mdm/profiles/{profile_id}/payloads/restrictionspolicy")) .header("content-type", "application/json") .header("Authorization", "Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52") .method("POST", HttpRequest.BodyPublishers.ofString("{}")) .build(); HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } } ``` ### Python ```python import http.client conn = http.client.HTTPSConnection("appdomain") payload = "{}" headers = { 'content-type': "application/json", 'Authorization': "Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52" } conn.request("POST", "/api/v1/mdm/profiles/{profile_id}/payloads/restrictionspolicy", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ### Deluge ```javascript headersMap = Map(); headersMap.put("Content-Type", "application/json"); headersMap.put("Accept", "application/json"); data = Map(); response = invokeUrl [ url: "https://appDomain/api/v1/mdm/profiles/{profile_id}/payloads/restrictionspolicy" type: POST headers: headersMap body: data connection: connection_name ] info response; ``` ### PowerShell ```powershell $headers=@{} $headers.Add("content-type", "application/json") $headers.Add("Authorization", "Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52") $response = Invoke-WebRequest -Uri 'https://appdomain/api/v1/mdm/profiles/{profile_id}/payloads/restrictionspolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}' ``` ## Response Parameters ### HTTP 200 Response Body: `application/json` - **payload_id** `long` Unique identifier for the created payload item - **allow_app_installation** `boolean` - **allow_app_removal** `boolean` - **allow_use_of_camera** `boolean` - **allow_face_time** `boolean` - **allow_airdrop** `boolean` - **allow_imessage** `boolean` - **allow_modifi_passcode** `boolean` - **allow_screen_capture** `boolean` - **allow_sync_while_roaming** `boolean` - **allow_assistant** `boolean` - **allow_assistant_when_locked** `boolean` - **force_assist_profanity_filter** `boolean` - **allow_assistant_user_content** `boolean` - **allow_touch_id** `boolean` - **allow_passbook_when_locked** `boolean` - **show_control_center** `boolean` - **show_notification_center** `boolean` - **show_today_view** `boolean` - **allow_voice_dialing** `boolean` - **allow_inapp_purchase** `boolean` - **force_istore_pwd_entry** `boolean` - **allow_game_center** `boolean` - **allow_multiplayer_gaming** `boolean` - **allow_add_game_center_friend** `boolean` - **allow_use_of_youtube** `boolean` - **allow_use_of_ibookstore** `boolean` - **allow_ibookstore_erotica_media** `boolean` - **allow_itunes** `boolean` - **allow_safari** `boolean` - **safari_allow_autofill** `boolean` - **safari_force_fraud_warning** `boolean` - **safari_allow_javascript** `boolean` - **safari_allow_popups** `boolean` - **safari_accept_cookies** `integer` Allowed values: 0=Never, 1=From current website only, 2=Always - **allow_cloud_backup** `boolean` - **allow_cloud_document_sync** `boolean` - **allow_photo_stream** `boolean` - **allow_shared_stream** `boolean` - **allow_diagnostic_submission** `boolean` - **allow_untrusted_tls_prompt** `boolean` - **allow_ota_pki_updates** `boolean` - **force_encrypted_backup** `boolean` - **force_limited_ad_tracking** `boolean` - **allow_profile_installation** `boolean` - **allow_account_modification** `boolean` - **allow_find_my_friends_mod** `boolean` - **allow_host_pairing** `boolean` - **allow_app_cellular_data** `boolean` - **allow_open_doc_in_unmanaged** `boolean` - **allow_open_doc_in_managed** `boolean` - **allow_explicit_content** `boolean` - **is_rating_enabled** `boolean` - **country_code** `string` - **movies_rating_value** `integer` - **tv_shows_rating_value** `integer` - **apps_rating_value** `integer` - **allowed_camera_restriction_app_id** `array` Use the app_group_id from the [Apps API](https://www.manageengine.com/mobile-device-management/help/api/cloud/app-management-get-an-app.html) response (Additional response fields correspond to the full set of request body restriction attributes.) ## Sample Response ### HTTP 200 ```json { "payload_id": 9007199254741000, "allow_app_installation": true, "allow_face_time": true, "allow_assistant": true, "allow_modifi_passcode": true, "allow_use_of_camera": true, "allow_app_removal": true, "allow_airdrop": true, "allow_screen_capture": true, "allow_imessage": true, "allow_sync_while_roaming": true } ``` ## Possible Response Codes - **200** — Success