directoryDefinition: discover

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Discover the latest schema definition for provisioning to an application.

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.ReadWrite.All
Delegated (personal Microsoft account) Not supported.
Application Application.ReadWrite.OwnedBy, Directory.ReadWrite.All

To configure application provisioning or HR-driven provisioning, the calling user must also be assigned the Application Administrator or Cloud Application Administrator directory role.

To configure Azure AD Cloud Sync, the calling user must also be assigned the Hybrid Identity Administrator directory role.

HTTP request

POST /servicePrincipals/{id}/synchronization/jobs/{jobId}/schema/directories/{directoryId}/discover

Request headers

Header Value
Authorization Bearer {token} (required)

Request body

Do not supply a request body for this method.

Response

If successful, this method returns a 200 OK response with a directoryDefinition object.

Example

Request

The following is an example of a request.

POST https://graph.microsoft.com/beta/servicePrincipals/{id}/synchronization/jobs/{jobId}/schema/directories/{directoryId}/discover

Response

The following is an example of a response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-type: application/json

{
  "discoverabilities": "AttributeNames, AttributeDataTypes",
  "discoveryDateTime": "2019-03-20T15:47:50.4707552Z",
  "id": "directoryDefinitionId",
  "objects": [{
        "name": "User",
        "attributes": [{
                "name": "Id",
                "type": "String"
            }, {
                "name": "FirstName",
                "type": "String"
            },
            {
                "name": "CustomExendedAttribute",
                "type": "String"
            }  
        ]
    }],
  "version": "bf8c03ac-d45e-47fe-b3a1-711a9418b2b1"
}