Share via

Retrieving deleted voice notes for Teams via Export API

Eran Otmi 40 Reputation points
2026-04-13T14:27:37.5933333+00:00

Hi!

I am trying to use the following endpoints:

/getAllMessages

/getAllRetainedMessages

in order to retrieve/download deleted voice messages, but I can't.
When I try to do the same with deleted attachments (gif, png, etc) it works and I can see the actual attachment that was deleted.

My question is -

is there some sort of limitation in those endpoints for Voice Notes?
when a user deletes them from the chat, are they not stored anymore?
is there another way to access them?

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

Answer accepted by question author

  1. Nivedipa-MSFT 4,246 Reputation points Microsoft External Staff Moderator
    2026-04-14T05:42:42.7466667+00:00

    Hello Eran Otmi,
    Deleted voice messages (audio clips recorded in Teams chat) are handled differently than regular attachments when using the Graph API.

    Here's what's happening:

    /getAllMessages and /getAllRetainedMessages will return metadata for deleted voice messages, but the hosted content URL for the audio file will either be empty or return a 404 after deletion. In contrast, regular attachments like images, GIFs, or files are stored in SharePoint or OneDrive and remain accessible even after the chat message is soft-deleted. Voice messages are stored in Teams' internal storage, so when deleted, the audio data is removed and not retained like other attachments.

    Alternative approaches:

    -Microsoft Purview eDiscovery: Run a content search scoped to Teams messages. Purview may retain references to voice messages if a retention or legal hold policy was active before deletion.

    • Compliance Export via Purview: Export Teams chat data, which may include voice message files if covered by retention.
    • Teams Export API with resource-specific consent: Apps with RSC permissions can access chatMessage resources with hostedContents, but post-deletion availability depends on retention.
    • Proactive archival: If you need to preserve voice messages, capture them in real-time through subscription/webhook notifications (/chats/getAllMessages) before deletion occurs.

    Recommendation: For regulatory compliance that requires retaining deleted voice messages, set up a Purview retention policy with "Retain items even if users delete" on Teams chat messages, and use eDiscovery for retrieval instead of relying on Graph API endpoints.

    Was this answer helpful?


Answer accepted by question author

  1. Jayden-P 21,565 Reputation points Microsoft External Staff Moderator
    2026-04-13T15:04:25.9266667+00:00

    Hi @Eran Otmi

    From this article, Learn about retention for Teams | Microsoft Learn, it stated that "Code snippets, recorded voice memos from the Teams mobile client, thumbnails, announcement images, and reactions from others in the form of emoticons aren't retained when you use retention policies for Teams."

    This is the reason why when the voice notes get deleted, it did not show up in endpoints you used because it was not retained in the first place.

    /getAllMessages (standard export): Captures soft-deleted messages for up to 21 days after user deletion. It works for most attachments, but voice memo audio files are not stored/preserved the same.

    /getAllRetainedMessages (for longer-term retention/holds): Relies on retention policies or eDiscovery holds. Since voice memos are not retained at all under these policies, deleted ones are not available.

    I hope this information helps.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?


0 additional answers

Sort by: Most 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.