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.
Validate the configuration of a crossTenantMigrationJob. This function doesn't migrate any content, but goes through validation for the specified workloads to find any errors or misconfigurations that would affect an actual migration job.
This API is available in the following national cloud deployments.
| Global service |
US Government L4 |
US Government L5 (DOD) |
China operated by 21Vianet |
| ✅ |
❌ |
❌ |
❌ |
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 permission |
Higher privileged permissions |
| Delegated (work or school account) |
Not supported. |
Not supported. |
| Delegated (personal Microsoft account) |
Not supported. |
Not supported. |
| Application |
Not supported. |
Not supported. |
Important
For delegated access using work or school accounts, the admin must be assigned a supported Microsoft Entra role or a custom role that grants the permissions required for this operation. Global Administrator is the only role supported for this operation.
HTTP request
POST /solutions/migrations/crossTenantMigrationJobs/validate
Request body
In the request body, supply a JSON representation of the parameters.
The following table lists the parameters that are required when you call this action.
| Parameter |
Type |
Description |
| displayName |
String |
Name of the crossTenantMigrationJob to validate |
| completeAfterDateTime |
String |
When the CrossTenantMigrationJob |
| sourceTenantId |
String |
Source tenant for the CrossTenantMigrationJob |
| exchangeSettings |
exchangeOnlineCrossTenantMigrationSettings |
Exchange migration settings for the CrossTenantMigrationJob |
| workloads |
String collection |
Workloads to validate for the CrossTenantMigrationJob |
| resourceType |
String |
Type of resource in the CrossTenantMigrationJob. |
| resources |
String collection |
Identifiers of the users in the CrossTenantMigrationJob to validate |
Response
If successful, this action returns a 201 Created response code and a crossTenantMigrationJob in the response body.
Examples
Request
The following example shows a request.
POST https://graph.microsoft.com/beta/solutions/migrations/crossTenantMigrationJobs/validate
Content-Type: application/json
{
"displayName": "Contoso_migration_validation_job",
"completeAfterDateTime": "2025-05-22T17:14:52Z",
"sourceTenantId": "12345678-1234-1234-1234-123456789012",
"exchangeSettings": {
"targetDeliveryDomain": "fabrikam.com",
"sourceEndpoint": "EXOHandler"
},
"resources": [
"b5b8bc4f-0e36-4ad3-8ddf-248b68260b89",
"ac87d040-a081-426c-a73b-81133f458a29"
],
"workloads": [ "Teams" ],
"resourceType": "Users"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Solutions.Migrations.CrossTenantMigrationJobs.Validate;
using Microsoft.Graph.Beta.Models;
var requestBody = new ValidatePostRequestBody
{
DisplayName = "Contoso_migration_validation_job",
CompleteAfterDateTime = "2025-05-22T17:14:52Z",
SourceTenantId = "12345678-1234-1234-1234-123456789012",
ExchangeSettings = new ExchangeOnlineCrossTenantMigrationSettings
{
TargetDeliveryDomain = "fabrikam.com",
SourceEndpoint = "EXOHandler",
},
Resources = new List<string>
{
"b5b8bc4f-0e36-4ad3-8ddf-248b68260b89",
"ac87d040-a081-426c-a73b-81133f458a29",
},
Workloads = new List<string>
{
"Teams",
},
ResourceType = "Users",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Solutions.Migrations.CrossTenantMigrationJobs.Validate.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphsolutions "github.com/microsoftgraph/msgraph-beta-sdk-go/solutions"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphsolutions.NewValidatePostRequestBody()
displayName := "Contoso_migration_validation_job"
requestBody.SetDisplayName(&displayName)
completeAfterDateTime := "2025-05-22T17:14:52Z"
requestBody.SetCompleteAfterDateTime(&completeAfterDateTime)
sourceTenantId := "12345678-1234-1234-1234-123456789012"
requestBody.SetSourceTenantId(&sourceTenantId)
exchangeSettings := graphmodels.NewExchangeOnlineCrossTenantMigrationSettings()
targetDeliveryDomain := "fabrikam.com"
exchangeSettings.SetTargetDeliveryDomain(&targetDeliveryDomain)
sourceEndpoint := "EXOHandler"
exchangeSettings.SetSourceEndpoint(&sourceEndpoint)
requestBody.SetExchangeSettings(exchangeSettings)
resources := []string {
"b5b8bc4f-0e36-4ad3-8ddf-248b68260b89",
"ac87d040-a081-426c-a73b-81133f458a29",
}
requestBody.SetResources(resources)
workloads := []string {
"Teams",
}
requestBody.SetWorkloads(workloads)
resourceType := "Users"
requestBody.SetResourceType(&resourceType)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
validate, err := graphClient.Solutions().Migrations().CrossTenantMigrationJobs().Validate().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.solutions.migrations.crosstenantmigrationjobs.validate.ValidatePostRequestBody validatePostRequestBody = new com.microsoft.graph.beta.solutions.migrations.crosstenantmigrationjobs.validate.ValidatePostRequestBody();
validatePostRequestBody.setDisplayName("Contoso_migration_validation_job");
validatePostRequestBody.setCompleteAfterDateTime("2025-05-22T17:14:52Z");
validatePostRequestBody.setSourceTenantId("12345678-1234-1234-1234-123456789012");
ExchangeOnlineCrossTenantMigrationSettings exchangeSettings = new ExchangeOnlineCrossTenantMigrationSettings();
exchangeSettings.setTargetDeliveryDomain("fabrikam.com");
exchangeSettings.setSourceEndpoint("EXOHandler");
validatePostRequestBody.setExchangeSettings(exchangeSettings);
LinkedList<String> resources = new LinkedList<String>();
resources.add("b5b8bc4f-0e36-4ad3-8ddf-248b68260b89");
resources.add("ac87d040-a081-426c-a73b-81133f458a29");
validatePostRequestBody.setResources(resources);
LinkedList<String> workloads = new LinkedList<String>();
workloads.add("Teams");
validatePostRequestBody.setWorkloads(workloads);
validatePostRequestBody.setResourceType("Users");
var result = graphClient.solutions().migrations().crossTenantMigrationJobs().validate().post(validatePostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const crossTenantMigrationJob = {
displayName: 'Contoso_migration_validation_job',
completeAfterDateTime: '2025-05-22T17:14:52Z',
sourceTenantId: '12345678-1234-1234-1234-123456789012',
exchangeSettings: {
targetDeliveryDomain: 'fabrikam.com',
sourceEndpoint: 'EXOHandler'
},
resources: [
'b5b8bc4f-0e36-4ad3-8ddf-248b68260b89',
'ac87d040-a081-426c-a73b-81133f458a29'
],
workloads: [ 'Teams' ],
resourceType: 'Users'
};
await client.api('/solutions/migrations/crossTenantMigrationJobs/validate')
.version('beta')
.post(crossTenantMigrationJob);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Solutions\Migrations\CrossTenantMigrationJobs\Validate\ValidatePostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\ExchangeOnlineCrossTenantMigrationSettings;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ValidatePostRequestBody();
$requestBody->setDisplayName('Contoso_migration_validation_job');
$requestBody->setCompleteAfterDateTime('2025-05-22T17:14:52Z');
$requestBody->setSourceTenantId('12345678-1234-1234-1234-123456789012');
$exchangeSettings = new ExchangeOnlineCrossTenantMigrationSettings();
$exchangeSettings->setTargetDeliveryDomain('fabrikam.com');
$exchangeSettings->setSourceEndpoint('EXOHandler');
$requestBody->setExchangeSettings($exchangeSettings);
$requestBody->setResources(['b5b8bc4f-0e36-4ad3-8ddf-248b68260b89', 'ac87d040-a081-426c-a73b-81133f458a29', ]);
$requestBody->setWorkloads(['Teams', ]);
$requestBody->setResourceType('Users');
$result = $graphServiceClient->solutions()->migrations()->crossTenantMigrationJobs()->validate()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Migrations
$params = @{
displayName = "Contoso_migration_validation_job"
completeAfterDateTime = "2025-05-22T17:14:52Z"
sourceTenantId = "12345678-1234-1234-1234-123456789012"
exchangeSettings = @{
targetDeliveryDomain = "fabrikam.com"
sourceEndpoint = "EXOHandler"
}
resources = @(
"b5b8bc4f-0e36-4ad3-8ddf-248b68260b89"
"ac87d040-a081-426c-a73b-81133f458a29"
)
workloads = @(
"Teams"
)
resourceType = "Users"
}
Test-MgBetaCrossTenantMigrationJob -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.solutions.migrations.crosstenantmigrationjobs.validate.validate_post_request_body import ValidatePostRequestBody
from msgraph_beta.generated.models.exchange_online_cross_tenant_migration_settings import ExchangeOnlineCrossTenantMigrationSettings
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ValidatePostRequestBody(
display_name = "Contoso_migration_validation_job",
complete_after_date_time = "2025-05-22T17:14:52Z",
source_tenant_id = "12345678-1234-1234-1234-123456789012",
exchange_settings = ExchangeOnlineCrossTenantMigrationSettings(
target_delivery_domain = "fabrikam.com",
source_endpoint = "EXOHandler",
),
resources = [
"b5b8bc4f-0e36-4ad3-8ddf-248b68260b89",
"ac87d040-a081-426c-a73b-81133f458a29",
],
workloads = [
"Teams",
],
resource_type = "Users",
)
result = await graph_client.solutions.migrations.cross_tenant_migration_jobs.validate.post(request_body)
Response
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#microsoft.graph.crossTenantMigrationJob",
"id": "0d1d9dbb-7676-4731-a601-5e8406fd7bcf",
"displayName": "Contoso_migration_validation_job",
"status": "validateSubmitted",
"jobType": "validate",
"message": "Validation job has been submitted successfully",
"completeAfterDateTime": "2025-05-22T17:14:52Z",
"sourceTenantId": "12345678-1234-1234-1234-123456789012",
"targetTenantId": "87654321-4321-4321-4321-210987654321",
"resourceType": "users",
"resources": [],
"workloads": [
"teams"
],
"createdBy": "admin@fabrikam.onmicrosoft.com",
"createdDateTime": "2025-11-07T00:19:21.4810014Z",
"lastUpdatedDateTime": "2025-11-07T00:19:21Z",
"exchangeSettings": {
"targetDeliveryDomain": "fabrikam.com",
"sourceEndpoint": "EXOHandler"
}
}