# Folders Retrieval

**URL:** <https://forums.nylas.com/t/folders-retrieval/1047>\
**Category:** Question and Answers\
**Tags:** email-api\
**Created:** [January 6, 2026, 12:43pm UTC](https://forums.nylas.com/t/folders-retrieval/1047 "2026-01-06T12:43:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yvan](https://avatars.discourse-cdn.com/v4/letter/y/3ab097/32.png) [@Yvan](https://forums.nylas.com/u/Yvan)\
**Post date:** [January 6, 2026, 12:43pm UTC](https://forums.nylas.com/t/folders-retrieval/1047/1 "2026-01-06T12:43:05Z")

</div>

Hello nylas,  
I have an issue with the retrieval of all folders (endpoint: GET “grants/\<NYLAS\_GRANT\_ID\>/folders”).

I would like customers to be able to define which folders they want to see at the top of the list, because I often have folders such as “inbox” or “sent” that end up on page 3 or 4 when data is retrieved from the user’s mailbox.

When folders are displayed, clients complain that they don’t see the same display as in their main GMAIL or OUTLOOK inbox, and this is mainly due, for example, displaying folders such as CATEGORY\_FORUMS and CATEGORY\_PERSONAL as top priority ahead of folders such as Inbox or Drafts.

So how can we ensure that the order of the source mailbox is respected when the data is moved up?

I attached a screen of a typical page 1 retrieval from the route.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/nylas3/original/1X/098e1739f18458a09b04926e63cd2e451a4a3b4a.png)

---

<div class="post-metadata">

**Author:** ![Samuel.R](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@Samuel.R](https://forums.nylas.com/u/Samuel.R)\
**Post date:** [January 6, 2026, 1:42pm UTC](https://forums.nylas.com/t/folders-retrieval/1047/2 "2026-01-06T13:42:51Z")

</div>

Hi Yvan,

Thanks for reaching out! The folder ordering you’re seeing is expected behavior.

Gmail and Outlook web UIs use custom client-side ordering that prioritizes system folders like Inbox and Sent - this ordering isn’t exposed by their APIs, so we can’t replicate it server-side.

You can implement client-side sorting using the **`system_folder`** and **`name`** fields we return. [Documentation](https://developer.nylas.com/docs/api/v3/ecc/?redirect=api#tag/folders/get/v3/grants/%7Bgrant_id%7D/folders).

This will display Inbox, Sent, Drafts, etc. at the top, followed by other system folders, then user-created folders, matching what users see in their native email clients.

Let us know if you have any questions!
