Nylas Folders API

To simplify your experience, the Nylas Email API uses the same commands to manage both folders and labels, and can refer to specific folders using the provider's `folder_id`. The Email API also exposes provider-specific fields (for example, Google's `background_color` field). Email providers use folders and labels to store and organize messages. Depending on the provider (Google, some IMAP providers, and so on), a message can be contained in more than one folder. ⛔️ The Delete Folder endpoint deletes a folder, including all messages it contains. ## Folders scopes The table below lists the Folders endpoints and which scopes they require. The table shortens the full scope URI for space reasons, so add the prefix for the provider when requesting scopes. The ☑️ in each column indicates the most restrictive scope you can request for each provider and still use that API. More permissive scopes appear under the minimum option. If you're already using one of the permissive scopes, you don't need to add the more restrictive scope. | Endpoint | Google Scopes`https://www.googleapis.com/auth/...` | Microsoft Scopes`https://graph.microsoft.com/...` | | :------------------------------------------------------------------------------------------- | :------------------------------------------------------ | :------------------------------------------------------------------------------------- | | **GET** `/folders`**GET** `/folders/` | `/gmail.labels` ☑️`/gmail.modify` | `Mail.Read` ☑️`Mail.ReadWrite``Mail.ReadWrite.Shared``Mail.Read.Shared` | | **POST** `/folders`**PUT** `/folders/`**DELETE** `/folders/` | `/gmail.labels` ☑️`/gmail.modify` | `Mail.ReadWrite` ☑️`Mail.ReadWrite.Shared` | For more information about scopes, see [Using scopes to request user data](/docs/dev-guide/scopes/). ## Folders notifications You can subscribe to the following triggers so Nylas notifies you about changes to your users' data: - `folder.created` - `folder.updated` - `folder.deleted` For more information, see the [Folder notification schemas](/docs/reference/notifications/#folder-notifications). ## Folders limitations Keep the following limitations in mind when you're working with folders: - Because providers structure folders in different ways, Nylas doesn't support nested folders. Instead, Nylas flattens sub-folders and displays them in the same list as top-level folders. - For Microsoft, you can use the `parent_id` to reflect the folder hierarchy in your project. - On IMAP, the hierarchy is reflected in the folder name (for example, `Accounting.Taxes` or `INBOX\Accounting\Taxes`). - Because of how IMAP providers handle folders and labels, the folder names that Nylas returns aren't always the same as those listed in the provider's UI (for example, the "Trash" folder might be "Deleted Messages" in a Nylas response). Instead of relying on names, you should [use attributes and IDs to get the data you need](/docs/v3/email/folders/#folder-and-label-behavior). - IMAP servers use provider-specific formats to represent the folder name and hierarchy. When you make a [Create Folder request](/docs/reference/api/folders/post-folder/) for an IMAP account, Nylas creates a folder with the name you pass. If the name includes the IMAP separator that corresponds with the server settings, Nylas creates a sub-folder based on the folder name. - Nylas doesn't support using keywords to reference folders on the provider (for example, `in:inbox` returns a [`400` error](/docs/api/errors/400-response/)). Instead, Nylas recommends you use specific folder `id`s to get the data you need. - It might take up to 10 minutes for folders to be available in Nylas after you authenticate an IMAP grant.

Operations 5

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /v3/grants/{grant_id}/folders List a mailbox's folders and labels · Return all folders #
Ask an LLM
“What folders or labels exist in this user's mailbox?”
“Can I include hidden folders for Microsoft accounts?”
Tell an agent
List all folders for grant {grant}.
Show subfolders of {parent_id} for {grant}.
POST /v3/grants/{grant_id}/folders Create a mail folder or label · Create a Folder #
Ask an LLM
“How do I create a new folder or label in someone's mailbox?”
“Can I set a label color when creating a Gmail folder?”
Tell an agent
Create a folder named {name} for grant {grant}.
Create folder {name} under {parent_id} on {grant}.
GET /v3/grants/{grant_id}/folders/{folder_id} Get one folder · Return a Folder #
Ask an LLM
“What are the details of a specific mail folder?”
“Can I look up a single folder by its ID?”
Tell an agent
Show folder {folder} for grant {grant}.
Get the details of folder {folder} on {grant}.
PUT /v3/grants/{grant_id}/folders/{folder_id} Rename, move or recolor a folder · Update a folder #
Ask an LLM
“Can I rename an existing mail folder?”
“Is it possible to move a folder under a different parent?”
Tell an agent
Rename folder {folder} on grant {grant} to {name}.
Move folder {folder} under {parent_id} for {grant}.
DELETE /v3/grants/{grant_id}/folders/{folder_id} Delete a mail folder · Delete a Folder #
Ask an LLM
“How do I delete a folder or label from a mailbox?”
“Can I remove a folder shared from another user's mailbox?”
Tell an agent destructive · confirm first
Delete folder {folder} from grant {grant}.
Remove the mail folder {folder} on {grant}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/nylas:nylas-folders-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

nylas-folders-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Nylas Folders API
  version: v3
  summary: The complete Nylas v3 API — Email, Calendar, Contacts, Notetaker, Scheduling, Administration, and Migration.
  description: The Nylas API is designed using the REST ideology to provide simple and predictable URIs to access and modify objects. Requests support standard HTTP methods like `GET`, `PUT`, `POST`, and `DELETE`, and standard status codes. Response bodies are always UTF-8 encoded JSON objects, unless explicitly documented otherwise. You can use the Nylas Postman collection to quickly start using the Nylas APIs. For more information, check out the Nylas Postman collection documentation.
  contact:
    url: https://www.nylas.com/
servers:
- url: https://api.us.nylas.com
  description: U.S.
- url: https://api.eu.nylas.com
  description: E.U.
security:
- ACCESS_TOKEN: []
- NYLAS_API_KEY: []
tags:


# --- truncated at 32 KB (43 KB total) ---
# Full source: https://artifacts.apis.io/nylas/openapi/nylas-folders-api-openapi.yml