Edit

Share via


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. Each item can belong to only one section at a time. You can only add items that are currently in a system-defined section. If the item is already in another user-defined section, use the move action to relocate it.

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 permission Higher privileged permissions
Delegated (work or school account) TeamworkSection.ReadWrite Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application TeamworkSection.ReadWrite.All Not available.

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.
If-Match The value of the @microsoft.graph.sectionsVersion annotation returned when you list sections, or the @odata.etag value from any previously retrieved section. Required for optimistic concurrency control.

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 community items, the service automatically normalizes the ID to the 19:{id}@EngageCommunity format. Required.

Response

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

Note

The response includes an updated @odata.etag value. Use this value as the If-Match header for any subsequent mutation operations.

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 was not found.
409 Conflict This item is already in this section.
409 Conflict This item is already associated with another section. Use the move API to relocate it. The response includes a conflictingSectionId detail with the ID of the section that currently holds the item.
412 Precondition Failed The If-Match header value doesn't match the current section hierarchy version. List sections again to retrieve the current @microsoft.graph.sectionsVersion annotation and retry.
428 Precondition Required The If-Match header is required for this operation.

Examples

Request

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

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

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