Edit

Create recoveryPreviewJob

Namespace: microsoft.graph.entraRecoveryServices

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.

Create a new recoveryPreviewJob object to preview changes required to restore the tenant to a specific snapshot state. This operation follows the resource-based long running operation (RELO) pattern and returns a 202 Accepted response with a Location header pointing to the job resource.

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) EntraBackup.ReadWrite.Preview Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application Not supported. Not supported.

Important

For delegated access using work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role or a custom role that grants the permissions required for this operation. This operation supports the following built-in roles, which provide only the least privilege necessary:

  • Entra Backup Reader
  • Entra Backup Administrator

HTTP request

POST /directory/recovery/snapshots/{snapshot-id}/recoveryPreviewJobs

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.

Request body

In the request body, optionally supply a JSON representation with the following property.

Property Type Description
filteringCriteria microsoft.graph.entraRecoveryServices.recoveryJobFilteringCriteriaBase Optional. Filtering criteria to scope the job to specific entity types or entity IDs. If not specified, all supported entities are included. Use @odata.type to specify the derived type: #microsoft.graph.entraRecoveryServices.recoveryJobEntityNamesFilter or #microsoft.graph.entraRecoveryServices.recoveryJobEntityNameAndIdsFilter.

Response

If successful, this method returns a 202 Accepted response code with a Location header pointing to the created job resource.

Examples

Example 1: Create a preview job without filtering

The following example creates a preview job for all changes.

Request

POST https://graph.microsoft.com/beta/directory/recovery/snapshots/MjAyNC0wOC0yNlQwMjozMDowMFo=/recoveryPreviewJobs

Response

HTTP/1.1 202 Accepted
Location: https://graph.microsoft.com/beta/directory/recovery/snapshots/MjAyNC0wOC0yNlQwMjozMDowMFo=/recoveryPreviewJobs/d3f8e7e8-7e87-4a7f-9d2c-c1c2d7e8e1f1

Example 2: Create a preview job filtered by entity types

The following example creates a preview job for only user entity changes.

Request

POST https://graph.microsoft.com/beta/directory/recovery/snapshots/MjAyNC0wOC0yNlQwMjozMDowMFo=/recoveryPreviewJobs
Content-Type: application/json

{
  "filteringCriteria": {
    "@odata.type": "#microsoft.graph.entraRecoveryServices.recoveryJobEntityNamesFilter",
    "entityTypes": [
      "user"
    ]
  }
}

Response

HTTP/1.1 202 Accepted
Location: https://graph.microsoft.com/beta/directory/recovery/snapshots/MjAyNC0wOC0yNlQwMjozMDowMFo=/recoveryPreviewJobs/d3f8e7e8-7e87-4a7f-9d2c-c1c2d7e8e1f1

Example 3: Create a preview job filtered by specific entity IDs

The following example creates a preview job for specific users and groups.

Request

POST https://graph.microsoft.com/beta/directory/recovery/snapshots/MjAyNC0wOC0yNlQwMjozMDowMFo=/recoveryPreviewJobs
Content-Type: application/json

{
  "filteringCriteria": {
    "@odata.type": "#microsoft.graph.entraRecoveryServices.recoveryJobEntityNameAndIdsFilter",
    "filterValues": [
      {
        "entityType": "user",
        "entityIds": [
          "52330fde-895a-4a99-ae59-1c35c2a263e9",
          "0c503c02-5554-4d59-9fcc-69736618fb8f"
        ]
      },
      {
        "entityType": "group",
        "entityIds": [
          "04181a71-a18d-4eee-94da-a77e7eb6520b",
          "2c888900-a7e8-4a01-ada5-17c04b29e8ec"
        ]
      }
    ]
  }
}

Response

HTTP/1.1 202 Accepted
Location: https://graph.microsoft.com/beta/directory/recovery/snapshots/MjAyNC0wOC0yNlQwMjozMDowMFo=/recoveryPreviewJobs/fa0f72f4-68e8-4625-846f-38865c49a086