# Modify the configuration of a Exchange ActiveSync payload item within a profile Modify Android Exchange configurations payload ## Endpoint `PUT /api/v1/mdm/profiles/{profile_id}/payloads/androidexchangeactivesyncpolicy/payloaditems/{payload_id}` ## Request ### Request URL `https://{server-hostname}:8383/api/v1/mdm/profiles/{profile_id}/payloads/androidexchangeactivesyncpolicy/payloaditems/{payload_id}` ### Scope `MDMDeviceMgmt.UPDATE` ### Header `Authorization: d92d4xxxxxxxxxxxxx15f52` ### Request Parameters #### Request Headers | Parameter | Type | Required | Value | |---|---|---|---| | Content-Type | string | Mandatory | `application/json` | | Accept | string | Mandatory | `application/json` | #### Path Parameters | Parameter | 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 | | payload_id | string | Mandatory | Unique identifier of the payload item. Obtain from the [Get Payload Item IDs](https://www.manageengine.com/products/desktop-central/help/api/onpremise/android-get-exchange-activesync-payload-android.html) response | #### Request Body `application/json` | Parameter | Type | Required | Description | |---|---|---|---| | account_type | integer | Optional | Exchange account type. 1 = Exchange (default) | | account_name | string | Optional | Display name for the Exchange account, shown on the device. Default: Corporate E-mail | | user_name | string | Optional | Username for Exchange authentication. Use `%upn%` to auto-populate with the user principal name | | domain | string | Optional | Windows domain for Exchange authentication. Use `%domainname%` to auto-populate | | active_sync_host | string | Mandatory | Hostname or URL of the Exchange ActiveSync server (required) | | email_address | string | Optional | Email address for the Exchange account. Use `%email%` to auto-populate | | password | string | Optional | Password for Exchange authentication. Write-only; not returned in responses | | password_id | long | Optional | ID of a stored credential used as the Exchange account password. Use -1 when providing password directly | | accept_all_certificates | boolean | Optional | Accept all SSL certificates, including self-signed ones, from the Exchange server. Default: true | | use_ssl | boolean | Optional | Enable SSL/TLS encryption for the Exchange ActiveSync connection. Default: true | | default_account | boolean | Optional | Set this as the default email account on the device. Default: true | | allow_always_vibrate | boolean | Optional | Enable vibration for email notifications at all times. Default: false | | allow_silent_vibrate | boolean | Optional | Enable vibration for email notifications when the device is on silent mode. Default: false | | sync_mail | boolean | Optional | Enable synchronization of mail from Exchange. Default: true | | sync_calandar | boolean | Optional | Enable synchronization of calendar events from Exchange. Default: true | | sync_contacts | boolean | Optional | Enable synchronization of contacts from Exchange. Default: true | | sync_notes | boolean | Optional | Enable synchronization of notes from Exchange. Default: true | | sync_tasks | boolean | Optional | Enable synchronization of tasks from Exchange. Default: true | | past_days_mail_to_sync | integer | Optional | Number of past days of mail to synchronize. 2 = last 3 days, 3 = last week, 4 = last 2 weeks, 5 = last month, 6 = all. Default: 2 | | identity_cert_id | long | Optional | ID of the client identity certificate for mutual TLS authentication. Use -1 for none. Default: -1 | | past_days_to_calander_sync | integer | Optional | Number of past days of calendar events to synchronize. Default: 5 | | peak_days | integer | Optional | Bitmask of days classified as peak hours (bit 0 = Sunday … bit 6 = Saturday). Default: 0 (no peak schedule) | | peak_start_mins | integer | Optional | Start time of peak hours, in minutes from midnight (e.g. 480 = 8:00 AM). Default: 8 | | peak_end_mins | integer | Optional | End time of peak hours, in minutes from midnight (e.g. 1020 = 5:00 PM). Default: 17 | | peak_days_sycn_frequency | integer | Optional | Mail sync frequency in minutes during peak hours. Default: 2 | | off_peak_days_sycn_frequency | integer | Optional | Mail sync frequency in minutes during off-peak hours. Default: 2 | | incoming_attachment_max_size | integer | Optional | Maximum attachment size in KB to download automatically. Use 0 for unlimited. Default: 0 | | allow_notify | boolean | Optional | Enable email push notifications on the device. Default: true | | signature | string | Optional | Default email signature appended to outgoing messages | | allow_change_mail_settings | boolean | Optional | Allow the user to modify mail settings from the device. Default: true | | allow_forward_email | boolean | Optional | Allow the user to forward emails. Default: true | | allow_html_content | boolean | Optional | Allow rendering of HTML-formatted email content. Default: true | | retrival_size | integer | Optional | Maximum email body size in KB to retrieve. Use 9 to retrieve the full message. Default: 9 | | roaming_settings | integer | Optional | Mail sync behavior while roaming. 0 = automatic, 1 = never, 2 = always. Default: 1 | | primary_client_pref | integer | Optional | Preferred client for viewing emails. 1 = MDM Email app, 2 = Device default email app. Default: 1 | | secondary_client_pref | integer | Optional | Secondary email client preference. 1 = MDM Email app, 2 = Device default email app. Default: 1 | | advancedSettings | boolean | Optional | Enable advanced Exchange ActiveSync settings configuration on the device. Default: false | ### Sample Request ```curl curl --request PUT \ --url https://appdomain/api/v1/mdm/profiles/%7Bprofile_id%7D/payloads/androidexchangeactivesyncpolicy/payloaditems/%7Bpayload_id%7D \ --header 'Accept: application/json' \ --header 'Authorization: d92d4xxxxxxxxxxxxx15f52' \ --header 'Content-Type: application/json' \ --data '{"account_type":1,"peak_start_mins":480,"signature":"Regards, %username%","user_name":"%upn%","allow_silent_vibrate":false,"roaming_settings":1,"default_account":true,"past_days_mail_to_sync":2,"off_peak_days_sycn_frequency":60,"password":"********","password_id":-1,"sync_calandar":true,"advancedSettings":false,"account_name":"Corporate E-mail","allow_html_content":true,"peak_end_mins":1020,"secondary_client_pref":1,"peak_days_sycn_frequency":15,"past_days_to_calander_sync":5,"incoming_attachment_max_size":0,"sync_notes":true,"allow_always_vibrate":false,"identity_cert_id":-1,"use_ssl":true,"sync_contacts":true,"sync_tasks":true,"allow_change_mail_settings":true,"allow_notify":true,"allow_forward_email":true,"sync_mail":true,"retrival_size":9,"accept_all_certificates":true,"email_address":"%email%","peak_days":0,"primary_client_pref":1,"domain":"%domainname%","active_sync_host":"mail.zylker.com"}' ``` ### Sample Request Body Modify Exchange ActiveSync payload item ```json { "account_type": 1, "peak_start_mins": 480, "signature": "Regards, %username%", "user_name": "%upn%", "allow_silent_vibrate": false, "roaming_settings": 1, "default_account": true, "past_days_mail_to_sync": 2, "off_peak_days_sycn_frequency": 60, "password": "********", "password_id": -1, "sync_calandar": true, "advancedSettings": false, "account_name": "Corporate E-mail", "allow_html_content": true, "peak_end_mins": 1020, "secondary_client_pref": 1, "peak_days_sycn_frequency": 15, "past_days_to_calander_sync": 5, "incoming_attachment_max_size": 0, "sync_notes": true, "allow_always_vibrate": false, "identity_cert_id": -1, "use_ssl": true, "sync_contacts": true, "sync_tasks": true, "allow_change_mail_settings": true, "allow_notify": true, "allow_forward_email": true, "sync_mail": true, "retrival_size": 9, "accept_all_certificates": true, "email_address": "%email%", "peak_days": 0, "primary_client_pref": 1, "domain": "%domainname%", "active_sync_host": "mail.zylker.com" } ``` ## Response Parameters ### HTTP Code 200 Response Body: `application/json` | Parameter | Type | Description | |---|---|---| | payload_id | long | Unique identifier of the payload item | | account_type | integer | Exchange account type. 1 = Exchange (default) | | account_name | string | Display name for the Exchange account, shown on the device. Default: Corporate E-mail | | user_name | string | Username for Exchange authentication. Use `%upn%` to auto-populate with the user principal name | | domain | string | Windows domain for Exchange authentication. Use `%domainname%` to auto-populate | | active_sync_host | string | Hostname or URL of the Exchange ActiveSync server (required) | | email_address | string | Email address for the Exchange account. Use `%email%` to auto-populate | | password | string | Password for Exchange authentication. Write-only; not returned in responses | | password_id | long | ID of a stored credential used as the Exchange account password. Use -1 when providing password directly | | accept_all_certificates | boolean | Accept all SSL certificates, including self-signed ones, from the Exchange server. Default: true | | use_ssl | boolean | Enable SSL/TLS encryption for the Exchange ActiveSync connection. Default: true | | default_account | boolean | Set this as the default email account on the device. Default: true | | allow_always_vibrate | boolean | Enable vibration for email notifications at all times. Default: false | | allow_silent_vibrate | boolean | Enable vibration for email notifications when the device is on silent mode. Default: false | | sync_mail | boolean | Enable synchronization of mail from Exchange. Default: true | | sync_calandar | boolean | Enable synchronization of calendar events from Exchange. Default: true | | sync_contacts | boolean | Enable synchronization of contacts from Exchange. Default: true | | sync_notes | boolean | Enable synchronization of notes from Exchange. Default: true | | sync_tasks | boolean | Enable synchronization of tasks from Exchange. Default: true | | past_days_mail_to_sync | integer | Number of past days of mail to synchronize. 2 = last 3 days, 3 = last week, 4 = last 2 weeks, 5 = last month, 6 = all. Default: 2 | | identity_cert_id | long | ID of the client identity certificate for mutual TLS authentication. Use -1 for none. Default: -1 | | past_days_to_calander_sync | integer | Number of past days of calendar events to synchronize. Default: 5 | | peak_days | integer | Bitmask of days classified as peak hours (bit 0 = Sunday … bit 6 = Saturday). Default: 0 (no peak schedule) | | peak_start_mins | integer | Start time of peak hours, in minutes from midnight (e.g. 480 = 8:00 AM). Default: 8 | | peak_end_mins | integer | End time of peak hours, in minutes from midnight (e.g. 1020 = 5:00 PM). Default: 17 | | peak_days_sycn_frequency | integer | Mail sync frequency in minutes during peak hours. Default: 2 | | off_peak_days_sycn_frequency | integer | Mail sync frequency in minutes during off-peak hours. Default: 2 | | incoming_attachment_max_size | integer | Maximum attachment size in KB to download automatically. Use 0 for unlimited. Default: 0 | | allow_notify | boolean | Enable email push notifications on the device. Default: true | | signature | string | Default email signature appended to outgoing messages | | allow_change_mail_settings | boolean | Allow the user to modify mail settings from the device. Default: true | | allow_forward_email | boolean | Allow the user to forward emails. Default: true | | allow_html_content | boolean | Allow rendering of HTML-formatted email content. Default: true | | retrival_size | integer | Maximum email body size in KB to retrieve. Use 9 to retrieve the full message. Default: 9 | | roaming_settings | integer | Mail sync behavior while roaming. 0 = automatic, 1 = never, 2 = always. Default: 1 | | primary_client_pref | integer | Preferred client for viewing emails. 1 = MDM Email app, 2 = Device default email app. Default: 1 | | secondary_client_pref | integer | Secondary email client preference. 1 = MDM Email app, 2 = Device default email app. Default: 1 | | advancedSettings | boolean | Enable advanced Exchange ActiveSync settings configuration on the device. Default: false | ### Possible Response Codes | Code | Type | |---|---| | 200 | HTTP code | ### Sample Response: HTTP 200 Exchange ActiveSync payload item successfully modified ```json { "account_type": 1, "peak_start_mins": 480, "signature": "Regards, %username%", "user_name": "%upn%", "allow_silent_vibrate": false, "roaming_settings": 1, "default_account": true, "past_days_mail_to_sync": 2, "off_peak_days_sycn_frequency": 60, "password_id": -1, "sync_calandar": true, "advancedSettings": false, "account_name": "Corporate E-mail", "allow_html_content": true, "peak_end_mins": 1020, "secondary_client_pref": 1, "peak_days_sycn_frequency": 15, "past_days_to_calander_sync": 5, "incoming_attachment_max_size": 0, "payload_id": 9007199254741000, "sync_notes": true, "allow_always_vibrate": false, "identity_cert_id": -1, "use_ssl": true, "sync_contacts": true, "sync_tasks": true, "allow_change_mail_settings": true, "allow_notify": true, "allow_forward_email": true, "sync_mail": true, "retrival_size": 9, "accept_all_certificates": true, "email_address": "%email%", "peak_days": 0, "primary_client_pref": 1, "domain": "%domainname%", "active_sync_host": "mail.zylker.com" } ``` ## Rate Limits ![](https://www.zohowebstatic.com/sites/zweb/images/people/ico-help.png) **Duration:** 1 minute | **Threshold:** 60 | **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.