# Add a new Per-App VPN payload configuration to an existing profile To create Mac per app Vpn policy ## Endpoint `POST /api/v1/mdm/profiles/{profile_id}/payloads/macperappvpn` ## Request URL `https://[{serverurl}](https://www.manageengine.com/mobile-device-management/help/api/cloud/oauth-authentication-endpoint-domain.html)/api/v1/mdm/profiles/{profile_id}/payloads/macperappvpn` ## Scope `MDMOnDemand.MDMDeviceMgmt.CREATE` ## Header `Authorization: Zoho-oauthtoken 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/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. ### Request Body `application/json` - **sub_config** — `string` — Optional VPN sub-configuration type indicating the active VPN protocol. Corresponds to the connection_type value (e.g., L2TP, PPTP, IPSEC, IKEV2, CUSTOMSSL). Default: L2TP - **connection_name** — `string` — **Mandatory** Display name for the VPN connection shown to the user in System Preferences. Default: VPN Configuration - **connection_type** — `integer` — **Mandatory** VPN connection type. Allowed values: 0=L2TP, 1=PPTP, 2=IPSec, 3=Cisco Legacy AnyConnect, 4=Juniper SSL, 5=F5 SSL, 6=Custom SSL, 7=Pulse Secure, 8=IKEv2, 9=Cisco AnyConnect, 10=SonicWall, 11=Aruba VIA, 12=CheckPoint Mobile - **send_all_nw_traffic** — `boolean` — Optional Whether all network traffic is routed through the VPN tunnel (full tunnel mode). When false, split tunneling is used. Default: false - **certificate_uuid** — `string` — Optional UUID of the identity certificate payload used for VPN authentication. Obtain from the [Upload Certificate API](https://www.manageengine.com/mobile-device-management/help/api/cloud/certificates-upload-certificate.html) - **enable_vpn_on_demand** — `boolean` — Optional Whether VPN On Demand is enabled, allowing the system to automatically establish the VPN connection based on configured rules. Default: false - **disconnect_on_idle_timeout** — `integer` — Optional Disconnect on idle timeout in seconds. 0 means disabled. Default: 0 - **f5ssl** — `JSON object` — Optional F5Ssl - **customssl** — `JSON object` — Optional Customssl - **sonicwall** — `JSON object` — Optional Sonicwall - **proxy_type** — `integer` — Optional Proxy configuration type. Allowed values: 0=None, 1=Manual, 2=Automatic (PAC URL) - **proxy_server** — `string` — Optional Hostname or IP address of the HTTP proxy server. Required when proxy_type is 1 (Manual) - **proxy_server_port** — `integer` — Optional Port number of the HTTP proxy server. Valid range: 0-65535. Default: 0 - **proxy_user_name** — `string` — Optional Username for proxy server authentication - **proxy_password** — `string` — Optional Password for proxy server authentication (sensitive - write-only, not returned in responses) - **proxy_password_id** — `long` — Optional Internal identifier for the stored proxy password credential - **proxy_pac_url** — `string` — Optional URL of the Proxy Auto-Configuration (PAC) file. Required when proxy_type is 2 (Automatic) - **ondemand_user_override_disabled** — `boolean` — Optional Whether the user is prevented from overriding VPN On Demand settings. When true, the user cannot manually disconnect an on-demand VPN. Default: false - **ondemandrules** — `JSON array` — Optional List of VPN On Demand rules controlling when the VPN connects/disconnects - **rule_order** — `integer` — Optional Order in which the rule is evaluated - **action** — `integer` — Optional Action to take. Allowed values: 0=Disconnect, 1=Connect, 2=Ignore, 3=Evaluate Connection - **type** — `integer` — Optional Match type. Allowed values: 0=Always, 1=DNS Domain Match, 2=DNS Server Address Match, 3=Interface Type Match, 4=SSID Match, 5=URL String Probe - **value** — `array` — Optional List of match values (domains, addresses, SSIDs, etc.) based on the match type - **safari_domains** — `array` — Optional List of domain strings that trigger the Per-App VPN when accessed in Safari (e.g., internal.zylker.com, *.corp.zylker.com) - **excluded_domains** — `array` — Optional List of domain strings whose traffic bypasses the Per-App VPN tunnel even when the VPN is active - **vpn_type** — `integer` — **Mandatory** VPN scope type. Allowed values: 1=Device-level VPN, 2=Per-App VPN - **provider_type** — `integer` — Optional VPN provider type. Allowed values: 0=Packet Tunnel (default), 1=App Proxy - **vpnuuid** — `string` — Optional Unique identifier (UUID) for this VPN configuration, used to reference this VPN from Per-App VPN app assignments - **allowed_apps** — `JSON array` — Optional List of apps allowed to use this Per-App VPN. Each app is identified by app_group_id from the [Apps API](https://www.manageengine.com/mobile-device-management/help/api/cloud/app-management-get-an-app.html) - **app_id** — `long` — Optional App ID of the VPN app. 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 - **is_system_app** — `boolean` — Optional Whether this is a system app. Default: false - **group_display_name** — `string` — Optional Display name of the app group - **autonomous_kiosk_apps** — `JSON array` — Optional List of autonomous single app mode apps - **app_id** — `long` — Optional App ID of the kiosk app. 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 - **group_display_name** — `string` — Optional Display name of the app group - **ondemand_match_app_enabled** — `boolean` — Optional Whether Per-App VPN automatically connects when associated apps launch. When enabled, the VPN triggers on app launch matching. Default: true - **custom_data** — `JSON array` — Optional List of custom key-value pairs for vendor-specific VPN configuration - **custom_key** — `string` — Optional Custom configuration key name - **custom_value** — `string` — Optional Custom configuration key value - **ikev2** — `JSON object` — Optional Ikev2 ## Sample Request ```curl curl --request POST \ --url https://appdomain/api/v1/mdm/profiles/{profile_id}/payloads/macperappvpn \ --header 'Accept: application/json' \ --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \ --header 'Content-Type: application/json' \ --data '{"connection_name":"VPN Configuration","connection_type":0,"vpn_type":1}' ``` ## Sample Request Body Add Per-App VPN payload to the profile ```json { "connection_name": "VPN Configuration", "send_all_nw_traffic": false, "sonicwall": {}, "connection_type": 0, "customssl": {}, "sub_config": "L2TP", "enable_vpn_on_demand": false, "f5ssl": {}, "certificate_uuid": "value", "disconnect_on_idle_timeout": 0, "vpn_type": 1 } ``` ## Response Parameters ### HTTP Code 200 Response Body — `application/json` - **payload_id** — `long` Unique identifier for the created payload item - **sub_config** — `string` VPN sub-configuration type indicating the active VPN protocol. Corresponds to the connection_type value (e.g., L2TP, PPTP, IPSEC, IKEV2, CUSTOMSSL). Default: L2TP - **connection_name** — `string` Display name for the VPN connection shown to the user in System Preferences. Default: VPN Configuration - **connection_type** — `string` VPN connection type. Allowed values: 0=L2TP, 1=PPTP, 2=IPSec, 3=Cisco Legacy AnyConnect, 4=Juniper SSL, 5=F5 SSL, 6=Custom SSL, 7=Pulse Secure, 8=IKEv2, 9=Cisco AnyConnect, 10=SonicWall, 11=Aruba VIA, 12=CheckPoint Mobile - **send_all_nw_traffic** — `boolean` Whether all network traffic is routed through the VPN tunnel (full tunnel mode). When false, split tunneling is used. Default: false - **certificate_uuid** — `string` UUID of the identity certificate payload used for VPN authentication. Obtain from the [Upload Certificate API](https://www.manageengine.com/mobile-device-management/help/api/cloud/certificates-upload-certificate.html) - **enable_vpn_on_demand** — `boolean` Whether VPN On Demand is enabled, allowing the system to automatically establish the VPN connection based on configured rules. Default: false - **disconnect_on_idle_timeout** — `string` Disconnect on idle timeout in seconds. 0 means disabled. Default: 0 - **f5ssl** — `JSON object` F5Ssl - **customssl** — `JSON object` Customssl - **sonicwall** — `JSON object` Sonicwall - **proxy_type** — `string` Proxy configuration type. Allowed values: 0=None, 1=Manual, 2=Automatic (PAC URL) - **proxy_server** — `string` Hostname or IP address of the HTTP proxy server. Required when proxy_type is 1 (Manual) - **proxy_server_port** — `string` Proxy server port number. Valid range: 0-65535. Default: 0 - **proxy_user_name** — `string` Username for proxy server authentication - **proxy_password** — `string` Password for proxy server authentication (sensitive - write-only, not returned in responses) - **proxy_password_id** — `long` Internal identifier for the stored proxy password credential - **proxy_pac_url** — `string` URL of the Proxy Auto-Configuration (PAC) file. Required when proxy_type is 2 (Automatic) - **ondemand_user_override_disabled** — `boolean` Whether the user is prevented from overriding VPN On Demand settings. When true, the user cannot manually disconnect an on-demand VPN. Default: false - **ondemandrules** — `JSON array` List of VPN On Demand rules controlling when the VPN connects/disconnects - **safari_domains** — `array` List of domain strings that trigger the Per-App VPN when accessed in Safari (e.g., internal.zylker.com, *.corp.zylker.com) - **excluded_domains** — `array` List of domain strings whose traffic bypasses the Per-App VPN tunnel even when the VPN is active - **vpn_type** — `string` VPN scope type. Allowed values: 1=Device-level VPN, 2=Per-App VPN - **provider_type** — `string` VPN provider type. Allowed values: 0=Packet Tunnel (default), 1=App Proxy - **vpnuuid** — `string` Unique identifier (UUID) for this VPN configuration, used to reference this VPN from Per-App VPN app assignments - **allowed_apps** — `JSON array` List of apps allowed to use this Per-App VPN. Each app is identified by app_group_id from the [Apps API](https://www.manageengine.com/mobile-device-management/help/api/cloud/app-management-get-an-app.html) - **autonomous_kiosk_apps** — `JSON array` List of autonomous single app mode apps - **ondemand_match_app_enabled** — `boolean` Whether Per-App VPN automatically connects when associated apps launch. When enabled, the VPN triggers on app launch matching. Default: true - **custom_data** — `JSON array` List of custom key-value pairs for vendor-specific VPN configuration - **ikev2** — `JSON object` Ikev2 ## Possible Response Codes - **200** — HTTP code ## Sample Response: HTTP 200 Per-App VPN payload successfully added ```json { "connection_name": "VPN Configuration", "send_all_nw_traffic": false, "payload_id": 9007199254741000, "sonicwall": {}, "connection_type": 0, "customssl": {}, "sub_config": "L2TP", "enable_vpn_on_demand": false, "f5ssl": {}, "certificate_uuid": "value", "disconnect_on_idle_timeout": 0, "vpn_type": 1 } ``` ## API 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.