Add a member

Important: APIs under the /beta version in Microsoft Graph are in preview and are subject to change. Use of these APIs in production applications is not supported.

Use this API to add a member (user or group) to an administrative unit.

NOTE: Currently it's only possible to add one member at a time to an administrative unit.

Permissions

One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) Directory.AccessAsUser.All
Delegated (personal Microsoft account) Not supported.
Application Not supported.

HTTP request

POST /administrativeUnits/{id}/members/$ref

Request headers

Name Description
Authorization Bearer {token}. Required.

Request body

In the request body, supply a JSON representation of a user, group or directoryObject to be added.

Response

If successful, this method returns 204 No Content response code. It does not return anything in the response body.

Example

Request

Here is an example of the request.

POST https://graph.microsoft.com/beta/administrativeUnits/{id}/members/$ref
Content-type: application/json
Content-length: 109

{
  "@odata.id":"https://graph.microsoft.com/beta/groups/{id}"
}

In the request body, supply a JSON representation of the id of the user or group object you want to add.

Response

Here is an example of the response.

HTTP/1.1 204 No Content