Skip to content
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
707f98b
Created a new draft for migrating external message to Teams
NehaHEDAU-MSFT Aug 1, 2025
46ee76d
updated Note and changed errors for language accuracy
NehaHEDAU-MSFT Aug 1, 2025
534e140
Added Note and Step 2
NehaHEDAU-MSFT Aug 1, 2025
71180f2
made corrections with Acrolinx
NehaHEDAU-MSFT Aug 1, 2025
0c9be99
Added Title
NehaHEDAU-MSFT Aug 1, 2025
e8daf73
Made corrections to Title and content
NehaHEDAU-MSFT Aug 1, 2025
5cd4c6e
Fixed errors and resolved issues
NehaHEDAU-MSFT Aug 4, 2025
9ff77d1
changed author
NehaHEDAU-MSFT Aug 4, 2025
7764410
Update new-draft-external-messages-to-teams.md
NehaHEDAU-MSFT Aug 6, 2025
d951009
Updated the content for chat migration
NehaHEDAU-MSFT Aug 7, 2025
92871b3
Added Example
NehaHEDAU-MSFT Aug 7, 2025
25afb26
Added content for completing chat and channel migration
NehaHEDAU-MSFT Aug 7, 2025
2775fd2
incorporated internal review changes
NehaHEDAU-MSFT Aug 29, 2025
616767e
added second-level headings
NehaHEDAU-MSFT Aug 29, 2025
970f339
saved file
NehaHEDAU-MSFT Aug 29, 2025
1f1434b
Merge branch 'main' into NehaHEDAU-MSFT/Migrating-APIs
NehaHEDAU-MSFT Sep 25, 2025
eb4476d
changes in draft
NehaHEDAU-MSFT Sep 25, 2025
c1e3c1e
changes in the content
NehaHEDAU-MSFT Sep 26, 2025
d1f96df
renamed file and seperated chat and channel migration APIs
NehaHEDAU-MSFT Sep 26, 2025
734f87e
Changed Step 3
NehaHEDAU-MSFT Sep 26, 2025
9f7ddd5
Merge branch 'main' into NehaHEDAU-MSFT/Migrating-APIs
NehaHEDAU-MSFT Sep 29, 2025
ec8b327
Changed the numbering and headings
NehaHEDAU-MSFT Sep 29, 2025
7f6dddf
added permissions and supported channel types
NehaHEDAU-MSFT Sep 29, 2025
11bd1db
made a tunnel
NehaHEDAU-MSFT Sep 29, 2025
37b05a1
updated sections and content
NehaHEDAU-MSFT Sep 29, 2025
1af3bba
removed tunnel
NehaHEDAU-MSFT Sep 29, 2025
3daa96f
Update import-external-platform-messages-to-teams.md
NehaHEDAU-MSFT Sep 29, 2025
e055973
end tabset added
NehaHEDAU-MSFT Sep 29, 2025
b588849
ending loop component
NehaHEDAU-MSFT Sep 29, 2025
debfdbd
incorporated review changes
NehaHEDAU-MSFT Sep 30, 2025
a2436ac
Update import-external-platform-messages-to-teams.md
NehaHEDAU-MSFT Sep 30, 2025
957b062
Self review
NehaHEDAU-MSFT Sep 30, 2025
a134244
Fixes from SME and peer review
NehaHEDAU-MSFT Nov 6, 2025
e5853ea
part 2 changes
NehaHEDAU-MSFT Nov 6, 2025
3902730
Update import-external-platform-messages-to-teams.md
NehaHEDAU-MSFT Nov 6, 2025
65b7c16
Update import-external-platform-messages-to-teams.md
NehaHEDAU-MSFT Nov 6, 2025
7331e29
Review comments addressed part 1
NehaHEDAU-MSFT Nov 10, 2025
b896017
Added a Tip
NehaHEDAU-MSFT Nov 10, 2025
a93ac0f
review comments part 3
NehaHEDAU-MSFT Nov 10, 2025
6279c57
moved the content scope table and part 3 changes
NehaHEDAU-MSFT Nov 10, 2025
98f0602
final changes and acrolinx
NehaHEDAU-MSFT Nov 10, 2025
874f400
deleted extra table row and added a lead line
NehaHEDAU-MSFT Nov 11, 2025
fca0279
Update import-external-platform-messages-to-teams.md
NehaHEDAU-MSFT Nov 11, 2025
cf612f3
Update import-external-platform-messages-to-teams.md
NehaHEDAU-MSFT Nov 11, 2025
883ec94
Deleted new file and copied final content
NehaHEDAU-MSFT Nov 13, 2025
326326b
file renamed
NehaHEDAU-MSFT Nov 13, 2025
4f6c180
removed the tunnel
NehaHEDAU-MSFT Nov 13, 2025
45c1dbd
added overview for channel and chat
NehaHEDAU-MSFT Nov 13, 2025
10305fb
explained new and existing chats and channels
NehaHEDAU-MSFT Nov 14, 2025
e21aba7
added federated content
NehaHEDAU-MSFT Nov 16, 2025
397cb61
added two paths
NehaHEDAU-MSFT Nov 16, 2025
81c003c
updated content for Path 1
NehaHEDAU-MSFT Nov 17, 2025
8a22417
updated steps as per new flow
NehaHEDAU-MSFT Nov 17, 2025
ff088e9
channel migration completion
NehaHEDAU-MSFT Nov 17, 2025
57595ad
internal review incorporated
NehaHEDAU-MSFT Nov 17, 2025
aada80c
part 2 changes
NehaHEDAU-MSFT Nov 17, 2025
79fb8ba
internal review comments addressed-part 1
NehaHEDAU-MSFT Nov 18, 2025
df5597e
internal review-part 2
NehaHEDAU-MSFT Nov 18, 2025
75a83e1
Update import-external-messages-to-teams.md
NehaHEDAU-MSFT Nov 18, 2025
0fdbb84
Update import-external-messages-to-teams.md
NehaHEDAU-MSFT Nov 18, 2025
4ab2c6c
Merge branch 'main' into NehaHEDAU-MSFT/Migrating-APIs
SukanyaDas-MSFT Nov 18, 2025
0950d1a
Merge branch 'NehaHEDAU-MSFT/Migrating-APIs' of https://github.com/Mi…
SukanyaDas-MSFT Nov 18, 2025
0f116e9
Draft enhancement 1
SukanyaDas-MSFT Nov 18, 2025
9bb04c6
Dev 0 changes
SukanyaDas-MSFT Nov 18, 2025
67296b1
Edits
SukanyaDas-MSFT Nov 18, 2025
6cca850
Update
SukanyaDas-MSFT Nov 18, 2025
9841cf9
Update import-external-messages-to-teams.md
SukanyaDas-MSFT Nov 18, 2025
8aecc36
Update import-external-messages-to-teams.md
SukanyaDas-MSFT Nov 18, 2025
bd4260d
Update import-external-messages-to-teams.md
SukanyaDas-MSFT Nov 19, 2025
9733548
Merge branch 'main' into NehaHEDAU-MSFT/Migrating-APIs
SukanyaDas-MSFT Nov 19, 2025
ce78a76
PR final updates-SD
SukanyaDas-MSFT Nov 19, 2025
e24c7c2
Update import-external-messages-to-teams.md
SukanyaDas-MSFT Nov 19, 2025
714ec08
update to whats new.md
NehaHEDAU-MSFT Nov 19, 2025
2e77e6a
fixed warnings
NehaHEDAU-MSFT Nov 19, 2025
d30781c
updated the new optional step
NehaHEDAU-MSFT Nov 20, 2025
7ef9f68
fixed warning
NehaHEDAU-MSFT Nov 20, 2025
943225a
re-worded the example
NehaHEDAU-MSFT Nov 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ You can receive the error message in the following scenarios:
> [!div class="nextstepaction"]
> [I ran into an issue](https://github.com/MicrosoftDocs/msteams-docs/issues/new?template=Doc-Feedback.yaml&title=%5BI+ran+into+an+issue%5D+Step+1%3A+Create+a+team&&author=%40AkJo&pageUrl=https%3A%2F%2Flearn.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fplatform%2Fgraph-api%2Fimport-messages%2Fimport-external-messages-to-teams%23step-1-create-a-team&contentSourceUrl=https%3A%2F%2Fgithub.com%2FMicrosoftDocs%2Fmsteams-docs%2Fblob%2Fmain%2Fmsteams-platform%2Fgraph-api%2Fimport-messages%2Fimport-external-messages-to-teams.md&documentVersionIndependentId=ce77e760-90cf-e6b1-3cec-ae55ee50c33e&platformId=c9cc8ad3-6c28-7c8c-af03-219bbefa1d38&metadata=*%2BID%253A%2Be473e1f3-69f5-bcfa-bcab-54b098b59c80%2B%250A*%2BService%253A%2B%2A%2Amsteams%2A%2A)

## Step 2: Create a channel

Creating a channel for the imported messages is similar to the create team scenario:
Expand Down Expand Up @@ -296,6 +295,7 @@ HTTP/1.1 200 OK
"reactions": []
}
```

> [!div class="nextstepaction"]
> [I ran into an issue](https://github.com/MicrosoftDocs/msteams-docs/issues/new?template=Doc-Feedback.yaml&title=%5BI+ran+into+an+issue%5D+Step+3%3A+Import+messages&&author=%40AkJo&pageUrl=https%3A%2F%2Flearn.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fplatform%2Fgraph-api%2Fimport-messages%2Fimport-external-messages-to-teams%23step-3-import-messages&contentSourceUrl=https%3A%2F%2Fgithub.com%2FMicrosoftDocs%2Fmsteams-docs%2Fblob%2Fmain%2Fmsteams-platform%2Fgraph-api%2Fimport-messages%2Fimport-external-messages-to-teams.md&documentVersionIndependentId=ce77e760-90cf-e6b1-3cec-ae55ee50c33e&platformId=c9cc8ad3-6c28-7c8c-af03-219bbefa1d38&metadata=*%2BID%253A%2Be473e1f3-69f5-bcfa-bcab-54b098b59c80%2B%250A*%2BService%253A%2B%2A%2Amsteams%2A%2A)
Expand Down Expand Up @@ -332,7 +332,6 @@ Action called on a `team` or `channel` that isn't in `migrationMode`.
> [!div class="nextstepaction"]
> [I ran into an issue](https://github.com/MicrosoftDocs/msteams-docs/issues/new?template=Doc-Feedback.yaml&title=%5BI+ran+into+an+issue%5D+Step+4%3A+Complete+migration+mode&&author=%40AkJo&pageUrl=https%3A%2F%2Flearn.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fplatform%2Fgraph-api%2Fimport-messages%2Fimport-external-messages-to-teams%23step-4-complete-migration-mode&contentSourceUrl=https%3A%2F%2Fgithub.com%2FMicrosoftDocs%2Fmsteams-docs%2Fblob%2Fmain%2Fmsteams-platform%2Fgraph-api%2Fimport-messages%2Fimport-external-messages-to-teams.md&documentVersionIndependentId=ce77e760-90cf-e6b1-3cec-ae55ee50c33e&platformId=c9cc8ad3-6c28-7c8c-af03-219bbefa1d38&metadata=*%2BID%253A%2Be473e1f3-69f5-bcfa-bcab-54b098b59c80%2B%250A*%2BService%253A%2B%2A%2Amsteams%2A%2A)

## Step five: Add team members

You can add a member to a team [using the Teams UI](https://support.microsoft.com/office/add-members-to-a-team-in-teams-aff2249d-b456-4bc3-81e7-52327b6b38e9) or Microsoft Graph [add member](/graph/api/group-post-members?view=graph-rest-beta&tabs=http&preserve-view=true) API:
Expand Down Expand Up @@ -376,7 +375,6 @@ HTTP/1.1 204 No Content
> [!NOTE]
> Inline images are the only type of media supported by the import message API schema.

##### Import content scope

The following table provides the content scope:
Expand All @@ -396,7 +394,6 @@ The following table provides the content scope:
||Cross posts between channels|
||Shared channels|


## See also

* [Microsoft Graph and Teams integration](/graph/teams-concept-overview)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
---
title: Import External Platform Messages Using Microsoft Graphs
description: Learn how to use Microsoft Graph to import historical messages and data from all third-party platforms to Teams.
ms.localizationpriority: high
author: "surbhigupta"
ms.topic: overview
ms.owner: TBD
ms.date: 01/08/2025
---

# Use Microsoft Graph to Import Messages from External Platforms to Teams

You can use Microsoft Graph to migrate existing message history and data from an external system into a Teams channel. This feature enables users to continue conversations without interruption, by recreating the messaging hierarchy from a third-party platform directly within Teams.

> [!NOTE]
> In the future, Microsoft might require you or your customers to pay extra fees based on the amount of data imported.
## API Migration Workflow

Use the step-by-step migration flow to ensure a seamless transition of historical messages in both existing and newly created channels or chats by enabling migration mode.

## Step-by-Step Migration Flow

### 1. Create or select a channel/chat

Namespace: microsoft.graph

You can either create a new channel or chat in a Team or use an existing channel or chat.

> [!NOTE]
> All APIs listed in the following sections require the `Teamswork.Migrate.All` permission in the application context. Delegated authentication isn't supported.
### 2. Use startMigration API to start channel and chat migration

* Use the startMigration API, to enable migration mode on existing Teams channels/chats, and allow import of historical messages. Previously, import operations were restricted to newly created standard channels and chats in an empty state. Refer [Import third-party platform messages to Teams using Microsoft Graph](import-external-messages-to-teams.md)

* Define a minimum timestamp for messages to be migrated. The provided timestamp must be older than the channel or chat’s current createdDateTime and replaces it during migration.

#### 2.1 Channel migration

* The supported channels are all the existing Shared, Private, and Public channels. You can optionally provide a request body to specify the minimum timestamp for the messages to be migrated.

#### Channel request

```HTTP
POST /teams/{team-id}/channels/{channel-id}/startMigration
{
"conversationCreationDateTime": "2024-01-01T00:00:00Z"
}
```

#### 2.2 Chat migration

* The supported chat types include Group chats and One-on-one (1:1) chats. **Meeting chats are not supported. External members are supported in all applicable chat types.**
* The startMigration API initiates the message migration process by setting the migrationMode property to **inProgress** for a specified chat.

#### Chat request

```HTTP
POST /chats/{chat-id}/startMigration
{
"conversationCreationDateTime": "2024-01-01T00:00:00Z"
}
```

#### Channel and Chat response

For both channels and chats, if the request is successful, the method returns a **204 No Content** status code. The response body is empty.

**Example of a request**:

```HTTP
POST https://graph.microsoft.com/beta/teams/57fb72d0-d811-46f4-8947-305e6072eaa5/channels/19:[email protected]/startMigration
{
“conversationCreationDateTime”: “2024-01-01T00:00:00Z”
}
```

Response of the request:
**HTTP/1.1 204 No Content**

> [!NOTE]
>
> * If no request body is provided, the API uses the current date and time as the minimum timestamp.
> * `conversationCreationDateTime` must be:
> * Greater than the minimum value for `DateTimeOffset`.
> * Less than the current value of the channel or chat's `CreatedDateTime`.
### 3. Call the GET /channel/chat API to confirm that the **migrationMode** property is set to **inProgress**, after completing step 2

### 4. Import messages using POST API

Go to [Import third-party platform messages to Teams using Microsoft Graph](import-external-messages-to-teams.md) and use the POST API, to begin sending back-in-time messages.

### 5. Complete channel and chat migration

Namespace: microsoft.graph

Use the **completeMigration** API to finish the migration process for both new and existing channels and chats. Previously, this operation was limited to newly created Standard channels and chats initiated for the initial migration flow.

#### 5.1 Complete Channel Migration

* When a channel is created in migration mode for the initial import flow, calling the **completeMigration** API updates the migrationMode property to completed. **This change is permanent and marks the channel as fully migrated.**
* After calling completeMigration, you can still import extra messages by using the startMigration API.

#### Request for Completing Channel Migration

```HTTP
POST /teams/{team-id}/channels/{channel-id}/completeMigration
```

#### 5.2 Complete Chat Migration

* For existing chats already in migration mode, call the **completeMigration** API to update the migrationMode property to completed. **This marks the chat as fully migrated.**
* After calling completeMigration on a new or existing chat, you can continue importing messages by using the startMigration API.

#### Request for Completing Chat Migration

```HTTP
POST /chats/{chat-id}/completeMigration
```

> [!IMPORTANT]
> Don't include a request body when calling this method for channels or chats. If the request is successful, the method returns a 204 No Content status code. The response body is empty.
>
> [!NOTE]
>
> In Migration Mode:
>
> * Certain operations such as sending messages and adding members are restricted.
> * Calling the completeMigration API means that channel or chat migration is complete and normal operations can resume.
#### Supported channel or chat types

|Entity Type |Sub Type |Migration Mode Support |Notes|
|---------|---------|---------|---------|
|**Channels** | General, Standard, Private, Shared | New and existing | Must be created or already in migration mode |
|**Chats** | Group, One-on-one (1:1) | New and existing | Meeting chats not supported; external members supported |

### 6. Call the GET /channel/chat API to verify that the migrationMode property is marked as **completed**

## See also

* [Microsoft Graph and Teams integration](/graph/teams-concept-overview)
* [Export content with the Microsoft Teams Export APIs](/microsoftteams/export-teams-content)
* [Microsoft Teams service limits](/graph/throttling-limits#microsoft-teams-service-limits)
* [Licensing and payment requirements for the Microsoft Teams API](/graph/teams-licenses)