Add directory role member

Use this API to create a new directory role member.

Prerequisites

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

HTTP request

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

Request headers

Name Type Description
Authorization string Bearer . Required.
Content-Type application/json  

Request body

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

Response

If successful, this method returns 204, No Content response code.

Example

Request
POST https://graph.microsoft.com/v1.0/directoryRoles/{id}/members
Content-type: application/json

{
  "@odata.id": "https://graph.microsoft.com/v1.0/directoryObjects/{id}"
}
Response

Note: The response object shown here may be truncated for brevity.

HTTP/1.1 204 No Content
Content-type: text/plain