Create community

Namespace: microsoft.graph

Important

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.

Create a new community in Viva Engage.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

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) Community.ReadWrite.All Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application Community.ReadWrite.All Not available.

HTTP request

POST /employeeExperience/communities

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.

Request body

In the request body, supply a JSON representation of the community object.

You can specify the following properties when you create a community.

Property Type Description
description String The description of the community. Maximum length is 1024 characters.
displayName String The name of the community. Maximum length is 255 characters.
privacy communityPrivacy 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"
}

Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 202 Accepted
Content-Type: application/json
Operation-Location: https://graph.microsoft.com/beta/employeeExperience/engagementAsyncOperations('3a6fdce1-c261-48bc-89de-1cfef658c0d5')

Example 2: Application permissions

Request

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"
  ]
}

Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 202 Accepted
Content-Type: application/json
Operation-Location: https://graph.microsoft.com/beta/employeeExperience/engagementAsyncOperations('3a6fdce1-c261-48bc-89de-1cfef658c0d5')