# Add a new VPN payload configuration to an existing profile Create Windows VPN policy payload ## Endpoint **POST** `/api/v1/mdm/profiles/{profile_id}/payloads/windowsvpnpolicy` ## Request URL `https://{server-hostname}:8383/api/v1/mdm/profiles/{profile_id}/payloads/windowsvpnpolicy` ## Scope `MDMDeviceMgmt.CREATE` ## Header `Authorization: d92d4xxxxxxxxxxxxx15f52` ## Request Parameters ### Request Headers - **Content-Type** `string` **Mandatory**: `application/json` - **Accept** `string` **Mandatory**: `application/json` ### Path Parameters - **profile_id** `string` **Mandatory** Unique identifier of the profile. Obtain from the [Create Profile](https://www.manageengine.com/products/desktop-central/help/api/onpremise/mdm-profiles-create-profile.html) or [Get Profiles](https://www.manageengine.com/products/desktop-central/help/api/onpremise/mdm-profiles-get-profile.html) response. ### Request Body `application/json` - **connection_name** `string` **Mandatory** Connection Name. Default: VPN Configuration - **connection_type** `integer` **Mandatory** Connection Type. Default: 0 - **l2tp** `JSON Object` Optional L2Tp - **pptp** `JSON Object` Optional Pptp - **customssl** `JSON Object` Optional Customssl - **ikev2** `JSON Object` Optional Ikev2 - **proxy_type** `integer` Optional Proxy Type. Default: 0 - **proxy_server** `string` Optional Proxy Server - **proxy_server_port** `integer` Optional Proxy Server Port. Default: 0 - **proxy_pac_url** `string` Optional Proxy Pac Url - **vpn_type** `integer` **Mandatory** Vpn Type. Default: 1 - **allowed_apps** `array` Optional Allowed Apps - **custom_data** `array` Optional Custom Data ## Sample Request ```curl curl --request POST \ --url https://appdomain/api/v1/mdm/profiles/{profile_id}/payloads/windowsvpnpolicy \ --header 'Accept: application/json' \ --header 'Authorization: d92d4xxxxxxxxxxxxx15f52' \ --header 'Content-Type: application/json' \ --data '{"connection_name":"VPN Configuration","connection_type":"8","ikev2":{"authentication_method":0,"server_name":"127.0.0.1"},"allowed_apps":[],"vpn_type":2,"proxy_type":"0"}' ``` ## Sample Request Body ### Add VPN payload to the profile (IKEv2 with Password) ```json { "connection_name": "VPN Configuration", "connection_type": "8", "ikev2": { "authentication_method": 0, "server_name": "127.0.0.1" }, "allowed_apps": [], "vpn_type": 2, "proxy_type": "0" } ``` ### Add VPN payload to the profile (IKEv2 with Certificate) ```json { "connection_name": "VPN Configuration", "connection_type": "8", "ikev2": { "authentication_method": 2, "server_name": "127.0.0.1", "ca_certificate_id": "1" }, "allowed_apps": [], "vpn_type": 2, "proxy_type": "0" } ``` ### Add VPN payload to the profile (PPTP with Password) ```json { "connection_name": "VPN Configuration", "connection_type": "1", "allowed_apps": [], "pptp": { "server_name": "127.0.0.1", "user_authentication": 0 }, "vpn_type": 2, "proxy_type": "0" } ``` ### Add VPN payload to the profile (PPTP with Certificate) ```json { "connection_name": "VPN Configuration", "connection_type": "1", "allowed_apps": [], "pptp": { "server_name": "127.0.0.1", "ca_certificate_id": "1", "user_authentication": 2 }, "vpn_type": 2, "proxy_type": "0" } ``` ### Add VPN payload to the profile (L2TP with Password) ```json { "connection_name": "VPN Configuration", "l2tp": { "server_name": "127.0.0.1", "user_authentication": 0 }, "connection_type": "0", "allowed_apps": [], "vpn_type": 2, "proxy_type": "0" } ``` ### Add VPN payload to the profile (L2TP with Shared Secret) ```json { "connection_name": "VPN Configuration", "l2tp": { "server_name": "127.0.0.1", "user_authentication": 1, "shared_secret": "xxxxx" }, "connection_type": "0", "allowed_apps": [], "vpn_type": 2, "proxy_type": "0" } ``` ### Add VPN payload to the profile (L2TP with Certificate) ```json { "connection_name": "VPN Configuration", "l2tp": { "server_name": "127.0.0.1", "ca_certificate_id": "1", "user_authentication": 2 }, "connection_type": "0", "allowed_apps": [], "vpn_type": 2, "proxy_type": "0" } ``` ### Add VPN payload to the profile (F5 Access) ```json { "connection_name": "VPN Configuration", "connection_type": 6, "customssl": { "server_name": "127.0.0.1", "identifier": "F5Networks.vpn.client_btcnfmkykcjs2", "user_authentication": 0 }, "allowed_apps": [], "custom_data": [ { "custom_value": "true", "custom_key": "single-sign-on-credential" }, { "custom_value": "true", "custom_key": "optimize-for-low-cost-network" } ], "vpn_type": 2, "proxy_type": "0" } ``` ### Add VPN payload to the profile (Pulse Secure) ```json { "connection_name": "VPN Configuration", "connection_type": 6, "customssl": { "server_name": "127.0.0.1", "identifier": "951D7986.PulseSecureVPN_qzpvqh70t9a4p", "user_authentication": 0 }, "allowed_apps": [], "custom_data": [ { "custom_value": "true", "custom_key": "isSingleSignOnCredential" }, { "custom_value": "true", "custom_key": "optimizeForLowCostNetwork" }, { "custom_value": "1", "custom_key": "preferredRealm" }, { "custom_value": "1", "custom_key": "preferredRole" } ], "vpn_type": 2, "proxy_type": "0" } ``` ### Add VPN payload to the profile (SonicWall VPN) ```json { "connection_name": "VPN Configuration", "connection_type": 6, "customssl": { "server_name": "127.0.0.1", "identifier": "SonicWALL.MobileConnect_e5kpm93dbe93j", "user_authentication": 0 }, "allowed_apps": [], "custom_data": [ { "custom_value": "true", "custom_key": "SingleSignOn" }, { "custom_value": "false", "custom_key": "PacketCapture" }, { "custom_value": "false", "custom_key": "WindowsAuthUI" } ], "vpn_type": 2, "proxy_type": "0" } ``` ### Add VPN payload to the profile (CheckPoint) ```json { "connection_name": "VPN Configuration", "connection_type": 6, "customssl": { "server_name": "127.0.0.1", "identifier": "B4D42709.CheckPointVPN_wz4qkf3wxpc74", "user_authentication": 0 }, "allowed_apps": [], "custom_data": [ { "custom_value": "true", "custom_key": "sso" }, { "custom_value": "true", "custom_key": "lowcost" } ], "vpn_type": 2, "proxy_type": "0" } ``` ### Add VPN payload to the profile (Per-App VPN) ```json { "connection_name": "VPN Configuration", "connection_type": "1", "allowed_apps": [ { "group_display_name": "Alarms and clock", "is_system_app": false, "app_id": "1" } ], "pptp": { "server_name": "127.0.0.1", "user_authentication": 0 }, "vpn_type": 2, "proxy_type": "0" } ``` ### Add VPN payload to the profile (With Proxy Automatic) ```json { "connection_name": "VPN Configuration", "connection_type": "1", "allowed_apps": [], "pptp": { "server_name": "127.0.0.1", "user_authentication": 0 }, "proxy_pac_url": "127.0.0.1:3128", "vpn_type": 2, "proxy_type": "2" } ``` ### Add VPN payload to the profile (With Proxy Manual) ```json { "connection_name": "VPN Configuration", "connection_type": "1", "allowed_apps": [], "proxy_server": "127.0.0.1", "pptp": { "server_name": "127.0.0.1", "user_authentication": 0 }, "proxy_server_port": "3128", "vpn_type": 2, "proxy_type": "1" } ``` ## Response Parameters ### HTTP Code 200 Response Body: `application/json` - **payload_id** `long` Unique identifier for the created payload item - **connection_name** `string` Connection Name. Default: VPN Configuration - **connection_type** `integer` Connection Type. Default: 0 - **send_all_nw_traffic** `boolean` Send All Nw Traffic. Default: false - **enable_vpn_on_demand** `boolean` Enable Vpn On Demand. Default: false - **l2tp** `JSON Object` L2Tp - **pptp** `JSON Object` Pptp - **customssl** `JSON Object` Customssl - **ikev2** `JSON Object` Ikev2 - **proxy_type** `integer` Proxy Type. Default: 0 - **proxy_server** `string` Proxy Server - **proxy_server_port** `integer` Proxy Server Port. Default: 0 - **proxy_user_name** `string` Proxy User Name - **proxy_pac_url** `string` Proxy Pac Url - **vpn_type** `integer` Vpn Type. Default: 1 - **provider_type** `integer` Provider Type. Default: 1 - **vpnuuid** `string` Vpnuuid - **allowed_apps** `array` Allowed Apps - **custom_data** `array` Custom Data ## Possible Response Codes - **200** HTTP code ## Sample Response: HTTP 200 VPN payload successfully added ```json { "provider_type": "1", "payload_id": "9007199254741295", "connection_type": "6", "proxy_user_name": "", "proxy_server": "127.0.0.1", "allowed_apps": [ { "group_display_name": "Alarms and clock", "is_system_app": false, "app_id": "1" } ], "enable_vpn_on_demand": false, "vpnuuid": "", "proxy_server_port": "3128", "vpn_type": "2", "connection_name": "VPN Configuration", "send_all_nw_traffic": false, "customssl": { "certificate_id": "-1", "identifier": "951D7986.PulseSecureVPN_qzpvqh70t9a4p", "server_name": "127.0.0.1", "user_authentication": "0", "provider_identifier": "", "account": "" }, "proxy_pac_url": "", "custom_data": [ { "custom_value": "1", "custom_key": "preferredRealm" }, { "custom_value": "true", "custom_key": "optimizeForLowCostNetwork" }, { "custom_value": "1", "custom_key": "preferredRole" }, { "custom_value": "true", "custom_key": "isSingleSignOnCredential" } ], "proxy_type": "1" } ``` ## Rate Limit **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.