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.
Join a multi-tenant organization, after the owner of the multi-tenant organization adds your tenant to the multi-tenant organization as pending.
Before a tenant added to a multi-tenant organization can participate in the multi-tenant organization, the administrator of the joining tenant must submit a join request.
To allow for asynchronous processing, you must wait a minimum of 2 hours between creation and joining a multi-tenant organization.
Furthermore, to allow for asynchronous processing, you must wait up to 4 hours before joining a multi-tenant organization is completed.
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 permissions |
Higher privileged permissions |
Delegated (work or school account) |
MultiTenantOrganization.ReadWrite.All |
Not available. |
Delegated (personal Microsoft account) |
Not supported. |
Not supported. |
Application |
MultiTenantOrganization.ReadWrite.All |
Not available. |
Important
In delegated scenarios with work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role or a custom role with a supported role permission. Security Administrator is the least privileged role supported for this operation.
HTTP request
PATCH /tenantRelationships/multiTenantOrganization/joinRequest
Request body
In the request body, supply only the values for properties to update. Existing properties that aren't included in the request body maintain their previous values or are recalculated based on changes to other property values.
The following table specifies the properties that can be updated.
Property |
Type |
Description |
addedByTenantId |
String |
Tenant ID of the Microsoft Entra tenant that added the current tenant to the multi-tenant organization. To reset a failed join request, set addedByTenantId to 00000000-0000-0000-0000-000000000000 . Required. |
Response
If successful, this method returns a 204 No Content
response code.
A join request might be unsuccessful. The following are some scenarios:
- The joining tenant isn't added to the multi-tenant organization by its owner.
- The owner or joiner tenant exceeds the maximum number of internal users per tenant.
- The multi-tenant organization would exceed the maximum number of tenants.
- The joining tenant is already part of a different multi-tenant organization.
Examples
Example 1: Join a multi-tenant organization
The following example shows a request by the current tenant to join a multi-tenant organization. It can take a few minutes for the join to complete. If the join succeeds, the state of the tenant is changed to active
.
Request
PATCH https://graph.microsoft.com/beta/tenantRelationships/multiTenantOrganization/joinRequest
Content-Type: application/json
{
"addedByTenantId": "1fd6544e-e994-4de2-9f1b-787b51c7d325"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new MultiTenantOrganizationJoinRequestRecord
{
AddedByTenantId = "1fd6544e-e994-4de2-9f1b-787b51c7d325",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.TenantRelationships.MultiTenantOrganization.JoinRequest.PatchAsync(requestBody);
mgc-beta tenant-relationships multi-tenant-organization join-request patch --body '{\
"addedByTenantId": "1fd6544e-e994-4de2-9f1b-787b51c7d325"\
}\
'
// 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"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewMultiTenantOrganizationJoinRequestRecord()
addedByTenantId := "1fd6544e-e994-4de2-9f1b-787b51c7d325"
requestBody.SetAddedByTenantId(&addedByTenantId)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
joinRequest, err := graphClient.TenantRelationships().MultiTenantOrganization().JoinRequest().Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
MultiTenantOrganizationJoinRequestRecord multiTenantOrganizationJoinRequestRecord = new MultiTenantOrganizationJoinRequestRecord();
multiTenantOrganizationJoinRequestRecord.setAddedByTenantId("1fd6544e-e994-4de2-9f1b-787b51c7d325");
MultiTenantOrganizationJoinRequestRecord result = graphClient.tenantRelationships().multiTenantOrganization().joinRequest().patch(multiTenantOrganizationJoinRequestRecord);
const options = {
authProvider,
};
const client = Client.init(options);
const multiTenantOrganizationJoinRequestRecord = {
addedByTenantId: '1fd6544e-e994-4de2-9f1b-787b51c7d325'
};
await client.api('/tenantRelationships/multiTenantOrganization/joinRequest')
.version('beta')
.update(multiTenantOrganizationJoinRequestRecord);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\MultiTenantOrganizationJoinRequestRecord;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new MultiTenantOrganizationJoinRequestRecord();
$requestBody->setAddedByTenantId('1fd6544e-e994-4de2-9f1b-787b51c7d325');
$result = $graphServiceClient->tenantRelationships()->multiTenantOrganization()->joinRequest()->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Identity.SignIns
$params = @{
addedByTenantId = "1fd6544e-e994-4de2-9f1b-787b51c7d325"
}
Update-MgBetaTenantRelationshipMultiTenantOrganizationJoinRequest -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.models.multi_tenant_organization_join_request_record import MultiTenantOrganizationJoinRequestRecord
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = MultiTenantOrganizationJoinRequestRecord(
added_by_tenant_id = "1fd6544e-e994-4de2-9f1b-787b51c7d325",
)
result = await graph_client.tenant_relationships.multi_tenant_organization.join_request.patch(request_body)
Response
HTTP/1.1 204 No Content
Example 2: Reset a failed join request
The following example shows a request by the current tenant to reset a failed join request. To reset a failed join request, set addedByTenantId
to 00000000-0000-0000-0000-000000000000
.
Request
PATCH https://graph.microsoft.com/beta/tenantRelationships/multiTenantOrganization/joinRequest
Content-Type: application/json
{
"addedByTenantId": "00000000-0000-0000-0000-000000000000"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new MultiTenantOrganizationJoinRequestRecord
{
AddedByTenantId = "00000000-0000-0000-0000-000000000000",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.TenantRelationships.MultiTenantOrganization.JoinRequest.PatchAsync(requestBody);
mgc-beta tenant-relationships multi-tenant-organization join-request patch --body '{\
"addedByTenantId": "00000000-0000-0000-0000-000000000000"\
}\
'
// 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"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewMultiTenantOrganizationJoinRequestRecord()
addedByTenantId := "00000000-0000-0000-0000-000000000000"
requestBody.SetAddedByTenantId(&addedByTenantId)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
joinRequest, err := graphClient.TenantRelationships().MultiTenantOrganization().JoinRequest().Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
MultiTenantOrganizationJoinRequestRecord multiTenantOrganizationJoinRequestRecord = new MultiTenantOrganizationJoinRequestRecord();
multiTenantOrganizationJoinRequestRecord.setAddedByTenantId("00000000-0000-0000-0000-000000000000");
MultiTenantOrganizationJoinRequestRecord result = graphClient.tenantRelationships().multiTenantOrganization().joinRequest().patch(multiTenantOrganizationJoinRequestRecord);
const options = {
authProvider,
};
const client = Client.init(options);
const multiTenantOrganizationJoinRequestRecord = {
addedByTenantId: '00000000-0000-0000-0000-000000000000'
};
await client.api('/tenantRelationships/multiTenantOrganization/joinRequest')
.version('beta')
.update(multiTenantOrganizationJoinRequestRecord);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\MultiTenantOrganizationJoinRequestRecord;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new MultiTenantOrganizationJoinRequestRecord();
$requestBody->setAddedByTenantId('00000000-0000-0000-0000-000000000000');
$result = $graphServiceClient->tenantRelationships()->multiTenantOrganization()->joinRequest()->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Identity.SignIns
$params = @{
addedByTenantId = "00000000-0000-0000-0000-000000000000"
}
Update-MgBetaTenantRelationshipMultiTenantOrganizationJoinRequest -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.models.multi_tenant_organization_join_request_record import MultiTenantOrganizationJoinRequestRecord
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = MultiTenantOrganizationJoinRequestRecord(
added_by_tenant_id = "00000000-0000-0000-0000-000000000000",
)
result = await graph_client.tenant_relationships.multi_tenant_organization.join_request.patch(request_body)
Response
HTTP/1.1 204 No Content