> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stax.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# List email folders

> List the connected mailbox's local folder catalog for the sidebar / "move to" picker. Returns an empty list when the mailbox is not Nylas-backed. Each folder carries its tree position (display_name, depth, parent), derived from the label name on Gmail and from the provider parent id elsewhere, so the client renders nesting the same way for both.



## OpenAPI

````yaml /api-reference/cx/swagger.json get /inbox/folders
openapi: 3.0.0
info:
  description: CX API.
  title: CX API
  contact:
    name: API Support
    url: https://stax.ai
    email: support@stax.ai
  version: '1.0'
servers:
  - url: https://api.cx.stax.ai
security: []
paths:
  /inbox/folders:
    get:
      tags:
        - Inbox
      summary: List email folders
      description: >-
        List the connected mailbox's local folder catalog for the sidebar /
        "move to" picker. Returns an empty list when the mailbox is not
        Nylas-backed. Each folder carries its tree position (display_name,
        depth, parent), derived from the label name on Gmail and from the
        provider parent id elsewhere, so the client renders nesting the same way
        for both.
      responses:
        '200':
          description: Folder catalog with each folder's tree position
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pkg_routes_inbox_folders.ListResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
      security:
        - ApiKeyAuth: []
components:
  schemas:
    pkg_routes_inbox_folders.ListResponse:
      type: object
      properties:
        folders:
          type: array
          items:
            $ref: '#/components/schemas/pkg_routes_inbox_folders.FolderNode'
    pkg_routes_inbox_folders.FolderNode:
      type: object
      properties:
        _id:
          type: string
        attributes:
          type: array
          items:
            type: string
        deleted_at:
          type: string
        depth:
          description: >-
            Depth is the number of ancestors above this folder (0 for a root
            folder).
          type: integer
        display_name:
          description: >-
            DisplayName is the folder's own name without its ancestors —
            "Github" for a

            Gmail label named "Services/Github", whose parents render as their
            own rows.
          type: string
        external_id:
          description: provider (Nylas) folder id
          type: string
        grant_id:
          type: string
        name:
          type: string
        parent:
          description: >-
            Parent is the catalog id of the containing folder, nil at the root.
            On Gmail

            this is derived from the name; a folder whose ancestor label is
            missing has

            no parent row and reports depth 0, matching how Gmail itself renders
            it.
          type: string
        parent_id:
          description: Outlook nested folders
          type: string
        system:
          description: \Inbox, \Sent, \Trash…
          type: boolean
        team:
          type: string
        user:
          type: string
  securitySchemes:
    ApiKeyAuth:
      description: CX API key. Create one in CX under Settings → Advanced → API Keys.
      in: header
      name: x-api-key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.