# Associate a fence (compliance) policy to one or more device groups associate groups to fence policy ## Endpoints `POST` `/api/v1/mdm/compliance/{compliance_id}/groups` ## Request URL https://[{serverurl}](https://www.manageengine.com/mobile-device-management/help/api/cloud/oauth-authentication-endpoint-domain.html)/api/v1/mdm/compliance/{compliance_id}/groups ## Scope `MDMOnDemand.MDMInventory.CREATE` ## Header `Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52` ## Request Parameters ### Request Headers - **Content-Type** `string` **Mandatory**: `application/json;charset=UTF-8` - **Accept** `string` **Mandatory**: `application/json` ### Path Parameters - **compliance_id** `string` **Mandatory** Unique identifier of the compliance policy. Obtain from the [Add Fence Policy](https://www.manageengine.com/mobile-device-management/help/api/cloud/geofencing-add-fence-policy.html) or [Get Fence Policies](https://www.manageengine.com/mobile-device-management/help/api/cloud/geofencing-get-fence-policy-details.html) response. ### Request Body `application/json` - `JSON object` - **group_ids** `array` **Mandatory** Array of group IDs (as strings) to associate with the fence policy. Obtain from the [Get Group List](https://www.manageengine.com/mobile-device-management/help/api/cloud/groups-get-group-list.html) response. ## Sample Request ```curl curl --request POST \ --url https://appdomain/api/v1/mdm/compliance/{compliance_id}/groups \ --header 'Accept: application/json' \ --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \ --header 'Content-Type: application/json;charset=UTF-8' \ --data '{"group_ids":["9007199254741049","9007199254741050"]}' ``` ### Sample Request Body Associate fence policy to groups ```json { "group_ids": [ "9007199254741049", "9007199254741050" ] } ``` ## Possible Response Codes - **204** `HTTP code` ### Sample Response: HTTP 204 ```text 204 No Content ``` ## Rate Limit ![](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.