# Get current targets as domain and value pairs Returns the current targets of a collection configuration as an array of domain and value pairs. The response format matches the input expected by the [modifyTargets](https://www.manageengine.com/products/desktop-central/help/api/cloud/deployment-fw-modify-targets-legacy.html) endpoint — making it easy to fetch, modify, and resubmit targets without format conversion. This is the default format. No additional query parameters are needed. Omit `useResourceIdFormat` or set it to `false`. ## Endpoint `GET /dcapi/target/{collectionId}/getTargets` ## Request ### Request URL ```text https://{serverurl}/dcapi/target/{collectionId}/getTargets ``` `{serverurl}`: [OAuth Authentication Endpoint Domain](https://www.manageengine.com/products/desktop-central/help/api/cloud/oauth-authentication-endpoint-domain.html) ### Scope ```text DesktopCentralCloud.Configurations.READ, DesktopCentralCloud.SWDeployment.READ, DesktopCentralCloud.PatchMgmt.READ, DesktopCentralCloud.VulnerabilityMgmt.READ ``` ### Header ```text Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52 ``` ### Request Parameters #### Request Headers - **Accept** (`string`, mandatory): `application/getTargets.v1+json` #### Path Parameters - **collectionId** (`string`, mandatory): The unique numeric identifier of the collection whose targets are to be retrieved. Fetch from [Get Configurations View](https://www.manageengine.com/products/desktop-central/help/api/cloud/deployment-fw-get-configurations-view.html). #### Query Parameters - **useResourceIdFormat** (`boolean`, optional): Omit or set to `false` to receive the domain/value pairs response format. ### Sample Request ```curl curl --request GET \ --url https://appdomains/dcapi/target/{collectionId}/getTargets \ --header 'Accept: application/getTargets.v1+json' \ --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' ``` ## Response Parameters ### HTTP 200 Response body: `application/json` - `JSON Object` - **collectionId** (`long`): Unique collection ID whose targets are returned. - **targets** (`JSON Array`): Array containing a single filter entry. Each entry holds a filter object with the target type and an array of name/domain pairs identifying targeted resources. ### HTTP 400 Response body: `application/json` - `JSON Object` - **error_code** (`string`): `CONFIG_INVALID_INPUT_DATA`: the specified collection is expired or no longer alive. - **error_description** (`string`): Message indicating the collection is not active or has expired. ### HTTP 401 Response body: `application/json` - `JSON Object` - **errorCode** (`long`): Unauthorized error code returned when authentication credentials are missing, expired, or invalid (`authentication=required`). - **errorMsg** (`string`): Authentication failure reason. ## Sample Responses ### HTTP 200 #### Computer-type collection with two targeted computers (domain and value format) ```json { "collectionId": 12345, "targets": [ { "filter": { "values": [ { "domain": "CORP", "value": "PC-001" }, { "domain": "CORP", "value": "LAPTOP-DEF" } ], "type": "Computer" } } ] } ``` #### User-type collection with one targeted user (domain and value format) ```json { "collectionId": 67890, "targets": [ { "filter": { "values": [ { "domain": "CORP", "value": "jdoe" } ], "type": "User" } } ] } ``` ### HTTP 400 #### Collection is expired or no longer active ```json { "error_description": "Collection is not active or expired", "error_code": "CONFIG_INVALID_INPUT_DATA" } ``` ### HTTP 401 #### User lacks read role for this configuration type ```json { "error_description": "Access denied - You are not allowed to access the requested resource.", "error_code": "UAC_UNAUTHORIZED" } ``` ## 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.