# Enables or disables the retain recovery key setting Enables or disables the retain recovery key setting for the customer, optionally removing old recovery keys. ## Endpoints `POST /bitlocker/api/retainRecoveryKey` ## Request ### Request URL https://[serverurl](https://www.manageengine.com/products/desktop-central/help/api/cloud/oauth-authentication-endpoint-domain.html)/bitlocker/api/retainRecoveryKey ### Scope `DesktopCentralCloud.DataEncryption.CREATE` ### Header `Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52` ### Request Parameters #### Request Headers | Name | Type | Required | Value | |---|---|---|---| | Accept | string | Mandatory | application/json | | Content-Type | string | Mandatory | application/json | #### Request Body `application/json` | Name | Type | Required | Description | |---|---|---|---| | retainRecoveryKeyEnabled | boolean | Mandatory | Set to true to enable recovery key retention, false to disable. Required. | | removeOldRecKey | boolean | Optional | Optional. Set to true to immediately remove old recovery keys. Only relevant when disabling retention (`retainRecoveryKeyEnabled=false`). | ### Sample Request ```curl curl --request POST \ --url https://appdomains/bitlocker/api/retainRecoveryKey \ --header 'Accept: application/json' \ --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \ --header 'Content-Type: application/json' \ --data '{"retainRecoveryKeyEnabled":true}' ``` ### Sample Request Body #### Enable recovery key retention ```json { "retainRecoveryKeyEnabled": true, "removeOldRecKey": false } ``` #### Disable recovery key retention and remove old keys ```json { "retainRecoveryKeyEnabled": false, "removeOldRecKey": true } ``` ## Response Parameters ### HTTP Code 200 Response Body — `application/json` | Name | Type | Description | |---|---|---| | retainRecoveryKeyEnabled | boolean | Current state of the recovery key retention setting | | paramValue | string | Persisted parameter value as string ('true' or 'false') | ### HTTP Code 400 Response Body — `application/json` | Name | Type | Description | |---|---|---| | errorCode | long | Validation error code raised when the request body is missing, malformed, exceeds max-len=100, or fails retainRecoveryKeyTemplate validation (retainRecoveryKeyEnabled / removeOldRecKey not boolean) | | errorMsg | string | Detailed message identifying which body key failed validation or why the payload was rejected | ### HTTP Code 401 Response Body — `application/json` | Name | Type | Description | |---|---|---| | errorCode | long | Unauthorized error code: credentials missing, expired, or invalid | | errorMsg | string | Authentication failure reason | ### HTTP Code 403 Response Body — `application/json` | Name | Type | Description | |---|---|---| | errorCode | long | Error code indicating insufficient permissions | | errorMsg | string | Message indicating insufficient privileges to access this resource | ### HTTP Code 429 Response Body — `application/json` | Name | Type | Description | |---|---|---| | errorCode | long | Rate limit error code returned when the API call reached threshold | | errorMsg | string | Rate limit exceeded message with retry guidance | ### HTTP Code 500 Response Body — `application/json` | Name | Type | Description | |---|---|---| | errorCode | long | Internal server error code (DCAPIErrorCodes.INTERNAL_ERROR) thrown when persisting the retain-recovery-key parameter or removing old recovery keys fails | | errorMsg | string | Server-side error message — typically 'Exception while forming response' | ### Possible Response Codes | HTTP Code | |---| | 200 | | 400 | | 401 | | 403 | | 429 | | 500 | ### Sample Response: HTTP 200 Successful update of retain recovery key setting ```json { "retainRecoveryKeyEnabled": true, "paramValue": "true" } ``` ### Sample Response: HTTP 400 Invalid or malformed request body ```json { "errorCode": 40001, "errorMsg": "Invalid request parameters" } ``` ### Sample Response: HTTP 401 Authentication credentials missing or invalid ```json { "errorCode": 40101, "errorMsg": "Authentication failed" } ``` ### Sample Response: HTTP 403 User does not have DataEncryptionRecoveryKey_Admin role ```json { "errorCode": 40301, "errorMsg": "Insufficient privileges to access this resource" } ``` ### Sample Response: HTTP 429 Throttle limit exceeded; client locked out for lock-period minutes ```json { "errorCode": 42901, "errorMsg": "Too many requests. Please retry after the cooldown period" } ``` ### Sample Response: HTTP 500 Internal server error — thrown from catch block via DCAPIException ```json { "errorCode": 10000, "errorMsg": "Exception while forming response" } ``` ## Rate Limits ![](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.