Create thread

Create a new thread in the specified conversation.

A thread and post are created as specified. Use reply thread to further post to that thread. Or, if you get the post ID, you can also reply to that post in that thread.

Note: You can also start a new conversation by first creating a thread.

Permissions

One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) Group.ReadWrite.All
Delegated (personal Microsoft account) Not supported.
Application Not supported.

HTTP request

POST /groups/{id}/conversations/{id}/threads

Request headers

Name Type Description
Authorization string Bearer {token}. Required.

Request body

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

Response

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

Example

Request

Here is an example of the request.

POST https://graph.microsoft.com/v1.0/groups/{id}/conversations/{id}/threads
Content-type: application/json

{
  "topic": "topic-value",
  "posts": [{
      "body": {
        "contentType": "html",
        "content": "this is body content"
      }
  }]
}

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

Response

If successful, this method returns 201 Created response code and the id of the new thread in the response body. Here is an example of the response.

HTTP/1.1 201 Created
Content-type: application/json
Content-length: 346

{
  "id": "thread-id-value"
}

SDK sample code


GraphServiceClient graphClient = new GraphServiceClient( authProvider );

var conversationThread = new ConversationThread
{
	Topic = "topic-value",
	Posts = new List<Post>()
	{
		new Post
		{
			Body = new ItemBody
			{
				ContentType = BodyType.Html,
				Content = "this is body content"
			}
		}
	}
};

await graphClient.Groups["{id}"].Conversations["{id}"].Threads
	.Request()
	.AddAsync(conversationThread);

Read the SDK documentation for details on how to add the SDK to your project and create an authProvider instance.