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 channel in a team, as specified in the request body.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
POST https://graph.microsoft.com/beta/teams/57fb72d0-d811-46f4-8947-305e6072eaa5/channels
Content-type: application/json
{
"displayName": "Architecture Discussion",
"description": "This channel is where we debate all future architecture plans",
"membershipType": "standard"
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var channel = new Channel
{
DisplayName = "Architecture Discussion",
Description = "This channel is where we debate all future architecture plans",
MembershipType = ChannelMembershipType.Standard
};
await graphClient.Teams["57fb72d0-d811-46f4-8947-305e6072eaa5"].Channels
.Request()
.AddAsync(channel);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
const options = {
authProvider,
};
const client = Client.init(options);
const channel = {
displayName: "Architecture Discussion",
description: "This channel is where we debate all future architecture plans",
membershipType: "standard"
};
let res = await client.api('/teams/57fb72d0-d811-46f4-8947-305e6072eaa5/channels')
.version('beta')
.post(channel);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
IGraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
Channel channel = new Channel();
channel.displayName = "Architecture Discussion";
channel.description = "This channel is where we debate all future architecture plans";
channel.membershipType = ChannelMembershipType.STANDARD;
graphClient.teams("57fb72d0-d811-46f4-8947-305e6072eaa5").channels()
.buildRequest()
.post(channel);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 201 Created
Content-type: application/json
Content-length: 201
{
"id": "id-value",
"displayName": "Architecture Discussion",
"description": "This channel is where we debate all future architecture plans"
}
Example 2: Create private channel on behalf of user
Request
The following example shows a request to create a private channel and add a user as an team owner.
POST https://graph.microsoft.com/beta/teams/57fb72d0-d811-46f4-8947-305e6072eaa5/channels
Content-type: application/json
{
"@odata.type": "#Microsoft.Graph.channel",
"membershipType": "private",
"displayName": "My First Private Channel",
"description": "This is my first private channels",
"members":
[
{
"@odata.type":"#microsoft.graph.aadUserConversationMember",
"user@odata.bind":"https://graph.microsoft.com/beta/users('62855810-484b-4823-9e01-60667f8b12ae')",
"roles":["owner"]
}
]
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var channel = new Channel
{
MembershipType = ChannelMembershipType.Private,
DisplayName = "My First Private Channel",
Description = "This is my first private channels",
Members = new ChannelMembersCollectionPage()
{
new AadUserConversationMember
{
Roles = new List<String>()
{
"owner"
},
AdditionalData = new Dictionary<string, object>()
{
{"user@odata.bind", "https://graph.microsoft.com/beta/users('62855810-484b-4823-9e01-60667f8b12ae')"}
}
}
}
};
await graphClient.Teams["57fb72d0-d811-46f4-8947-305e6072eaa5"].Channels
.Request()
.AddAsync(channel);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
const options = {
authProvider,
};
const client = Client.init(options);
const channel = {
@odata.type: "#Microsoft.Graph.channel",
membershipType: "private",
displayName: "My First Private Channel",
description: "This is my first private channels",
members:
[
{
@odata.type:"#microsoft.graph.aadUserConversationMember",
user@odata.bind:"https://graph.microsoft.com/beta/users('62855810-484b-4823-9e01-60667f8b12ae')",
roles:["owner"]
}
]
};
let res = await client.api('/teams/57fb72d0-d811-46f4-8947-305e6072eaa5/channels')
.version('beta')
.post(channel);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
IGraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
Channel channel = new Channel();
channel.membershipType = ChannelMembershipType.PRIVATE;
channel.displayName = "My First Private Channel";
channel.description = "This is my first private channels";
LinkedList<ConversationMember> membersList = new LinkedList<ConversationMember>();
AadUserConversationMember members = new AadUserConversationMember();
members.additionalDataManager().put("user@odata.bind", new JsonPrimitive("https://graph.microsoft.com/beta/users('62855810-484b-4823-9e01-60667f8b12ae')"));
LinkedList<String> rolesList = new LinkedList<String>();
rolesList.add("owner");
members.roles = rolesList;
membersList.add(members);
ConversationMemberCollectionResponse conversationMemberCollectionResponse = new ConversationMemberCollectionResponse();
conversationMemberCollectionResponse.value = membersList;
ConversationMemberCollectionPage conversationMemberCollectionPage = new ConversationMemberCollectionPage(conversationMemberCollectionResponse, null);
channel.members = conversationMemberCollectionPage;
graphClient.teams("57fb72d0-d811-46f4-8947-305e6072eaa5").channels()
.buildRequest()
.post(channel);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
POST https://graph.microsoft.com/beta/teams/57fb72d0-d811-46f4-8947-305e6072eaa5/channels
Content-Type: application/json
{
"@microsoft.graph.channelCreationMode": "migration",
"displayName": "Architecture Discussion",
"description": "This channel is where we debate all future architecture plans",
"membershipType": "standard",
"createdDateTime": "2020-03-14T11:22:17.067Z"
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var channel = new Channel
{
DisplayName = "Architecture Discussion",
Description = "This channel is where we debate all future architecture plans",
MembershipType = ChannelMembershipType.Standard,
CreatedDateTime = DateTimeOffset.Parse("2020-03-14T11:22:17.067Z"),
AdditionalData = new Dictionary<string, object>()
{
{"@microsoft.graph.channelCreationMode", "migration"}
}
};
await graphClient.Teams["57fb72d0-d811-46f4-8947-305e6072eaa5"].Channels
.Request()
.AddAsync(channel);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
const options = {
authProvider,
};
const client = Client.init(options);
const channel = {
@microsoft.graph.channelCreationMode: "migration",
displayName: "Architecture Discussion",
description: "This channel is where we debate all future architecture plans",
membershipType: "standard",
createdDateTime: "2020-03-14T11:22:17.067Z"
};
let res = await client.api('/teams/57fb72d0-d811-46f4-8947-305e6072eaa5/channels')
.version('beta')
.post(channel);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
IGraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
Channel channel = new Channel();
channel.additionalDataManager().put("@microsoft.graph.channelCreationMode", new JsonPrimitive("migration"));
channel.displayName = "Architecture Discussion";
channel.description = "This channel is where we debate all future architecture plans";
channel.membershipType = ChannelMembershipType.STANDARD;
channel.createdDateTime = CalendarSerializer.deserialize("2020-03-14T11:22:17.067Z");
graphClient.teams("57fb72d0-d811-46f4-8947-305e6072eaa5").channels()
.buildRequest()
.post(channel);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
The following example shows the response. The Content-Location header in the response specifies the path to the channel that is being provisioned.
Once provisioned, this channel can be used for importing messages.
Example 4: Create standard channel with moderation settings
Request
The following example shows a request to create a standard channel with moderation settings. This operation can only be performed for a standard channel.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.