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)
ExternalItem.ReadWrite.OwnedBy
ExternalItem.ReadWrite.All
Delegated (personal Microsoft account)
Not supported.
Not supported.
Application
ExternalItem.ReadWrite.OwnedBy
ExternalItem.ReadWrite.All
HTTP request
PUT /external/connections/{connection-id}/items/{item-id}
In the request body, supply the values for relevant fields that should be updated. Existing properties (excluding properties inside the properties object) that are not included in the request body will maintain their previous values or be recalculated based on changes to other property values. For best performance, don't include existing values that haven't changed. The following properties can be updated.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models.ExternalConnectors;
var requestBody = new ExternalItem
{
Acl = new List<Acl>
{
new Acl
{
Type = AclType.Everyone,
Value = "67a141d8-cf4e-4528-ba07-bed21bfacd2d",
AccessType = AccessType.Grant,
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.External.Connections["{externalConnection-id}"].Items["{externalItem-id}"].PutAsync(requestBody);
// 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"
graphmodelsexternalconnectors "github.com/microsoftgraph/msgraph-sdk-go/models/externalconnectors"
//other-imports
)
requestBody := graphmodelsexternalconnectors.NewExternalItem()
acl := graphmodelsexternalconnectors.NewAcl()
type := graphmodels.EVERYONE_ACLTYPE
acl.SetType(&type)
value := "67a141d8-cf4e-4528-ba07-bed21bfacd2d"
acl.SetValue(&value)
accessType := graphmodels.GRANT_ACCESSTYPE
acl.SetAccessType(&accessType)
acl := []graphmodelsexternalconnectors.Aclable {
acl,
}
requestBody.SetAcl(acl)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
items, err := graphClient.External().Connections().ByExternalConnectionId("externalConnection-id").Items().ByExternalItemId("externalItem-id").Put(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.models.externalconnectors.ExternalItem externalItem = new com.microsoft.graph.models.externalconnectors.ExternalItem();
LinkedList<com.microsoft.graph.models.externalconnectors.Acl> acl = new LinkedList<com.microsoft.graph.models.externalconnectors.Acl>();
com.microsoft.graph.models.externalconnectors.Acl acl1 = new com.microsoft.graph.models.externalconnectors.Acl();
acl1.setType(com.microsoft.graph.models.externalconnectors.AclType.Everyone);
acl1.setValue("67a141d8-cf4e-4528-ba07-bed21bfacd2d");
acl1.setAccessType(com.microsoft.graph.models.externalconnectors.AccessType.Grant);
acl.add(acl1);
externalItem.setAcl(acl);
com.microsoft.graph.models.externalconnectors.ExternalItem result = graphClient.external().connections().byExternalConnectionId("{externalConnection-id}").items().byExternalItemId("{externalItem-id}").put(externalItem);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\ExternalConnectors\ExternalItem;
use Microsoft\Graph\Generated\Models\ExternalConnectors\Acl;
use Microsoft\Graph\Generated\Models\ExternalConnectors\AclType;
use Microsoft\Graph\Generated\Models\ExternalConnectors\AccessType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ExternalItem();
$aclAcl1 = new Acl();
$aclAcl1->setType(new AclType('everyone'));
$aclAcl1->setValue('67a141d8-cf4e-4528-ba07-bed21bfacd2d');
$aclAcl1->setAccessType(new AccessType('grant'));
$aclArray []= $aclAcl1;
$requestBody->setAcl($aclArray);
$result = $graphServiceClient->external()->connections()->byExternalConnectionId('externalConnection-id')->items()->byExternalItemId('externalItem-id')->put($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.external_connectors.external_item import ExternalItem
from msgraph.generated.models.external_connectors.acl import Acl
from msgraph.generated.models.acl_type import AclType
from msgraph.generated.models.access_type import AccessType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ExternalItem(
acl = [
Acl(
type = AclType.Everyone,
value = "67a141d8-cf4e-4528-ba07-bed21bfacd2d",
access_type = AccessType.Grant,
),
],
)
result = await graph_client.external.connections.by_external_connection_id('externalConnection-id').items.by_external_item_id('externalItem-id').put(request_body)