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.
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)
Group.ReadWrite.All
Not available.
Delegated (personal Microsoft account)
Not supported.
Not supported.
Application
Not supported.
Not supported.
HTTP request
POST /groups/{id}/conversations/{id}/threads
Request headers
Name
Description
Authorization
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.
POST https://graph.microsoft.com/v1.0/groups/{id}/conversations/{id}/threads
Content-type: application/json
{
"topic": "Take your wellness days and rest",
"posts": [
{
"body": {
"contentType": "html",
"content": "Waiting for the summer holidays."
}
}
]
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new ConversationThread
{
Topic = "Take your wellness days and rest",
Posts = new List<Post>
{
new Post
{
Body = new ItemBody
{
ContentType = BodyType.Html,
Content = "Waiting for the summer holidays.",
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Groups["{group-id}"].Conversations["{conversation-id}"].Threads.PostAsync(requestBody);
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc groups conversations threads create --group-id {group-id} --conversation-id {conversation-id} --body '{\
"topic": "Take your wellness days and rest",\
"posts": [\
{\
"body": {\
"contentType": "html",\
"content": "Waiting for the summer holidays."\
}\
}\
]\
}\
'
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ConversationThread();
$requestBody->setTopic('Take your wellness days and rest');
$postsPost1 = new Post();
$postsPost1Body = new ItemBody();
$postsPost1Body->setContentType(new BodyType('html'));
$postsPost1Body->setContent('Waiting for the summer holidays.');
$postsPost1->setBody($postsPost1Body);
$postsArray []= $postsPost1;
$requestBody->setPosts($postsArray);
$result = $graphServiceClient->groups()->byGroupId('group-id')->conversations()->byConversationId('conversation-id')->threads()->post($requestBody)->wait();
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(credentials, scopes)
request_body = ConversationThread(
topic = "Take your wellness days and rest",
posts = [
Post(
body = ItemBody(
content_type = BodyType.Html,
content = "Waiting for the summer holidays.",
),
),
],
)
result = await graph_client.groups.by_group_id('group-id').conversations.by_conversation_id('conversation-id').threads.post(request_body)
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.
The following example shows the response.