servicePrincipal: delta

Important

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

Get newly created, updated, or deleted service principals without having to perform a full read of the entire resource collection. See Using Delta Query for details.

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

HTTP request

To begin tracking changes, you make a request including the delta function on the servicePrincipal resource.

GET /servicePrincipals/delta

Query parameters

Tracking changes incurs a round of one or more delta function calls. If you use any query parameter (other than $deltatoken and $skiptoken), you must specify it in the initial delta request. Microsoft Graph automatically encodes any specified parameters into the token portion of the nextLink or deltaLink URL provided in the response. You only need to specify any desired query parameters once upfront. In subsequent requests, copy and apply the nextLink or deltaLink URL from the previous response, as that URL already includes the encoded, desired parameters.

Query parameter Type Description
$deltatoken string A state token returned in the deltaLink URL of the previous delta function call for the same resource collection, indicating the completion of that round of change tracking. Save and apply the entire deltaLink URL including this token in the first request of the next round of change tracking for that collection.
$skiptoken string A state token returned in the nextLink URL of the previous delta function call, indicating there are further changes to be tracked in the same resource collection.

Optional query parameters

This method supports OData Query Parameters to help customize the response.

  • You can use a $select query parameter as in any GET request to specify only the properties your need for best performance. The id property is always returned.

  • There is limited support for $filter:

    • The only supported $filter expression is for tracking changes for specific resources, by their id: $filter=id+eq+{value} or $filter=id+eq+{value1}+or+id+eq+{value2}. The number of ids you can specify is limited by the maximum URL length.

Request headers

Name Description
Authorization Bearer <token>
Content-Type application/json

Request body

Do not supply a request body for this method.

Response

If successful, this method returns 200 OK response code and servicePrincipal collection object in the response body. The response also includes a nextLink URL or a deltaLink URL.

  • If a nextLink URL is returned, there are additional pages of data to be retrieved in the session. The application continues making requests using the nextLink URL until a deltaLink URL is included in the response.

  • If a deltaLink URL is returned, there is no more data about the existing state of the resource to be returned. Persist and use the deltaLink URL to learn about changes to the resource in the future.

See:

Example

Request
GET https://graph.microsoft.com/beta/servicePrincipals/delta
Response

Note: The response object shown here may be truncated for brevity. All of the properties will be returned from an actual call.

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

{
  "@odata.context":"https://graph.microsoft.com/beta/$metadata#servicePrincipals",
  "@odata.nextLink":"https://graph.microsoft.com/beta/servicePrincipals/delta?$skiptoken=pqwSUjGYvb3jQpbwVAwEL7yuI3dU1LecfkkfLPtnIjsXoYQp_dpA3cNJWc",
  "value": [
     {
      "accountEnabled": true,
      "addIns": [
        {
          "id": "id-value",
          "type": "type-value",
          "properties": [
            {
              "key": "key-value",
              "value": "value-value"
            }
          ]
        }
      ],
      "appDisplayName": "appDisplayName-value",
      "appId": "appId-value",
      "appOwnerOrganizationId": "appOwnerOrganizationId-value",
      "appRoleAssignmentRequired": true
    }
  ]
}