# Retrieves resources available for adding to a custom group Returns managed resources (computers or users) that can be added as members to a custom group, filtered by group type, category, domain, and search text. Supports pagination and sorting. Use the returned `resourceId` values in the `resourceIds` array when calling [Create Static CG](https://www.manageengine.com/products/desktop-central/custom-groups-create-static-cg.html), [Create Static Unique CG](https://www.manageengine.com/products/desktop-central/custom-groups-create-static-unique-cg.html), [Update Static CG](https://www.manageengine.com/products/desktop-central/custom-groups-update-static-cg.html), or [Update Static Unique CG](https://www.manageengine.com/products/desktop-central/custom-groups-update-static-unique-cg.html). Non-admin users cannot fetch user-type or static-unique category resources. ## Endpoint **POST** `/api/1.4/customgroup/availableResources` ## Request URL ``` https://{serverurl}/api/1.4/customgroup/availableResources ``` `{serverurl}`: See [OAuth Authentication - Endpoint Domain](https://www.manageengine.com/products/desktop-central/oauth-authentication-endpoint-domain.html) ## Scope ``` DesktopCentralCloud.Common.READ ``` ## Headers ``` Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52 Content-Type: application/json Accept: application/json ``` - **Content-Type** (string, mandatory): Must be `application/json`. Request body must be valid JSON. - **Accept** (string, mandatory): Must be `application/json`. Only JSON responses are supported. ## Request Parameters ### Request Body (application/json) JSON object with the following fields: - **groupCategory** (string, mandatory): Target group category: `'1'` = Static, `'2'` = Dynamic, `'5'` = Static Unique. - **groupType** (string, mandatory): Target group type: `'1'` = Computers, `'2'` = Users. - **domainFilter** (array, optional): Domain NetBIOS names to restrict results (e.g., `["CORP","BRANCH1"]`). Omit for all domains. - **charFilter** (string, optional): Text filter on resource name — only matching resources returned. - **rangeIndex** (long, optional): Page number (1-based). Default: `1`. - **limit** (string, optional): Max resources per page. Default: `30`. - **sortOrder** (string, optional): Sort direction: `'ASC'` (A–Z) or `'DESC'` (Z–A), case-insensitive. Default: `ASC`. ## Sample Request ### Curl ```bash curl --request POST \ --url https://appdomain/api/1.4/customgroup/availableResources \ --header 'Accept: application/json' \ --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \ --header 'Content-Type: application/json' \ --data '{"groupType":"1","groupCategory":"1"}' ``` ### Java ```java import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.io.IOException; import java.net.http.HttpTimeoutException; public class Main { public static void main(String[] args) throws IOException, InterruptedException { HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://appdomain/api/1.4/customgroup/availableResources")) .header("Content-Type", "application/json") .header("Accept", "application/json") .header("Authorization", "Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52") .method("POST", HttpRequest.BodyPublishers.ofString("{\"groupType\":\"1\",\"groupCategory\":\"1\"}")) .build(); HttpResponse response = HttpClient.newHttpClient() .send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } } ``` ### Python ```python import http.client conn = http.client.HTTPSConnection("appdomain") payload = "{\"groupType\":\"1\",\"groupCategory\":\"1\"}" headers = { 'Content-Type': "application/json", 'Accept': "application/json", 'Authorization': "Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52" } conn.request("POST", "/api/1.4/customgroup/availableResources", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ### Deluge ```javascript headersMap = Map(); headersMap.put("Content-Type", "application/json"); headersMap.put("Accept", "application/json"); data = Map(); data.put("groupType","value"); data.put("groupCategory","value"); response = invokeUrl [ url: "https://appDomain/api/1.4/customgroup/availableResources" type: POST headers: headersMap body: data connection: connection_name ] info response; ``` ### PowerShell ```powershell $headers=@{} $headers.Add("Content-Type", "application/json") $headers.Add("Accept", "application/json") $headers.Add("Authorization", "Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52") $response = Invoke-WebRequest -Uri 'https://appdomain/api/1.4/customgroup/availableResources' -Method POST -Headers $headers -ContentType 'application/json' -Body '{"groupType":"1","groupCategory":"1"}' ``` ## Sample Request Body ### Fetch static computer resources filtered by two domains and name prefix ```json { "groupType": "1", "rangeIndex": "1", "groupCategory": "1", "charFilter": "SRV", "sortOrder": "ASC", "limit": "30", "domainFilter": [ "CORP", "BRANCH1" ] } ``` ### Fetch all available computer resources with only required fields ```json { "groupType": "1", "groupCategory": "1" } ``` ### Fetch available user resources for a static user group ```json { "groupType": "2", "rangeIndex": "1", "groupCategory": "1", "limit": "50", "domainFilter": [ "CORP" ] } ``` ### Fetch resources for a static unique computer group ```json { "groupType": "1", "rangeIndex": "1", "groupCategory": "5", "limit": "50", "domainFilter": [ "CORP" ] } ``` ## Response Parameters ### HTTP 200 **Response Body**: `application/json` - **message_type** (string): Always `'availableResources'` for this endpoint. - **message_response** (object): Response payload container. - **availableresources** (object): Map keyed by resource ID (string). Empty object `{}` when no resources match. - **resourceId** (long): Unique resource ID — use in `resourceIds` array when calling [Create Static CG](https://www.manageengine.com/products/desktop-central/custom-groups-create-static-cg.html), [Create Static Unique CG](https://www.manageengine.com/products/desktop-central/custom-groups-create-static-unique-cg.html), [Update Static CG](https://www.manageengine.com/products/desktop-central/custom-groups-update-static-cg.html), or [Update Static Unique CG](https://www.manageengine.com/products/desktop-central/custom-groups-update-static-unique-cg.html). - **name** (string): Display name: computer hostname or AD username. - **domainName** (string): NetBIOS domain the resource belongs to. - **osPlatform** (string): *Computer groups only* — OS platform identifier (e.g., `1` = Windows, `2` = Mac, `3` = Linux). Absent for user groups. - **message_version** (string): API version: `'1.4'`. - **status** (string): `'success'` when the request completed without errors. ### HTTP 500 **Response Body**: `application/json` - **message_type** (string): Always `'availableResources'`. - **message_version** (string): API version: `'1.4'`. - **status** (string): Always `'error'`. - **error_code** (string): Internal error code: `'1003'` (INTERNAL_ERROR). - **error_description** (string): Typically: `An internal error occurred while processing the request.` ## Sample Response: HTTP 200 ### Computer resources keyed by resource ID ```json { "message_type": "availableResources", "message_response": { "availableresources": { "101": { "resourceId": 101, "domainName": "CORP", "name": "SRV-DC01", "osPlatform": "1" }, "102": { "resourceId": 102, "domainName": "CORP", "name": "SRV-APP01", "osPlatform": "1" }, "201": { "resourceId": 201, "domainName": "BRANCH1", "name": "SRV-FILE01", "osPlatform": "1" } } }, "message_version": "1.4", "status": "success" } ``` ### User resources keyed by resource ID ```json { "message_type": "availableResources", "message_response": { "availableresources": { "501": { "resourceId": 501, "domainName": "CORP", "name": "jsmith" }, "502": { "resourceId": 502, "domainName": "CORP", "name": "mjones" } } }, "message_version": "1.4", "status": "success" } ``` ### No matching resources ```json { "message_type": "availableResources", "message_response": { "availableresources": {} }, "message_version": "1.4", "status": "success" } ``` ## Sample Response: HTTP 500 ```json { "error_description": "An internal error occurred while processing the request.", "message_type": "availableResources", "error_code": "1003", "message_version": "1.4", "status": "error" } ``` ## Possible Response Codes - **200** — Success - **500** — Internal Server Error ## Rate Limiting **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.