Organizational Units API
The Organizational Units (OUs) API provides programmatic access to manage Active Directory (AD) OUs. The ADManager Plus API offers endpoints to update and retrieve OUs using structured requests with support for filtering, sorting, and pagination. OUs are used to organize users, groups, computers, and other OUs within a domain, and the API enables administrators to automate restructuring, attribute updates, and reporting with consistency across environments.
List AD OUs
This endpoint retrieves AD OUs based on specified filters, sort order, and pagination. You can also limit the response to specific fields for efficiency. It is often used for OU inventory, reporting, or preparing for administrative delegation.
Scope : Read OU action, All OU management actions
Delegated role : All OUs Report
Query Parameters
Example: domain1.com,domain2.com
eg: (FULL_NAME eq Finance) and (CITY eq New York)
eg: FULL_NAME
Headers
headers_data = Map();
headers_data.put("Accept", "application/json");
headers_data.put("X-Module", "External API");
headers_data.put("X-Date-Time-Format", "SOME_STRING_VALUE");
headers_data.put("Authorization", "REPLACE_KEY_VALUE");
response = invokeUrl
[
url: "http://admanagerplus:8080/api/v2/organizational_units?domains=domain1.com"
type: GET
headers: headers_data
connection: <connection_name>
];
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("http://admanagerplus:8080/api/v2/organizational_units?domains=domain1.com")
.get()
.addHeader("Accept", "application/json")
.addHeader("X-Module", "External API")
.addHeader("X-Date-Time-Format", "SOME_STRING_VALUE")
.addHeader("Authorization", "REPLACE_KEY_VALUE")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'GET',
headers: {
Accept: 'application/json',
'X-Module': 'External API',
'X-Date-Time-Format': 'SOME_STRING_VALUE',
Authorization: 'REPLACE_KEY_VALUE'
}
};
fetch('http://admanagerplus:8080/api/v2/organizational_units?domains=domain1.com', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPConnection("admanagerplus:8080")
headers = {
'Accept': "application/json",
'X-Module': "External API",
'X-Date-Time-Format': "SOME_STRING_VALUE",
'Authorization': "REPLACE_KEY_VALUE"
}
conn.request("GET", "/api/v2/organizational_units?domains=domain1.com", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("http");
const options = {
"method": "GET",
"hostname": "admanagerplus",
"port": "8080",
"path": "/api/v2/organizational_units?domains=domain1.com",
"headers": {
"Accept": "application/json",
"X-Module": "External API",
"X-Date-Time-Format": "SOME_STRING_VALUE",
"Authorization": "REPLACE_KEY_VALUE"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
curl --request GET \
--url 'http://admanagerplus:8080/api/v2/organizational_units?domains=domain1.com' \
--header 'Accept: application/json' \
--header 'Authorization: REPLACE_KEY_VALUE' \
--header 'X-Date-Time-Format: SOME_STRING_VALUE' \
--header 'X-Module: External API'
Create AD OUs
This endpoint creates new OUs in AD, either individually or in bulk. You can define the parent container and optional attributes to maintain a structured directory hierarchy. It is typically used to automate domain organization, delegation models, and large-scale directory provisioning.
Scope : Create OU action, All OU management actions
Delegated role : Create Bulk OUs
Arguments
Query Parameters
eg: domain1.com
Headers
parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("Accept", "application/json");
headers_data.put("Content-Type", "application/json");
headers_data.put("X-Module", "External API");
headers_data.put("Authorization", "REPLACE_KEY_VALUE");
response = invokeUrl
[
url: "http://admanagerplus:8080/api/v2/organizational_units?domain=domain1.com"
type: POST
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: <connection_name>
];
info response;
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}");
Request request = new Request.Builder()
.url("http://admanagerplus:8080/api/v2/organizational_units?domain=domain1.com")
.post(body)
.addHeader("Accept", "application/json")
.addHeader("Content-Type", "application/json")
.addHeader("X-Module", "External API")
.addHeader("Authorization", "REPLACE_KEY_VALUE")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
'X-Module': 'External API',
Authorization: 'REPLACE_KEY_VALUE',
'content-type': 'application/json'
},
body: '{"field1":"value1","field2":"value2"}'
};
fetch('http://admanagerplus:8080/api/v2/organizational_units?domain=domain1.com', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPConnection("admanagerplus:8080")
payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"
headers = {
'Accept': "application/json",
'Content-Type': "application/json",
'X-Module': "External API",
'Authorization': "REPLACE_KEY_VALUE",
'content-type': "application/json"
}
conn.request("POST", "/api/v2/organizational_units?domain=domain1.com", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("http");
const options = {
"method": "POST",
"hostname": "admanagerplus",
"port": "8080",
"path": "/api/v2/organizational_units?domain=domain1.com",
"headers": {
"Accept": "application/json",
"Content-Type": "application/json",
"X-Module": "External API",
"Authorization": "REPLACE_KEY_VALUE",
"content-type": "application/json"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({field1: 'value1', field2: 'value2'}));
req.end();
curl --request POST \
--url 'http://admanagerplus:8080/api/v2/organizational_units?domain=domain1.com' \
--header 'Accept: application/json' \
--header 'Authorization: REPLACE_KEY_VALUE' \
--header 'Content-Type: application/json' \
--header 'X-Module: External API' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"template": {
"template_name": "Standard OU Template"
},
"data": [
{
"attributes": {
"name": "Sales_OU",
"description": "OU for Sales Department",
"l": "Austin",
"co": "United States"
}
}
]
}
Update AD OUs
This endpoint updates existing OUs with the specified payload. You can modify attributes such as name, description, location, and administrative details. It is commonly used when restructuring domains, changing OU ownership, or updating organizational information.
Scope : Modify OU action, All OU management actions
Delegated role : Modify Bulk OUs, Bulk OU Modification
Arguments
Query Parameters
eg: domain1.com
eg: (FULL_NAME eq Finance) and (CITY eq New York)
eg: FULL_NAME
Headers
parameters_data='{"data":{"attributes":{"name":"APIOU1","OUName":"OU=OUS,DC=domain,DC=com","managedBy":"Manager1","co":"India","extensionAttribute1":"Custom Value 1"}}}';
headers_data = Map();
headers_data.put("Accept", "application/json");
headers_data.put("Content-Type", "application/json");
headers_data.put("X-Module", "External API");
headers_data.put("Authorization", "REPLACE_KEY_VALUE");
response = invokeUrl
[
url: "http://admanagerplus:8080/api/v2/organizational_units?domain=domain1.com&filter=(FULL_NAME eq Finance) and (CITY eq New York)"
type: PATCH
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: <connection_name>
];
info response;
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"data\":{\"attributes\":{\"name\":\"APIOU1\",\"OUName\":\"OU=OUS,DC=domain,DC=com\",\"managedBy\":\"Manager1\",\"co\":\"India\",\"extensionAttribute1\":\"Custom Value 1\"}}}");
Request request = new Request.Builder()
.url("http://admanagerplus:8080/api/v2/organizational_units?domain=domain1.com&filter=(FULL_NAME%20eq%20Finance)%20and%20(CITY%20eq%20New%20York)")
.patch(body)
.addHeader("Accept", "application/json")
.addHeader("Content-Type", "application/json")
.addHeader("X-Module", "External API")
.addHeader("Authorization", "REPLACE_KEY_VALUE")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'PATCH',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
'X-Module': 'External API',
Authorization: 'REPLACE_KEY_VALUE',
'content-type': 'application/json'
},
body: '{"data":{"attributes":{"name":"APIOU1","OUName":"OU=OUS,DC=domain,DC=com","managedBy":"Manager1","co":"India","extensionAttribute1":"Custom Value 1"}}}'
};
fetch('http://admanagerplus:8080/api/v2/organizational_units?domain=domain1.com&filter=(FULL_NAME%20eq%20Finance)%20and%20(CITY%20eq%20New%20York)', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPConnection("admanagerplus:8080")
payload = "{\"data\":{\"attributes\":{\"name\":\"APIOU1\",\"OUName\":\"OU=OUS,DC=domain,DC=com\",\"managedBy\":\"Manager1\",\"co\":\"India\",\"extensionAttribute1\":\"Custom Value 1\"}}}"
headers = {
'Accept': "application/json",
'Content-Type': "application/json",
'X-Module': "External API",
'Authorization': "REPLACE_KEY_VALUE",
'content-type': "application/json"
}
conn.request("PATCH", "/api/v2/organizational_units?domain=domain1.com&filter=(FULL_NAME%20eq%20Finance)%20and%20(CITY%20eq%20New%20York)", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("http");
const options = {
"method": "PATCH",
"hostname": "admanagerplus",
"port": "8080",
"path": "/api/v2/organizational_units?domain=domain1.com&filter=(FULL_NAME%20eq%20Finance)%20and%20(CITY%20eq%20New%20York)",
"headers": {
"Accept": "application/json",
"Content-Type": "application/json",
"X-Module": "External API",
"Authorization": "REPLACE_KEY_VALUE",
"content-type": "application/json"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
data: {
attributes: {
name: 'APIOU1',
OUName: 'OU=OUS,DC=domain,DC=com',
managedBy: 'Manager1',
co: 'India',
extensionAttribute1: 'Custom Value 1'
}
}
}));
req.end();
curl --request PATCH \
--url 'http://admanagerplus:8080/api/v2/organizational_units?domain=domain1.com&filter=(FULL_NAME%20eq%20Finance)%20and%20(CITY%20eq%20New%20York)' \
--header 'Accept: application/json' \
--header 'Authorization: REPLACE_KEY_VALUE' \
--header 'Content-Type: application/json' \
--header 'X-Module: External API' \
--header 'content-type: application/json' \
--data '{"data":{"attributes":{"name":"APIOU1","OUName":"OU=OUS,DC=domain,DC=com","managedBy":"Manager1","co":"India","extensionAttribute1":"Custom Value 1"}}}'
{
"data": {
"attributes": {
"name": "APIOU1",
"OUName": "OU=OUS,DC=domain,DC=com",
"managedBy": "Manager1",
"co": "India",
"extensionAttribute1": "Custom Value 1"
}
}
}