Export API - retrieving chats initiated by external users

Eran Otmi 60 Reputation points
2026-08-05T09:38:12.4366667+00:00

Hi!

I have the following scenario:

a Teams chat was initiated by an external user (company B)
with a user from my organization (company A)

When calling the /getAllMessages endpoint for the user from my org (company A),
I can't find the chats that were initiated by the external user (company B).

Is that by-design?
Do I need to follow a different process to retrieve those chats?

Thanks

Microsoft Teams | Development
Microsoft Teams | Development

Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs

0 comments No comments

1 answer

Sort by: Most helpful
  1. Ana Le 1,895 Reputation points Independent Advisor
    2026-08-05T10:03:29.8933333+00:00

    Hi,

    Based on your description, this behavior can be expected depending on the type of external chat.

    The /users/{id}/chats/getAllMessages Teams Export API is intended to export messages that are available to your tenant. For federated (External Access) chats that were initiated from another tenant, those conversations may not be returned by the Export API from your tenant, even if one of your users participated in the chat.

    Could you please confirm whether the external user is:

    • Using External access (federation), or
    • Added as a B2B guest in your tenant?

    If this is an External access (federation) scenario, there isn’t a different Export API endpoint to retrieve those conversations if they are not returned by getAllMessages.

    If you can share:

    • whether this is a 1:1 or group chat,
    • whether the external user is a federated user or a guest,
    • and whether you’re using the Microsoft Teams Export API (/users/{id}/chats/getAllMessages),

    I will take a closer look and see if there are any additional considerations specific to your scenario.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.