# Retrieves the Active Directory OU/group tree for browsing Returns the hierarchical tree of Active Directory organizational units (OUs), computers, and users for the specified domain. The initial call (no guid) returns domain-level nodes. Expanding a node (with guid) returns child OUs and computer/user leaf members. Used for browsing managed AD domain structure. Supports filtering by domain, GUID, AD level, and group type/category. ## Endpoints GET `/api/1.4/customgroup/ouTree` ## Request URL `https://{server-hostname}:8383/api/1.4/customgroup/ouTree` ## Scope `Common.READ` ## Header `Authorization: d92d4xxxxxxxxxxxxx15f52` ## Request Parameters ### Request Headers - **Accept** `string` — **Mandatory** — `application/json` Must be application/json. Only JSON responses are supported. ## Sample Request ```curl curl --request GET \ --url https://appdomain/api/1.4/customgroup/ouTree \ --header 'Accept: application/json' \ --header 'Authorization: d92d4xxxxxxxxxxxxx15f52' ``` ## Response Parameters ### HTTP code 200 #### Response Body — application/json `JSON Object` - **message_type** `string` Always 'ouTree' for this endpoint. - **message_response** `JSON Object` Response payload container. - **message_version** `string` API version: '1.4'. - **status** `string` 'success' when the request completed without errors. ### HTTP code 500 #### Response Body — application/json `JSON Object` - **message_type** `string` Always 'ouTree' for this endpoint. - **message_version** `string` API version: '1.4'. - **status** `string` Always 'error' for error responses. - **error_code** `string` Internal error code: '1003' (INTERNAL_ERROR). - **error_description** `string` Resolved I18N message, typically: An internal error occurred while processing the request. ## Possible Response Codes - **200** — HTTP code - **500** — HTTP code ## Sample Response: HTTP 200 Root call to `/ouTree` (no domainName, no guid) returns the managed-domain list. AD domains have targetType=5 with isAdDomain=true and a synthesised distinguishedName. Child OUs/computers/users are fetched in a follow-up call with that domain's guid; this example interleaves them for illustration. targetType uses Resource constants: 5=Domain, 6=OU/Container, 1=Computer (leaf), 2=User (leaf). Root parent is '--'. ```json { "message_type": "ouTree", "message_response": { "outree": { "targets": [ { "isAdDomain": true, "parent": "--", "domainName": "CORP", "guid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "distinguishedName": "DC=corp,DC=local", "targetType": "5", "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "label": "CORP", "properties": { "expandable": true, "selectable": false, "isSelected": false } }, { "parent": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "domainName": "CORP", "guid": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "distinguishedName": "OU=Finance,DC=corp,DC=local", "targetType": "6", "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "label": "Finance", "properties": { "expandable": true, "selectable": true, "isSelected": false } }, { "parent": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "domainName": "CORP", "guid": "d4e5f6a7-b8c9-0123-defa-234567890123", "distinguishedName": "OU=Engineering,DC=corp,DC=local", "targetType": "6", "id": "d4e5f6a7-b8c9-0123-defa-234567890123", "label": "Engineering", "properties": { "expandable": false, "selectable": true, "isSelected": false } } ] } }, "message_version": "1.4", "status": "success" } ``` Workgroup domain tree (isAdDomain=false) with no OU hierarchy. Workgroup nodes lack distinguishedName. ```json { "message_type": "ouTree", "message_response": { "outree": { "targets": [ { "isAdDomain": false, "parent": "--", "domainName": "WORKGROUP", "guid": "", "targetType": "5", "id": "12345", "label": "WORKGROUP", "properties": { "expandable": true, "selectable": true, "isSelected": false } } ] } }, "message_version": "1.4", "status": "success" } ``` Expanding a specific OU by guid parameter to load its child OUs. ```json { "message_type": "ouTree", "message_response": { "outree": { "targets": [ { "parent": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "domainName": "CORP", "guid": "c3d4e5f6-a7b8-9012-cdef-123456789012", "distinguishedName": "OU=Finance-Workstations,OU=Finance,DC=corp,DC=local", "targetType": "6", "id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "label": "Finance-Workstations", "properties": { "expandable": false, "selectable": true, "isSelected": false } }, { "parent": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "domainName": "CORP", "guid": "f7a8b9c0-d1e2-3456-abcd-678901234567", "distinguishedName": "OU=Accounting,OU=Finance,DC=corp,DC=local", "targetType": "6", "id": "f7a8b9c0-d1e2-3456-abcd-678901234567", "label": "Accounting", "properties": { "expandable": false, "selectable": true, "isSelected": false } } ] } }, "message_version": "1.4", "status": "success" } ``` ## Sample Response: HTTP 500 Unexpected server-side failure retrieving OU tree. ```json { "error_description": "An internal error occurred while processing the request.", "message_type": "ouTree", "error_code": "1003", "message_version": "1.4", "status": "error" } ``` ![ ](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.