# Create a new MDM profile Create the profile based on the platform ## Endpoints **POST** `/api/v1/mdm/profiles` ## Request ### Request URL ``` https://{serverurl}/api/v1/mdm/profiles ``` ### Scope ``` MDMOnDemand.MDMDeviceMgmt.CREATE ``` ### Header ``` Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52 ``` ### Request Body **Content-Type:** `application/json` **Type:** JSON object #### Parameters - **profile_name** (string) — Mandatory Name of the profile (required) - **profile_description** (string) — Optional Description of the profile - **platform_type** (integer) — Mandatory Profile platform type: - 1 - iOS - 2 - Android - 3 - Windows - 4 - Chrome - 5 - MAC - 6 - Apple TV - **scope** (integer) — Optional Scope of the profile (default - 0). - **Android:** 0 - devices, 1 - knox container - **Chrome:** 0 - devices, 2 - user ## Sample Request ### Curl ```bash curl --request POST \ --url https://appdomain/api/v1/mdm/profiles \ --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \ --header 'content-type: application/json' \ --data '{"profile_name":"IOS Restrictions Policy","platform_type":1}' ``` ### 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")) .header("content-type", "application/json") .header("Authorization", "Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52") .method("POST", HttpRequest.BodyPublishers.ofString("{\"profile_name\":\"IOS Restrictions Policy\",\"platform_type\":1}")) .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 = "{\"profile_name\":\"IOS Restrictions Policy\",\"platform_type\":1}" headers = { 'content-type': "application/json", 'Authorization': "Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52" } conn.request("POST", "/api/v1/mdm/profiles", 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(); data.put("profile_name","value"); data.put("platform_type","1"); response = invokeUrl [ url: "https://appDomain/api/v1/mdm/profiles" 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' -Method POST -Headers $headers -ContentType 'application/json' -Body '{"profile_name":"IOS Restrictions Policy","platform_type":1}' ``` ## Sample Request Body ### Create an iOS restrictions profile with default scope ```json { "profile_name": "IOS Restrictions Policy", "platform_type": 1, "scope": 0, "profile_description": "Test IOS Restrictions Policy" } ``` ### Create an Android profile with Knox container scope ```json { "profile_name": "Android Work Profile", "platform_type": 2, "scope": 1, "profile_description": "Android enterprise policy" } ``` ## Response ### HTTP 200 **Response Body:** `application/json` **Type:** JSON object #### Parameters - **profile_id** (long) Unique identifier for the created profile - **profile_name** (string) Name of the profile - **profile_description** (string) Description of the profile - **platform_type** (integer) Profile platform type: - 1 - iOS - 2 - Android - 3 - Windows - 4 - Chrome - 5 - MAC - 6 - Apple TV - **scope** (integer) Scope of the profile - **profile_version** (integer) Current version of the profile - **profile_status** (string) Status of the profile - **profile_status_id** (integer) Status ID: - 1 - Yet to Deploy - 110 - Published - **collection_id** (long) Collection ID of the profile - **payloads** (array) List of payload type names in the profile - **creation_time** (long) Creation timestamp in milliseconds since epoch - **last_modified_time** (long) Last modified timestamp in milliseconds since epoch - **created_by** (long) User ID of the creator - **last_modified_by** (long) User ID of the last modifier - **is_moved_to_trash** (boolean) Whether the profile has been moved to trash ### Sample Response: HTTP 200 Profile successfully created with initial metadata ```json { "creation_time": 12312321312312, "last_modified_time": 213123213123, "profile_version": 1, "payloads": [], "last_modified_by": 213900719925474100000, "profile_description": "Test IOS Restrictions Policy", "created_by": 21321312312, "collection_id": 2132131231241, "profile_name": "IOS Restrictions Policy", "profile_status": "Yet To Deploy", "platform_type": 1, "is_moved_to_trash": false, "profile_id": 12321312312, "scope": 0, "profile_status_id": 1 } ``` ## Possible HTTP Status Codes - **200** — HTTP code ## Rate Limiting **Duration:** 1 minute **Threshold:** 30 **Lock period:** 5 minutes - **Duration** - Time window for the threshold. - **Threshold** - Number of API calls allowed within the specified duration. - **Lock Period** - Wait time before consecutive API requests.