# Clear app data on multiple devices or groups simultaneously Initiates bulk clear app data. ## Endpoint **POST** `/api/v1/mdm/actions/clear_app_data` ## Request URL ```text https://{server-hostname}:8383/api/v1/mdm/actions/clear_app_data ``` ## Scope ```text MDMInventory.CREATE ``` ## Header ```text Authorization: d92d4xxxxxxxxxxxxx15f52 ``` ## Request Parameters ### Request Headers | Parameter | Type | Required | Value | |---|---|---|---| | Content-Type | string | Mandatory | application/json | | Accept | string | Mandatory | application/json | ### Request Body `application/json` | Parameter | Type | Required | Description | |---|---|---|---| | devices | array | Mandatory | Array of device IDs to clear app data on. Fetch from [Get Device List](https://www.manageengine.com/products/desktop-central/help/api/onpremise/devices-get-device-list.html) | | groups | array | Optional | Array of group IDs whose devices should have app data cleared | | clear_data_for_all_apps | boolean | Optional | Whether to clear data for all apps. If false, use `app_ids` to specify which apps | | app_ids | array | Optional | Array of app IDs whose data should be cleared (used when `clear_data_for_all_apps` is false). Obtain from the [Get App List](https://www.manageengine.com/products/desktop-central/help/api/onpremise/app-management-get-an-app.html) response | | inclusion | boolean | Optional | If true, clear data only for the specified `app_ids`; if false, clear data for all apps except the specified ones | | reason_message | string | Optional | Reason to execute bulk action | ## Sample Request ```curl curl --request POST \ --url https://appdomain/api/v1/mdm/actions/clear_app_data \ --header 'Accept: application/json' \ --header 'Authorization: d92d4xxxxxxxxxxxxx15f52' \ --header 'Content-Type: application/json' \ --data '{"inclusion":true,"clear_data_for_all_apps":false,"devices":["9508000000013121"],"reason_message":"Clearing app data due to app malfunction","app_ids":[9007199254741000,9007199254741002],"groups":[]}' ``` ## Sample Request Body Clear app data on multiple devices. ```json { "inclusion": true, "clear_data_for_all_apps": false, "devices": [ "9508000000013121" ], "reason_message": "Clearing app data due to app malfunction", "app_ids": [ 9007199254741000, 9007199254741002 ], "groups": [] } ``` ## Response Parameters ### HTTP Code 200 Response Body: `application/json` | Parameter | Type | Description | |---|---|---| | success_list | JSON Array | List of devices where the command was sent successfully | | total_count | integer | Total count of devices selected for the bulk action | | not_applicable_count | integer | Count of devices where the command is not applicable | | success_count | integer | Count of devices where the command was successfully initiated | | na_list | JSON Array | List of devices where the command is not applicable | ## Possible Response Codes | Code | Type | |---|---| | 200 | HTTP code | ## Sample Response: HTTP 200 Bulk action result with success and not-applicable lists. ```json { "success_list": [ { "device_id": "9508000000013121", "remarks": "--", "status": "SCHEDULED" } ], "total_count": 3, "not_applicable_count": 1, "success_count": 1, "na_list": [ { "device_id": "9508000000013691", "remarks": "Device is unmanaged", "status": "NOT_APPLICABLE" } ] } ``` ## Rate Limits **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.