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.

Prerequisites

The following scope is required to execute this API: Directory.AccessAsUser.All

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