POST https://graph.microsoft.com/v1.0/teams/{id}/clone
Content-Type: application/json
{
"displayName": "Library Assist",
"description": "Self help community for library",
"mailNickname": "libassist",
"partsToClone": "apps,tabs,settings,channels,members",
"visibility": "public"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Teams.Item.Clone;
using Microsoft.Graph.Models;
var requestBody = new ClonePostRequestBody
{
DisplayName = "Library Assist",
Description = "Self help community for library",
MailNickname = "libassist",
PartsToClone = ClonableTeamParts.Apps | ClonableTeamParts.Tabs | ClonableTeamParts.Settings | ClonableTeamParts.Channels | ClonableTeamParts.Members,
Visibility = TeamVisibilityType.Public,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Teams["{team-id}"].Clone.PostAsync(requestBody);
mgc teams clone post --team-id {team-id} --body '{\
"displayName": "Library Assist",\
"description": "Self help community for library",\
"mailNickname": "libassist",\
"partsToClone": "apps,tabs,settings,channels,members",\
"visibility": "public"\
}\
'
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphteams "github.com/microsoftgraph/msgraph-sdk-go/teams"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphteams.NewClonePostRequestBody()
displayName := "Library Assist"
requestBody.SetDisplayName(&displayName)
description := "Self help community for library"
requestBody.SetDescription(&description)
mailNickname := "libassist"
requestBody.SetMailNickname(&mailNickname)
partsToClone := graphmodels.APPS,TABS,SETTINGS,CHANNELS,MEMBERS_CLONABLETEAMPARTS
requestBody.SetPartsToClone(&partsToClone)
visibility := graphmodels.PUBLIC_TEAMVISIBILITYTYPE
requestBody.SetVisibility(&visibility)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.Teams().ByTeamId("team-id").Clone().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.teams.item.clone.ClonePostRequestBody clonePostRequestBody = new com.microsoft.graph.teams.item.clone.ClonePostRequestBody();
clonePostRequestBody.setDisplayName("Library Assist");
clonePostRequestBody.setDescription("Self help community for library");
clonePostRequestBody.setMailNickname("libassist");
clonePostRequestBody.setPartsToClone(EnumSet.of(ClonableTeamParts.Apps, ClonableTeamParts.Tabs, ClonableTeamParts.Settings, ClonableTeamParts.Channels, ClonableTeamParts.Members));
clonePostRequestBody.setVisibility(TeamVisibilityType.Public);
graphClient.teams().byTeamId("{team-id}").clone().post(clonePostRequestBody);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Teams\Item\Clone\ClonePostRequestBody;
use Microsoft\Graph\Generated\Models\ClonableTeamParts;
use Microsoft\Graph\Generated\Models\TeamVisibilityType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ClonePostRequestBody();
$requestBody->setDisplayName('Library Assist');
$requestBody->setDescription('Self help community for library');
$requestBody->setMailNickname('libassist');
$requestBody->setPartsToClone(new ClonableTeamParts('apps,tabs,settings,channels,members'));
$requestBody->setVisibility(new TeamVisibilityType('public'));
$graphServiceClient->teams()->byTeamId('team-id')->escapedClone()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.teams.item.clone.clone_post_request_body import ClonePostRequestBody
from msgraph.generated.models.clonable_team_parts import ClonableTeamParts
from msgraph.generated.models.team_visibility_type import TeamVisibilityType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ClonePostRequestBody(
display_name = "Library Assist",
description = "Self help community for library",
mail_nickname = "libassist",
parts_to_clone = ClonableTeamParts.Apps | ClonableTeamParts.Tabs | ClonableTeamParts.Settings | ClonableTeamParts.Channels | ClonableTeamParts.Members,
visibility = TeamVisibilityType.Public,
)
await graph_client.teams.by_team_id('team-id').clone.post(request_body)