Edytuj

Add teamworkSectionItem

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.

Add an item, such as a chat, channel, meeting, or community, to a user-defined section in a user's teamwork. An item can belong to only one section at a time. If the item is in a different user-defined section, this request moves it to the target section. If the item is already in the target section, the request succeeds without making changes.

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

HTTP request

POST /users/{user-id}/teamwork/sections/{teamworkSection-id}/items

Request headers

Header Value
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 a teamworkSectionItem object.

The following table lists the properties that you can set when you add a teamworkSectionItem.

Property Type Description
id String The conversation ID of the chat, channel, meeting, or community to add to the section. For a community (Viva Engage) item, you can provide either the bare community ID returned when you list communities (for example, eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIxOTAzMzYyMTIyMTAifQ) or the full 19:{communityId}@EngageCommunity thread ID. When you provide a bare community ID, the service automatically normalizes it to the 19:{communityId}@EngageCommunity format; an ID that already includes the thread prefix is used as-is. Required.

Response

If successful, this method returns a 201 Created response code and a teamworkSectionItem object in the response body.

The following errors are possible.

Response code Message
400 Bad Request The 'id' property is required and must not be empty.
400 Bad Request The specified item ID is not valid. Provide a valid chat, channel, meeting, or community ID.
400 Bad Request The maximum number of items in this section has been reached.
403 Forbidden Access to this resource is denied. The caller must be a member of the conversation being added.
404 Not Found The specified section wasn't found.
409 Conflict The section can't be updated because of a concurrent change. Retry the request.

Examples

Example 1: Add a chat to a section

The following example shows how to add a chat to a section.

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/users/10f8c3a6-3e2a-4e8b-9c7d-5a4b6c8d9e0f/teamwork/sections/a1b2c3d4-e5f6-7890-abcd-ef1234567890/items
Content-type: application/json

{
  "id": "19:d5b2c3a4-e6f7-8901-abcd-ef3456789012@thread.v2"
}

Response

The following example shows the response.

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

HTTP/1.1 201 Created
Content-type: application/json
Location: https://graph.microsoft.com/beta/users/10f8c3a6-3e2a-4e8b-9c7d-5a4b6c8d9e0f/teamwork/sections/a1b2c3d4-e5f6-7890-abcd-ef1234567890/items/19:d5b2c3a4-e6f7-8901-abcd-ef3456789012@thread.v2

{
  "@odata.type": "#microsoft.graph.teamworkSectionItem",
  "@odata.etag": "\"1742515210\"",
  "id": "19:d5b2c3a4-e6f7-8901-abcd-ef3456789012@thread.v2",
  "itemType": "chat",
  "createdDateTime": "2026-03-08T10:00:00Z",
  "lastModifiedDateTime": null
}

Example 2: Add a community to a section

The following example shows how to add a Viva Engage community to a section. The request provides the bare community ID returned when you list communities. The service normalizes the community ID to the 19:{communityId}@EngageCommunity format that is returned in the response.

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/users/10f8c3a6-3e2a-4e8b-9c7d-5a4b6c8d9e0f/teamwork/sections/a1b2c3d4-e5f6-7890-abcd-ef1234567890/items
Content-type: application/json

{
  "id": "eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIxOTAzMzYyMTIyMTAifQ"
}

Response

The following example shows the response. The id property is returned in the normalized 19:{communityId}@EngageCommunity format.

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

HTTP/1.1 201 Created
Content-type: application/json
Location: https://graph.microsoft.com/beta/users/10f8c3a6-3e2a-4e8b-9c7d-5a4b6c8d9e0f/teamwork/sections/a1b2c3d4-e5f6-7890-abcd-ef1234567890/items/19:eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIxOTAzMzYyMTIyMTAifQ@EngageCommunity

{
  "@odata.type": "#microsoft.graph.teamworkSectionItem",
  "@odata.etag": "\"1742515220\"",
  "id": "19:eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIxOTAzMzYyMTIyMTAifQ@EngageCommunity",
  "itemType": "community",
  "createdDateTime": "2026-03-08T10:05:00Z",
  "lastModifiedDateTime": null
}