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
Request headers
Name
Description
Authorization
Bearer {token}. Required.
Content-Type
application/json. Required.
Request body
In the request body, supply a JSON representation of the externalGroup object.
You can specify the following properties when creating an externalGroup.
Property
Type
Description
id
String
The unique ID of the external group within a connection. It must be alphanumeric and can be up to 128 characters long. Required.
displayName
String
The friendly name of the external group. Optional.
description
String
The description of the external group. Optional.
Response
If successful, this method returns a 201 Created response code and an externalGroup object in the response body.
POST https://graph.microsoft.com/v1.0/external/connections/contosohr/groups
Content-Type: application/json
{
"id": "31bea3d537902000",
"displayName": "Contoso Marketing",
"description": "The product marketing team"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models.ExternalConnectors;
var requestBody = new ExternalGroup
{
Id = "31bea3d537902000",
DisplayName = "Contoso Marketing",
Description = "The product marketing team",
};
// 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.PostAsync(requestBody);
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc external connections groups create --external-connection-id {externalConnection-id} --body '{\
"id": "31bea3d537902000",\
"displayName": "Contoso Marketing",\
"description": "The product marketing team"\
}\
'
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ExternalGroup();
$requestBody->setId('31bea3d537902000');
$requestBody->setDisplayName('Contoso Marketing');
$requestBody->setDescription('The product marketing team');
$result = $graphServiceClient->external()->connections()->byExternalConnectionId('externalConnection-id')->groups()->post($requestBody)->wait();
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(credentials, scopes)
request_body = ExternalGroup(
id = "31bea3d537902000",
display_name = "Contoso Marketing",
description = "The product marketing team",
)
result = await graph_client.external.connections.by_external_connection_id('externalConnection-id').groups.post(request_body)