Namespace: microsoft.graph
Update an existing Microsoft 365 cross-tenant capability for a partner organization in the cross-tenant access policy.
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) |
Policy.ReadWrite.CrossTenantCapability |
Not available. |
| Delegated (personal Microsoft account) |
Not supported. |
Not supported. |
| Application |
Policy.ReadWrite.CrossTenantCapability |
Not available. |
Important
For delegated access using work or school accounts where the signed-in user is acting on another user, they must be assigned a supported Microsoft Entra role or a custom role that grants the permissions required for this operation. Managing Microsoft 365 cross-tenant capabilities affects the entire cross-tenant access policy, so no lower-privileged built-in role covers all capabilities. This operation supports the following built-in roles:
- Global Administrator - required for all capabilities, because managing the cross-tenant access policy requires directory-wide privileges.
- Exchange Administrator - supported only for the MailTips, Calendar Sharing, and Free/Busy capabilities.
HTTP request
PATCH /policies/crossTenantAccessPolicy/partners/{crossTenantAccessPolicyConfigurationPartner-id}/m365Capabilities/{m365CapabilityBase-name}
Request body
In the request body, supply only the values for properties that should be updated. Existing properties that aren't included in the request body maintain their previous values.
The following table specifies the properties that can be updated.
Response
If successful, this method returns a 204 No Content response code.
Examples
Request
The following example shows a request.
PATCH https://graph.microsoft.com/v1.0/policies/crossTenantAccessPolicy/partners/e8c338c6-d070-466e-a3d5-ca735b9261b4/m365Capabilities/crossTenantOpenProfileCard
Content-Type: application/json
{
"inboundAccess": {
"isAllowed": false,
"resourceScopes": {
"included": [
{
"resourceId": "ad4fc698-74dc-4f62-9e71-ba9b591e8e74",
"resourceType": "group"
},
{
"resourceId": "070061d7-a98e-43d3-b708-0758d3738ac7",
"resourceType": "group"
}
],
"excluded": []
}
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new M365CapabilityBase
{
InboundAccess = new M365CapabilityInboundAccess
{
IsAllowed = false,
ResourceScopes = new M365CapabilityResourceScopes
{
Included = new List<M365CapabilityResourceScope>
{
new M365CapabilityResourceScope
{
ResourceId = "ad4fc698-74dc-4f62-9e71-ba9b591e8e74",
ResourceType = M365ResourceType.Group,
},
new M365CapabilityResourceScope
{
ResourceId = "070061d7-a98e-43d3-b708-0758d3738ac7",
ResourceType = M365ResourceType.Group,
},
},
Excluded = new List<M365CapabilityResourceScope>
{
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Policies.CrossTenantAccessPolicy.Partners["{crossTenantAccessPolicyConfigurationPartner-tenantId}"].M365Capabilities["{m365CapabilityBase-name}"].PatchAsync(requestBody);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewM365CapabilityBase()
inboundAccess := graphmodels.NewM365CapabilityInboundAccess()
isAllowed := false
inboundAccess.SetIsAllowed(&isAllowed)
resourceScopes := graphmodels.NewM365CapabilityResourceScopes()
m365CapabilityResourceScope := graphmodels.NewM365CapabilityResourceScope()
resourceId := "ad4fc698-74dc-4f62-9e71-ba9b591e8e74"
m365CapabilityResourceScope.SetResourceId(&resourceId)
resourceType := graphmodels.GROUP_M365RESOURCETYPE
m365CapabilityResourceScope.SetResourceType(&resourceType)
m365CapabilityResourceScope1 := graphmodels.NewM365CapabilityResourceScope()
resourceId := "070061d7-a98e-43d3-b708-0758d3738ac7"
m365CapabilityResourceScope1.SetResourceId(&resourceId)
resourceType := graphmodels.GROUP_M365RESOURCETYPE
m365CapabilityResourceScope1.SetResourceType(&resourceType)
included := []graphmodels.M365CapabilityResourceScopeable {
m365CapabilityResourceScope,
m365CapabilityResourceScope1,
}
resourceScopes.SetIncluded(included)
excluded := []graphmodels.M365CapabilityResourceScopeable {
}
resourceScopes.SetExcluded(excluded)
inboundAccess.SetResourceScopes(resourceScopes)
requestBody.SetInboundAccess(inboundAccess)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
m365Capabilities, err := graphClient.Policies().CrossTenantAccessPolicy().Partners().ByCrossTenantAccessPolicyConfigurationPartnerTenantId("crossTenantAccessPolicyConfigurationPartner-tenantId").M365Capabilities().ByM365CapabilityBaseName("m365CapabilityBase-name").Patch(context.Background(), requestBody, nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
M365CapabilityBase m365CapabilityBase = new M365CapabilityBase();
M365CapabilityInboundAccess inboundAccess = new M365CapabilityInboundAccess();
inboundAccess.setIsAllowed(false);
M365CapabilityResourceScopes resourceScopes = new M365CapabilityResourceScopes();
LinkedList<M365CapabilityResourceScope> included = new LinkedList<M365CapabilityResourceScope>();
M365CapabilityResourceScope m365CapabilityResourceScope = new M365CapabilityResourceScope();
m365CapabilityResourceScope.setResourceId("ad4fc698-74dc-4f62-9e71-ba9b591e8e74");
m365CapabilityResourceScope.setResourceType(M365ResourceType.Group);
included.add(m365CapabilityResourceScope);
M365CapabilityResourceScope m365CapabilityResourceScope1 = new M365CapabilityResourceScope();
m365CapabilityResourceScope1.setResourceId("070061d7-a98e-43d3-b708-0758d3738ac7");
m365CapabilityResourceScope1.setResourceType(M365ResourceType.Group);
included.add(m365CapabilityResourceScope1);
resourceScopes.setIncluded(included);
LinkedList<M365CapabilityResourceScope> excluded = new LinkedList<M365CapabilityResourceScope>();
resourceScopes.setExcluded(excluded);
inboundAccess.setResourceScopes(resourceScopes);
m365CapabilityBase.setInboundAccess(inboundAccess);
M365CapabilityBase result = graphClient.policies().crossTenantAccessPolicy().partners().byCrossTenantAccessPolicyConfigurationPartnerTenantId("{crossTenantAccessPolicyConfigurationPartner-tenantId}").m365Capabilities().byM365CapabilityBaseName("{m365CapabilityBase-name}").patch(m365CapabilityBase);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
const options = {
authProvider,
};
const client = Client.init(options);
const m365CapabilityBase = {
inboundAccess: {
isAllowed: false,
resourceScopes: {
included: [
{
resourceId: 'ad4fc698-74dc-4f62-9e71-ba9b591e8e74',
resourceType: 'group'
},
{
resourceId: '070061d7-a98e-43d3-b708-0758d3738ac7',
resourceType: 'group'
}
],
excluded: []
}
}
};
await client.api('/policies/crossTenantAccessPolicy/partners/e8c338c6-d070-466e-a3d5-ca735b9261b4/m365Capabilities/crossTenantOpenProfileCard')
.update(m365CapabilityBase);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\M365CapabilityBase;
use Microsoft\Graph\Generated\Models\M365CapabilityInboundAccess;
use Microsoft\Graph\Generated\Models\M365CapabilityResourceScopes;
use Microsoft\Graph\Generated\Models\M365CapabilityResourceScope;
use Microsoft\Graph\Generated\Models\M365ResourceType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new M365CapabilityBase();
$inboundAccess = new M365CapabilityInboundAccess();
$inboundAccess->setIsAllowed(false);
$inboundAccessResourceScopes = new M365CapabilityResourceScopes();
$includedM365CapabilityResourceScope1 = new M365CapabilityResourceScope();
$includedM365CapabilityResourceScope1->setResourceId('ad4fc698-74dc-4f62-9e71-ba9b591e8e74');
$includedM365CapabilityResourceScope1->setResourceType(new M365ResourceType('group'));
$includedArray []= $includedM365CapabilityResourceScope1;
$includedM365CapabilityResourceScope2 = new M365CapabilityResourceScope();
$includedM365CapabilityResourceScope2->setResourceId('070061d7-a98e-43d3-b708-0758d3738ac7');
$includedM365CapabilityResourceScope2->setResourceType(new M365ResourceType('group'));
$includedArray []= $includedM365CapabilityResourceScope2;
$inboundAccessResourceScopes->setIncluded($includedArray);
$inboundAccessResourceScopes->setExcluded([]);
$inboundAccess->setResourceScopes($inboundAccessResourceScopes);
$requestBody->setInboundAccess($inboundAccess);
$result = $graphServiceClient->policies()->crossTenantAccessPolicy()->partners()->byCrossTenantAccessPolicyConfigurationPartnerTenantId('crossTenantAccessPolicyConfigurationPartner-tenantId')->m365Capabilities()->byM365CapabilityBaseName('m365CapabilityBase-name')->patch($requestBody)->wait();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.m365_capability_base import M365CapabilityBase
from msgraph.generated.models.m365_capability_inbound_access import M365CapabilityInboundAccess
from msgraph.generated.models.m365_capability_resource_scopes import M365CapabilityResourceScopes
from msgraph.generated.models.m365_capability_resource_scope import M365CapabilityResourceScope
from msgraph.generated.models.m365_resource_type import M365ResourceType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = M365CapabilityBase(
inbound_access = M365CapabilityInboundAccess(
is_allowed = False,
resource_scopes = M365CapabilityResourceScopes(
included = [
M365CapabilityResourceScope(
resource_id = "ad4fc698-74dc-4f62-9e71-ba9b591e8e74",
resource_type = M365ResourceType.Group,
),
M365CapabilityResourceScope(
resource_id = "070061d7-a98e-43d3-b708-0758d3738ac7",
resource_type = M365ResourceType.Group,
),
],
excluded = [
],
),
),
)
result = await graph_client.policies.cross_tenant_access_policy.partners.by_cross_tenant_access_policy_configuration_partner_tenant_id('crossTenantAccessPolicyConfigurationPartner-tenantId').m365_capabilities.by_m365_capability_base_name('m365CapabilityBase-name').patch(request_body)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Response
The following example shows the response.
HTTP/1.1 204 No Content