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
POST /external/connections/{connectionsId}/groups/{externalGroupId}/members
In the request body, supply a JSON representation of the identity object.
You can specify the following properties when creating an identity resource for a member in an externalGroup.
Property
Type
Description
id
String
The unique id of the member. It would be the objectId in case of Microsoft Entra users or groups and the externalGroupId in case of external groups. Required.
type
microsoft.graph.externalConnectors.identityType
The type of member added to the external group. Possible values are: user,group, externalGroup. Required.
Response
If successful, this method returns a 201 Created response code and an identity object in the response body.
POST https://graph.microsoft.com/v1.0/external/connections/contosohr/groups/31bea3d537902000/members
Content-Type: application/json
{
"id": "e811976d-83df-4cbd-8b9b-5215b18aa874",
"type": "user"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models.ExternalConnectors;
var requestBody = new Identity
{
Id = "e811976d-83df-4cbd-8b9b-5215b18aa874",
Type = IdentityType.User,
};
// 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}"].Groups["{externalGroup-id}"].Members.PostAsync(requestBody);
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc external connections groups members create --external-connection-id {externalConnection-id} --external-group-id {externalGroup-id} --body '{\
"id": "e811976d-83df-4cbd-8b9b-5215b18aa874",\
"type": "user"\
}\
'
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.models.externalconnectors.Identity identity = new com.microsoft.graph.models.externalconnectors.Identity();
identity.setId("e811976d-83df-4cbd-8b9b-5215b18aa874");
identity.setType(com.microsoft.graph.models.externalconnectors.IdentityType.User);
com.microsoft.graph.models.externalconnectors.Identity result = graphClient.external().connections().byExternalConnectionId("{externalConnection-id}").groups().byExternalGroupId("{externalGroup-id}").members().post(identity);
POST https://graph.microsoft.com/v1.0/external/connections/contosohr/groups/31bea3d537902000/members
Content-Type: application/json
{
"id": "e5477431-1038-484e-bf69-1dfedb97a110",
"type": "group"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models.ExternalConnectors;
var requestBody = new Identity
{
Id = "e5477431-1038-484e-bf69-1dfedb97a110",
Type = IdentityType.Group,
};
// 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}"].Groups["{externalGroup-id}"].Members.PostAsync(requestBody);
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc external connections groups members create --external-connection-id {externalConnection-id} --external-group-id {externalGroup-id} --body '{\
"id": "e5477431-1038-484e-bf69-1dfedb97a110",\
"type": "group"\
}\
'
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.models.externalconnectors.Identity identity = new com.microsoft.graph.models.externalconnectors.Identity();
identity.setId("e5477431-1038-484e-bf69-1dfedb97a110");
identity.setType(com.microsoft.graph.models.externalconnectors.IdentityType.Group);
com.microsoft.graph.models.externalconnectors.Identity result = graphClient.external().connections().byExternalConnectionId("{externalConnection-id}").groups().byExternalGroupId("{externalGroup-id}").members().post(identity);
POST https://graph.microsoft.com/v1.0/external/connections/contosohr/groups/31bea3d537902000/members
Content-Type: application/json
{
"id": "1431b9c38ee647f6a",
"type": "externalGroup",
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models.ExternalConnectors;
var requestBody = new Identity
{
Id = "1431b9c38ee647f6a",
Type = IdentityType.ExternalGroup,
};
// 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}"].Groups["{externalGroup-id}"].Members.PostAsync(requestBody);
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc external connections groups members create --external-connection-id {externalConnection-id} --external-group-id {externalGroup-id} --body '{\
"id": "1431b9c38ee647f6a",\
"type": "externalGroup",\
}\
'
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.models.externalconnectors.Identity identity = new com.microsoft.graph.models.externalconnectors.Identity();
identity.setId("1431b9c38ee647f6a");
identity.setType(com.microsoft.graph.models.externalconnectors.IdentityType.ExternalGroup);
com.microsoft.graph.models.externalconnectors.Identity result = graphClient.external().connections().byExternalConnectionId("{externalConnection-id}").groups().byExternalGroupId("{externalGroup-id}").members().post(identity);
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see: https://aka.ms/ContentUserFeedback.