Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Permission type
Least privileged permissions
Higher privileged permissions
Delegated (work or school account)
AdministrativeUnit.ReadWrite.All
Not available.
Delegated (personal Microsoft account)
Not supported.
Not supported.
Application
AdministrativeUnit.ReadWrite.All
Not available.
To create an administrative unit, the calling principal must be assigned one of the following Microsoft Entra roles:
Privileged Role Administrator
Global Administrator
HTTP request
POST /directory/administrativeUnits
Request headers
Name
Description
Authorization
Bearer {token}. Required.
Content-type
application/json. Required.
Request body
In the request body, supply a JSON representation of an administrativeUnit object.
Because the administrativeUnit resource supports extensions, you can use the POST operation and add custom properties with your own data to the administrative unit while creating it.
Response
If successful, this method returns a 201 Created response code and an administrativeUnit object in the response body.
POST https://graph.microsoft.com/v1.0/directory/administrativeUnits
Content-type: application/json
{
"displayName": "Seattle District Technical Schools",
"description": "Seattle district technical schools administration",
"visibility": "HiddenMembership"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new AdministrativeUnit
{
DisplayName = "Seattle District Technical Schools",
Description = "Seattle district technical schools administration",
Visibility = "HiddenMembership",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Directory.AdministrativeUnits.PostAsync(requestBody);
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc directory administrative-units create --body '{\
"displayName": "Seattle District Technical Schools",\
"description": "Seattle district technical schools administration",\
"visibility": "HiddenMembership"\
}\
'
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AdministrativeUnit();
$requestBody->setDisplayName('Seattle District Technical Schools');
$requestBody->setDescription('Seattle district technical schools administration');
$requestBody->setVisibility('HiddenMembership');
$result = $graphServiceClient->directory()->administrativeUnits()->post($requestBody)->wait();
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(credentials, scopes)
request_body = AdministrativeUnit(
display_name = "Seattle District Technical Schools",
description = "Seattle district technical schools administration",
visibility = "HiddenMembership",
)
result = await graph_client.directory.administrative_units.post(request_body)