# Add a new Email payload configuration to an existing profile Create Android Email configurations payload ## Endpoint `POST /api/v1/mdm/profiles/{profile_id}/payloads/androidemailpolicy` ## Request URL `https://{server-hostname}:8383/api/v1/mdm/profiles/{profile_id}/payloads/androidemailpolicy` ## Scope `MDMDeviceMgmt.CREATE` ## Header `Authorization: d92d4xxxxxxxxxxxxx15f52` ## Request Parameters ### Request Headers | Name | Type | Required | Value | |---|---|---|---| | Content-Type | string | Mandatory | application/json | | Accept | string | Mandatory | application/json | ### Path Parameters | Name | Type | Required | Description | |---|---|---|---| | 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` | Name | Type | Required | Description | |---|---|---|---| | account_name | string | Optional | Display name for the email account, shown on the device | | account_type | integer | Optional | Email protocol type. 1 = IMAP, 2 = POP3. Default: 1 | | mail_address | string | Optional | Email address for this account. Use %email% to auto-populate from the enrolled user | | sender_name | string | Optional | Name shown as the sender in outgoing emails. Use %username% to auto-populate | | allow_html_content | boolean | Optional | Allow rendering of HTML-formatted email content on the device. Default: true | | allow_forward | boolean | Optional | Allow the user to forward received emails. Default: true | | allow_notify | boolean | Optional | Enable email push notifications on the device. Default: true | | allow_vibrate_on_silent | boolean | Optional | Enable vibration for email notifications when the device is on silent mode. Default: true | | default_account | boolean | Optional | Set this as the default email account on the device. Default: false | | allow_change_setting | boolean | Optional | Allow the user to modify email account settings from the device. Default: true | | signature | string | Optional | Default signature appended to outgoing emails | | incoming_protocol | string | Optional | Protocol for the incoming mail server. Typically IMAP or POP3 | | incoming_server_hostname | string | Mandatory | Hostname or IP address of the incoming mail server (required) | | incoming_server_port | integer | Optional | Port for the incoming mail server. Common values: 993 (IMAP+SSL), 143 (IMAP), 995 (POP3+SSL), 110 (POP3). Default: 143 | | incoming_user_name | string | Optional | Username for authenticating to the incoming mail server. Use %username% to auto-populate | | incoming_server_password | string | Optional | Password for the incoming mail server. Write-only; not returned in responses | | incoming_server_password_id | long | Optional | ID of a stored credential used as the incoming mail server password. Use -1 when providing password directly | | incoming_server_use_ssl | boolean | Optional | Enable SSL/TLS encryption for the incoming mail server connection. Default: true | | incoming_server_use_tls | boolean | Optional | Enable STARTTLS encryption upgrade for the incoming mail server connection. Default: false | | incoming_server_certificate | boolean | Optional | Require a trusted certificate from the incoming mail server. Default: true | | outgoing_protocol | string | Optional | Protocol for the outgoing mail server. Typically SMTP. Default: SMTP | | outgoing_server_hostname | string | Mandatory | Hostname or IP address of the outgoing (SMTP) mail server (required) | | outgoing_server_port | integer | Optional | Port for the outgoing mail server. Common values: 465 (SMTP+SSL), 587 (SMTP+TLS), 25 (SMTP). Default: 587 | | outgoing_user_name | string | Optional | Username for authenticating to the outgoing mail server. Use %username% to auto-populate | | outgoing_server_password | string | Optional | Password for the outgoing mail server. Write-only; not returned in responses | | outgoing_server_password_id | long | Optional | ID of a stored credential used as the outgoing mail server password. Use -1 when providing password directly | | outgoing_server_use_ssl | boolean | Optional | Enable SSL/TLS encryption for the outgoing mail server connection. Default: true | | outgoing_server_use_tls | boolean | Optional | Enable STARTTLS encryption upgrade for the outgoing mail server connection. Default: false | | outgoing_server_certificate | boolean | Optional | Require a trusted certificate from the outgoing mail server. Default: true | ## Sample Request ```curl curl --request POST \ --url https://appdomain/api/v1/mdm/profiles/%7Bprofile_id%7D/payloads/androidemailpolicy \ --header 'Accept: application/json' \ --header 'Authorization: d92d4xxxxxxxxxxxxx15f52' \ --header 'Content-Type: application/json' \ --data '{"account_type":1,"signature":"Regards, %username%","outgoing_server_password_id":-1,"sender_name":"%username%","default_account":false,"outgoing_server_use_tls":false,"outgoing_user_name":"%username%","incoming_protocol":"IMAP","account_name":"Corporate Email","allow_html_content":true,"allow_change_setting":true,"outgoing_server_password":"********","outgoing_server_port":587,"incoming_server_certificate":false,"mail_address":"%email%","incoming_server_port":993,"outgoing_server_use_ssl":true,"allow_forward":true,"incoming_server_hostname":"imap.zylker.com","incoming_server_password":"********","incoming_server_password_id":-1,"outgoing_server_hostname":"smtp.zylker.com","allow_notify":true,"incoming_server_use_tls":false,"outgoing_protocol":"SMTP","allow_vibrate_on_silent":true,"incoming_user_name":"%username%","incoming_server_use_ssl":true,"outgoing_server_certificate":false}' ``` ## Sample Request Body Add Email payload to the profile ```json { "account_type": 1, "signature": "Regards, %username%", "outgoing_server_password_id": -1, "sender_name": "%username%", "default_account": false, "outgoing_server_use_tls": false, "outgoing_user_name": "%username%", "incoming_protocol": "IMAP", "account_name": "Corporate Email", "allow_html_content": true, "allow_change_setting": true, "outgoing_server_password": "********", "outgoing_server_port": 587, "incoming_server_certificate": false, "mail_address": "%email%", "incoming_server_port": 993, "outgoing_server_use_ssl": true, "allow_forward": true, "incoming_server_hostname": "imap.zylker.com", "incoming_server_password": "********", "incoming_server_password_id": -1, "outgoing_server_hostname": "smtp.zylker.com", "allow_notify": true, "incoming_server_use_tls": false, "outgoing_protocol": "SMTP", "allow_vibrate_on_silent": true, "incoming_user_name": "%username%", "incoming_server_use_ssl": true, "outgoing_server_certificate": false } ``` ## Response Parameters ### HTTP Code 200 Response Body: `application/json` | Name | Type | Description | |---|---|---| | payload_id | long | Unique identifier for the created payload item | | account_name | string | Display name for the email account, shown on the device | | account_type | integer | Email protocol type. 1 = IMAP, 2 = POP3. Default: 1 | | mail_address | string | Email address for this account. Use %email% to auto-populate from the enrolled user | | sender_name | string | Name shown as the sender in outgoing emails. Use %username% to auto-populate | | allow_html_content | boolean | Allow rendering of HTML-formatted email content on the device. Default: true | | allow_forward | boolean | Allow the user to forward received emails. Default: true | | allow_notify | boolean | Enable email push notifications on the device. Default: true | | allow_vibrate_on_silent | boolean | Enable vibration for email notifications when the device is on silent mode. Default: true | | default_account | boolean | Set this as the default email account on the device. Default: false | | allow_change_setting | boolean | Allow the user to modify email account settings from the device. Default: true | | signature | string | Default signature appended to outgoing emails | | incoming_protocol | string | Protocol for the incoming mail server. Typically IMAP or POP3 | | incoming_server_hostname | string | Hostname or IP address of the incoming mail server (required) | | incoming_server_port | integer | Port for the incoming mail server. Common values: 993 (IMAP+SSL), 143 (IMAP), 995 (POP3+SSL), 110 (POP3). Default: 143 | | incoming_user_name | string | Username for authenticating to the incoming mail server. Use %username% to auto-populate | | incoming_server_password | string | Password for the incoming mail server. Write-only; not returned in responses | | incoming_server_password_id | long | ID of a stored credential used as the incoming mail server password. Use -1 when providing password directly | | incoming_server_use_ssl | boolean | Enable SSL/TLS encryption for the incoming mail server connection. Default: true | | incoming_server_use_tls | boolean | Enable STARTTLS encryption upgrade for the incoming mail server connection. Default: false | | incoming_server_certificate | boolean | Require a trusted certificate from the incoming mail server. Default: true | | outgoing_protocol | string | Protocol for the outgoing mail server. Typically SMTP. Default: SMTP | | outgoing_server_hostname | string | Hostname or IP address of the outgoing (SMTP) mail server (required) | | outgoing_server_port | integer | Port for the outgoing mail server. Common values: 465 (SMTP+SSL), 587 (SMTP+TLS), 25 (SMTP). Default: 587 | | outgoing_user_name | string | Username for authenticating to the outgoing mail server. Use %username% to auto-populate | | outgoing_server_password | string | Password for the outgoing mail server. Write-only; not returned in responses | | outgoing_server_password_id | long | ID of a stored credential used as the outgoing mail server password. Use -1 when providing password directly | | outgoing_server_use_ssl | boolean | Enable SSL/TLS encryption for the outgoing mail server connection. Default: true | | outgoing_server_use_tls | boolean | Enable STARTTLS encryption upgrade for the outgoing mail server connection. Default: false | | outgoing_server_certificate | boolean | Require a trusted certificate from the outgoing mail server. Default: true | ### Possible Response Codes | Code | Type | |---|---| | 200 | HTTP code | ## Sample Response: HTTP 200 Email payload successfully added ```json { "account_type": 1, "signature": "Regards, %username%", "outgoing_server_password_id": -1, "sender_name": "%username%", "default_account": false, "outgoing_server_use_tls": false, "outgoing_user_name": "%username%", "incoming_protocol": "IMAP", "account_name": "Corporate Email", "allow_html_content": true, "allow_change_setting": true, "outgoing_server_port": 587, "incoming_server_certificate": false, "mail_address": "%email%", "incoming_server_port": 993, "outgoing_server_use_ssl": true, "payload_id": 9007199254741000, "allow_forward": true, "incoming_server_hostname": "imap.zylker.com", "incoming_server_password_id": -1, "outgoing_server_hostname": "smtp.zylker.com", "allow_notify": true, "incoming_server_use_tls": false, "outgoing_protocol": "SMTP", "allow_vibrate_on_silent": true, "incoming_user_name": "%username%", "incoming_server_use_ssl": true, "outgoing_server_certificate": false } ``` ![ ](https://www.zohowebstatic.com/sites/zweb/images/people/ico-help.png) **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.