# Add a new Passcode payload configuration to an existing profile Create Android Passcode Policy payload ## Endpoint `POST /api/v1/mdm/profiles/{profile_id}/payloads/androidpasscodepolicy` ## Request ### Request URL ```text https://{server-hostname}:8383/api/v1/mdm/profiles/{profile_id}/payloads/androidpasscodepolicy ``` ### Scope ```text MDMDeviceMgmt.CREATE ``` ### Header ```text 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 | |---|---|---|---| | passcode_type | integer | Optional | Passcode quality type. -1 = None, 1 = Pattern, 2 = Numeric, 3 = Alphabetic, 4 = Alphanumeric, 5 = Complex. Default: -1 | | min_passcode_length | integer | Optional | Minimum passcode length required. -1 = Not Configured. Default: -1 | | auto_lock_idle_for | integer | Optional | Seconds of inactivity before automatic screen lock. 0 = Not Configured. Default: 0 | | max_failed_attempts | integer | Optional | Maximum failed passcode attempts before device wipe. -1 = Not Configured. Default: -1 | | max_passcode_age | integer | Optional | Maximum passcode age in days before forced change. 0 = No Expiry. Default: 0 | | no_of_passcode_maintained | integer | Optional | Number of previous passcodes maintained in history. 0 = No History. Default: 0 | | min_lower_case_length | integer | Optional | Minimum number of lowercase characters required | | min_non_letter_length | integer | Optional | Minimum number of non-letter characters required | | min_numeric_length | integer | Optional | Minimum number of numeric characters required | | min_symbol_length | integer | Optional | Minimum number of symbol characters required | | min_upper_case_length | integer | Optional | Minimum number of uppercase characters required | | min_letter_length | integer | Optional | Minimum number of letter characters required | | max_chars | integer | Optional | Maximum number of characters allowed in the passcode | | max_numeric_sequence | integer | Optional | Maximum length of allowed numeric sequence in the passcode | | grace_period | integer | Optional | Grace period in minutes before passcode is required after screen lock. Default: 60 | | allow_fingerprint | integer | Optional | Whether fingerprint authentication is allowed. 0 = Restrict, 1 = Allow. Default: 1 | | allow_iris_scan | boolean | Optional | Whether iris scan authentication is allowed. Default: true | | allow_face_unlock | boolean | Optional | Whether face unlock authentication is allowed. Default: true | | allow_one_lock | boolean | Optional | Whether unified lock (same lock for device and work profile) is allowed. Default: true | | set_default_passcode | boolean | Optional | Whether a default passcode is set on the device. Default: false | | allow_change_default_passcode | boolean | Optional | Whether the user can change the default passcode. Default: true | | new_default_passcode | string | Optional | Default passcode value (write-only; use new_default_passcode_id for credential ID reads) | | scope_for_passcode | integer | Optional | Scope of the passcode policy. 0 = Device, 1 = Work Profile. Default: 0 | | allow_trust_agents | integer | Optional | Whether Smart Lock trust agents are allowed. 0 = Disallow, 1 = Allow. Default: 1 | | new_default_passcode_id | long | Optional | ID of the saved credential for the default passcode | | passcode_complexity | integer | Optional | Password complexity level. 1 = Low, 2 = Medium, 3 = High. Default: 1 | | strong_auth_timeout | integer | Optional | Timeout in seconds before strong authentication is required. 0 = Use Default. Default: 0 | ### Sample Request ```bash curl --request POST \ --url https://appdomain/api/v1/mdm/profiles/{profile_id}/payloads/androidpasscodepolicy \ --header 'Accept: application/json' \ --header 'Authorization: d92d4xxxxxxxxxxxxx15f52' \ --header 'Content-Type: application/json' \ --data '{"min_passcode_length":-1,"max_passcode_age":0,"passcode_type":-1,"min_lower_case_length":1,"min_non_letter_length":1,"no_of_passcode_maintained":0,"min_symbol_length":1,"auto_lock_idle_for":0,"min_numeric_length":1,"max_failed_attempts":-1}' ``` ### Sample Request Body Add Passcode payload to the profile ```json { "min_passcode_length": -1, "max_passcode_age": 0, "passcode_type": -1, "min_lower_case_length": 1, "min_non_letter_length": 1, "no_of_passcode_maintained": 0, "min_symbol_length": 1, "auto_lock_idle_for": 0, "min_numeric_length": 1, "max_failed_attempts": -1 } ``` ## Response ### HTTP Code 200 #### Response Body `application/json` | Name | Type | Description | |---|---|---| | payload_id | long | Unique identifier for the created payload item | | passcode_type | integer | Passcode quality type. -1 = None, 1 = Pattern, 2 = Numeric, 3 = Alphabetic, 4 = Alphanumeric, 5 = Complex. Default: -1 | | min_passcode_length | integer | Minimum passcode length required. -1 = Not Configured. Default: -1 | | auto_lock_idle_for | integer | Seconds of inactivity before automatic screen lock. 0 = Not Configured. Default: 0 | | max_failed_attempts | integer | Maximum failed passcode attempts before device wipe. -1 = Not Configured. Default: -1 | | max_passcode_age | integer | Maximum passcode age in days before forced change. 0 = No Expiry. Default: 0 | | no_of_passcode_maintained | integer | Number of previous passcodes maintained in history. 0 = No History. Default: 0 | | min_lower_case_length | integer | Minimum number of lowercase characters required | | min_non_letter_length | integer | Minimum number of non-letter characters required | | min_numeric_length | integer | Minimum number of numeric characters required | | min_symbol_length | integer | Minimum number of symbol characters required | | min_upper_case_length | integer | Minimum number of uppercase characters required | | min_letter_length | integer | Minimum number of letter characters required | | max_chars | integer | Maximum number of characters allowed in the passcode | | max_numeric_sequence | integer | Maximum length of allowed numeric sequence in the passcode | | grace_period | integer | Grace period in minutes before passcode is required after screen lock. Default: 60 | | allow_fingerprint | integer | Whether fingerprint authentication is allowed. 0 = Restrict, 1 = Allow. Default: 1 | | allow_iris_scan | boolean | Whether iris scan authentication is allowed. Default: true | | allow_face_unlock | boolean | Whether face unlock authentication is allowed. Default: true | | allow_one_lock | boolean | Whether unified lock (same lock for device and work profile) is allowed. Default: true | | set_default_passcode | boolean | Whether a default passcode is set on the device. Default: false | | allow_change_default_passcode | boolean | Whether the user can change the default passcode. Default: true | | new_default_passcode | string | Default passcode value (write-only; use new_default_passcode_id for credential ID reads) | | scope_for_passcode | integer | Scope of the passcode policy. 0 = Device, 1 = Work Profile. Default: 0 | | allow_trust_agents | integer | Whether Smart Lock trust agents are allowed. 0 = Disallow, 1 = Allow. Default: 1 | | new_default_passcode_id | long | ID of the saved credential for the default passcode | | passcode_complexity | integer | Password complexity level. 1 = Low, 2 = Medium, 3 = High. Default: 1 | | strong_auth_timeout | integer | Timeout in seconds before strong authentication is required. 0 = Use Default. Default: 0 | ### Possible Response Codes | Code | Type | |---|---| | 200 | HTTP code | ### Sample Response: HTTP 200 Passcode payload successfully added ```json { "min_passcode_length": -1, "max_passcode_age": 0, "payload_id": 9007199254741000, "passcode_type": -1, "min_lower_case_length": 1, "min_non_letter_length": 1, "no_of_passcode_maintained": 0, "min_symbol_length": 1, "auto_lock_idle_for": 0, "min_numeric_length": 1, "max_failed_attempts": -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.