Share via

channel: getAllMessages ignores $top query parameter

Jason Perrone 20 Reputation points
2026-05-04T10:27:35.3833333+00:00

According to the official documentation, the $top query parameter is supported on the channel: getAllMessages endpoint to control the number of items per response:

"You can use the $top query parameter to control the number of items per response."

However, in practice $top is being completely ignored by the API. The server returns a fixed page size (appears to be ~10 messages) regardless of the value passed.

Steps to Reproduce

A team has 18 total messages across 3 channels for the date range. I make the following request:

GET https://graph.microsoft.com/v1.0/teams/{team-id}/channels/getAllMessages?$top=50&$filter=lastModifiedDateTime gt 2026-05-01T00:00:00Z and lastModifiedDateTime lt 2026-05-31T00:00:00Z
Authorization: Bearer {token}

Expected

A single response containing all 18 messages (since 18 < $top=50), with no @odata.nextLink.

Actual

The response contains only 10 messages and includes an @odata.nextLink, requiring 3 separate page requests to fetch all 18 messages:

{
  "@odata.count": 10,
  "@odata.nextLink": "https://graph.microsoft.com/v1.0/teams/{team-id}/channels/getAllMessages?$skiptoken=...",
  "value": [ /* 10 messages */ ]
}

Page split observed:

  • Page 1: 10 messages
  • Page 2: 7 messages
  • Page 3: 1 message

Question

Is $top actually supported on this endpoint, or is the documentation incorrect? If it's a known limitation, the docs should be updated to reflect that the page size is server-controlled and $top has no effect.

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. Vergil-V 12,530 Reputation points Microsoft External Staff Moderator
    2026-05-04T11:35:01.2033333+00:00

    Hi @Jason Perrone   

    Thank you for sharing the details and the reference. Based on my research, the $top query parameter is supported for the channel getAllMessages endpoint. The behavior you described is expected and is currently considered by design, as documented in the reference below. 

     image

    Reference: Export content with the Microsoft Teams Export APIs - Microsoft Teams | Microsoft Learn   

    From my testing, adjusting the $top filter does affect the output results. For example, there is a noticeable difference between using $top=250 and $top=50, where $top=250 is able to reflect more recent message updates. 

    That said, I do agree that the official documentation should better align and clearly reflect this behavior. For this reason, I strongly recommend sharing your feedback through Microsoft Graph · Community 

    This is the official channel for submitting suggestions, and it helps ensure your feedback reaches Microsoft’s development team so they can stay aware of and consider the latest user input. 

    I hope this provides helpful insight. If you decide to submit new feedback, please feel free to share the link here so other users can review it and vote. 

    Once again, thank you for your time and contribution. 


    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.

    1 person found 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.