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.
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.
Defines the privacy level of the community. The possible values are: public, private, unknownFutureValue.
Response
If successful, this method returns a 202 Accepted response code. The response also contains an Operation-Location header with a link to the engagementAsyncOperation. You can poll the Operation-Location endpoint for status update on the creation operation.
Examples
Example 1: Delegated permissions
Request
The following example shows a request with delegated permissions. When the owners property isn't specified in the request body, the calling user is automatically assigned as the community owner.
POST https://graph.microsoft.com/beta/employeeExperience/communities
Content-Type: application/json
{
"displayName": "Financial Advice for Software Engineers",
"description": "A community where financial advisors who represent customers from software engineering profession can discuss advice and suggestions for their clients.",
"privacy": "public"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Community
{
DisplayName = "Financial Advice for Software Engineers",
Description = "A community where financial advisors who represent customers from software engineering profession can discuss advice and suggestions for their clients.",
Privacy = CommunityPrivacy.Public,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.EmployeeExperience.Communities.PostAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
mgc-beta employee-experience communities create --body '{\
"displayName": "Financial Advice for Software Engineers",\
"description": "A community where financial advisors who represent customers from software engineering profession can discuss advice and suggestions for their clients.",\
"privacy": "public"\
}\
'
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// 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.NewCommunity()
displayName := "Financial Advice for Software Engineers"
requestBody.SetDisplayName(&displayName)
description := "A community where financial advisors who represent customers from software engineering profession can discuss advice and suggestions for their clients."
requestBody.SetDescription(&description)
privacy := graphmodels.PUBLIC_COMMUNITYPRIVACY
requestBody.SetPrivacy(&privacy)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
communities, err := graphClient.EmployeeExperience().Communities().Post(context.Background(), requestBody, nil)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Community community = new Community();
community.setDisplayName("Financial Advice for Software Engineers");
community.setDescription("A community where financial advisors who represent customers from software engineering profession can discuss advice and suggestions for their clients.");
community.setPrivacy(CommunityPrivacy.Public);
Community result = graphClient.employeeExperience().communities().post(community);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
const options = {
authProvider,
};
const client = Client.init(options);
const community = {
displayName: 'Financial Advice for Software Engineers',
description: 'A community where financial advisors who represent customers from software engineering profession can discuss advice and suggestions for their clients.',
privacy: 'public'
};
await client.api('/employeeExperience/communities')
.version('beta')
.post(community);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Community;
use Microsoft\Graph\Beta\Generated\Models\CommunityPrivacy;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Community();
$requestBody->setDisplayName('Financial Advice for Software Engineers');
$requestBody->setDescription('A community where financial advisors who represent customers from software engineering profession can discuss advice and suggestions for their clients.');
$requestBody->setPrivacy(new CommunityPrivacy('public'));
$result = $graphServiceClient->employeeExperience()->communities()->post($requestBody)->wait();
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.community import Community
from msgraph_beta.generated.models.community_privacy import CommunityPrivacy
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Community(
display_name = "Financial Advice for Software Engineers",
description = "A community where financial advisors who represent customers from software engineering profession can discuss advice and suggestions for their clients.",
privacy = CommunityPrivacy.Public,
)
result = await graph_client.employee_experience.communities.post(request_body)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
The following example shows a minimal request that requires application permissions. If the owners property isn't specified in the request body, the request fails.
POST https://graph.microsoft.com/beta/employeeExperience/communities
Content-Type: application/json
{
"displayName": "Financial Advice for Software Engineers",
"description": "A community where financial advisors who represent customers from software engineering profession can discuss advice and suggestions for their clients.",
"privacy": "public",
"owners@odata.bind": [
"https://graph.microsoft.com/beta/users/26be1845-4119-4801-a799-aea79d09f1a2"
]
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Community
{
DisplayName = "Financial Advice for Software Engineers",
Description = "A community where financial advisors who represent customers from software engineering profession can discuss advice and suggestions for their clients.",
Privacy = CommunityPrivacy.Public,
AdditionalData = new Dictionary<string, object>
{
{
"owners@odata.bind" , new List<string>
{
"https://graph.microsoft.com/beta/users/26be1845-4119-4801-a799-aea79d09f1a2",
}
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.EmployeeExperience.Communities.PostAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
mgc-beta employee-experience communities create --body '{\
"displayName": "Financial Advice for Software Engineers",\
"description": "A community where financial advisors who represent customers from software engineering profession can discuss advice and suggestions for their clients.",\
"privacy": "public",\
"owners@odata.bind": [\
"https://graph.microsoft.com/beta/users/26be1845-4119-4801-a799-aea79d09f1a2"\
]\
}\
'
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// 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.NewCommunity()
displayName := "Financial Advice for Software Engineers"
requestBody.SetDisplayName(&displayName)
description := "A community where financial advisors who represent customers from software engineering profession can discuss advice and suggestions for their clients."
requestBody.SetDescription(&description)
privacy := graphmodels.PUBLIC_COMMUNITYPRIVACY
requestBody.SetPrivacy(&privacy)
additionalData := map[string]interface{}{
odataBind := []string {
"https://graph.microsoft.com/beta/users/26be1845-4119-4801-a799-aea79d09f1a2",
}
}
requestBody.SetAdditionalData(additionalData)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
communities, err := graphClient.EmployeeExperience().Communities().Post(context.Background(), requestBody, nil)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Community community = new Community();
community.setDisplayName("Financial Advice for Software Engineers");
community.setDescription("A community where financial advisors who represent customers from software engineering profession can discuss advice and suggestions for their clients.");
community.setPrivacy(CommunityPrivacy.Public);
HashMap<String, Object> additionalData = new HashMap<String, Object>();
LinkedList<String> ownersOdataBind = new LinkedList<String>();
ownersOdataBind.add("https://graph.microsoft.com/beta/users/26be1845-4119-4801-a799-aea79d09f1a2");
additionalData.put("owners@odata.bind", ownersOdataBind);
community.setAdditionalData(additionalData);
Community result = graphClient.employeeExperience().communities().post(community);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
const options = {
authProvider,
};
const client = Client.init(options);
const community = {
displayName: 'Financial Advice for Software Engineers',
description: 'A community where financial advisors who represent customers from software engineering profession can discuss advice and suggestions for their clients.',
privacy: 'public',
'owners@odata.bind': [
'https://graph.microsoft.com/beta/users/26be1845-4119-4801-a799-aea79d09f1a2'
]
};
await client.api('/employeeExperience/communities')
.version('beta')
.post(community);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Community;
use Microsoft\Graph\Beta\Generated\Models\CommunityPrivacy;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Community();
$requestBody->setDisplayName('Financial Advice for Software Engineers');
$requestBody->setDescription('A community where financial advisors who represent customers from software engineering profession can discuss advice and suggestions for their clients.');
$requestBody->setPrivacy(new CommunityPrivacy('public'));
$additionalData = [
'owners@odata.bind' => [
'https://graph.microsoft.com/beta/users/26be1845-4119-4801-a799-aea79d09f1a2', ],
];
$requestBody->setAdditionalData($additionalData);
$result = $graphServiceClient->employeeExperience()->communities()->post($requestBody)->wait();
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.community import Community
from msgraph_beta.generated.models.community_privacy import CommunityPrivacy
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Community(
display_name = "Financial Advice for Software Engineers",
description = "A community where financial advisors who represent customers from software engineering profession can discuss advice and suggestions for their clients.",
privacy = CommunityPrivacy.Public,
additional_data = {
"owners@odata_bind" : [
"https://graph.microsoft.com/beta/users/26be1845-4119-4801-a799-aea79d09f1a2",
],
}
)
result = await graph_client.employee_experience.communities.post(request_body)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.