Sort order for Sharepoint API “GET sites?search=*&orderby=name"

Ayase Morita 260 Reputation points
2025-01-29T04:04:21.4033333+00:00

I am using the Sharepoint API “GET sites?search=*&orderby=name” endpoint to get a list of sites sorted by name.

However, when checking the API response, there are a number of sites that are not sorted by name, either by lastModifiedDateTime or by descending order.

What are the characteristics of the sites that are not sorted?

Microsoft 365 and Office | SharePoint | Development
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,481 Reputation points Microsoft External Staff
    2025-01-29T08:52:08.29+00:00

    Hi @Ayase Morita ,

    Currently SharePoint search api doesn't support sites level sort. Sorting is supported for SharePoint and OneDrive item level. You could refer to following document

    https://learn.microsoft.com/en-us/graph/search-concept-sort

    And I feel regretful to inform you that it turns out to be a by-design one. It is highly recommended that you can raise a new ticket on customers’ feedback. With requirements like this increase, the problem may well be released in the future. Thanks for your understanding.


    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.


Your answer

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