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

# Retrieves Menu List

> Returns a list of all the menus and its immediate sub-menus



## OpenAPI

````yaml xm_v1 get /menu
openapi: 3.0.0
info:
  version: 1.0.0
  description: >-
    Design, deploy, and manage experiences for all your digital storefronts with
    fabric XM, a headless e-commerce CMS. Design and develop components in your
    storefront to give your merchandisers and marketers the building blocks they
    need to create pages for products, promotions, and campaigns.
  title: Experiences v1 (XM v1)
  contact:
    email: support@fabric.inc
  license:
    name: fabric Inc
    url: https://fabric.inc/api-license
servers:
  - url: https://cdn.xm.fabric.inc/api
security: []
tags:
  - name: Pages
    description: >-
      XM Pages API allows you to fetch all the live pages, or a live page by a
      specific URL
  - name: Global Components
    description: >-
      XM Global Components API allows you to fetch all the live global component
      data
  - name: Menu
    description: XM Menu API allows you to fetch menus and their items
paths:
  /menu:
    get:
      tags:
        - Menu
      summary: Retrieves Menu List
      description: Returns a list of all the menus and its immediate sub-menus
      operationId: getRootMenus
      parameters:
        - name: x-site-context
          in: header
          description: >-
            The `x-site-context` header is a JSON object that contains
            information about the source you wish to pull from. The mandatory
            `account` is the 24 character identifier found in Copilot. The
            `channel` (Sales channel ID), `stage` (environment name), and `date`
            attributes can be used to further narrow the scope of your data
            source.
          required: true
          schema:
            type: string
            example: >-
              {"date": "2023-01-01T00:00:00.000Z", "channel": 12, "account":
              "1234abcd5678efgh9ijklmno","stage":"production"}
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                description: 200 response object
                properties:
                  status_code:
                    type: integer
                    description: The response status code
                  status:
                    type: string
                    description: Status message
                  data:
                    type: object
                    description: The data object holding the list of menus
                    properties:
                      menus:
                        type: array
                        description: The array of menus
                        items:
                          type: object
                          description: The menu object and its immediate sub-menus
                          allOf:
                            - $ref: '#/components/schemas/Menu'
                            - type: object
                              properties:
                                children:
                                  type: array
                                  description: >-
                                    The list of sub-menus associated with the
                                    menu
                                  items:
                                    $ref: '#/components/schemas/Menu'
              example:
                status_code: 200
                status: List of menus
                data:
                  menus:
                    - _id: 61110b8d3e136500082f5d42
                      channel:
                        - 12
                      channels: []
                      name: Gifts + Holiday
                      label: Gifts + Holiday
                      path: /c/gifts
                      isActive: true
                      images: []
                      videos: []
                      params:
                        - _id: 61110bba873a390008d3a2fe
                          kind: context
                          value: gifts
                      order: 1
                      createdAt: '2021-08-09T11:03:41.984Z'
                      updatedAt: '2021-10-05T17:28:39.582Z'
                      __v: 0
                      children:
                        - _id: 61110bcb3e136500082f5d48
                          channel:
                            - 12
                          channels: []
                          name: Gifts by Price
                          label: Gifts by Price
                          parent: 61110b8d3e136500082f5d42
                          path: /c/gifts/gifts-by-price
                          isActive: true
                          images: []
                          videos: []
                          params:
                            - _id: 61110bdd873a390008d3a303
                              kind: context
                              value: gifts_gifts-by-price
                          order: 1
                          createdAt: '2021-08-09T11:04:43.526Z'
                          updatedAt: '2021-08-09T11:11:57.833Z'
                          __v: 0
                    - _id: 61138c153f658a00085e2eba
                      channel:
                        - 12
                      channels: []
                      name: Bedroom
                      label: Bedroom
                      path: /
                      isActive: false
                      images: []
                      videos: []
                      params: []
                      order: 2
                      createdAt: '2021-08-11T08:36:37.823Z'
                      updatedAt: '2021-10-05T17:28:39.650Z'
                      __v: 0
                      children: []
        '500':
          description: The request was received but an internal error occurred
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: INTERNAL_SERVER_ERROR
                message: >-
                  An internal error occurred. If the issue persists please
                  contact support@fabric.inc.
components:
  schemas:
    Menu:
      type: object
      description: The menu object
      properties:
        _id:
          type: string
          description: The database id associated with the menu
        channel:
          type: array
          description: A deprecated field holding channel information
          items:
            type: integer
            description: The channel identifier
        channels:
          type: array
          description: The channel ids associated with the menu
          items:
            type: string
            description: The channel id associated with the menu
        name:
          type: string
          description: The menu name
        label:
          type: string
          description: The menu label
        path:
          type: string
          description: The relative menu url path
        isActive:
          type: boolean
          description: True if the menu is active; false otherwise
        images:
          type: array
          description: A list of image resources
          items:
            type: object
            description: The image resource details
            properties:
              order:
                type: integer
                description: The order in which the image was added/appears
              meta:
                type: string
                description: Information about the image
              label:
                type: string
                description: Text to be displayed as part of the image
              kind:
                type: string
                description: The type of image (thumbnail, zoomed, etc.)
              url:
                type: string
                description: The url to the image resource
        videos:
          type: array
          description: A list of video resources
          items:
            type: object
            description: The video resource details
            properties:
              label:
                type: string
                description: The label for the video
              order:
                type: integer
                description: The order in which the video was added/appears
              url:
                type: string
                description: The url to the video resource
              provider:
                type: string
                description: The video resource provider
              thumbnails:
                type: array
                description: List of thumbnails to use for the video
                items:
                  type: object
                  description: Thumbnail details
                  properties:
                    size:
                      type: string
                      description: The size of the thumbnail image
                    url:
                      type: string
                      description: The url for the thumbnail image
        params:
          type: array
          description: List of additional data associated with the menu
          items:
            type: object
            description: Additional data associated with the menu
            properties:
              _id:
                type: string
                description: The virtual id for the parameter
              kind:
                type: string
                description: A description for the parameter
              value:
                type: string
                description: The value for the parameter
        order:
          type: integer
          description: The position the menu appears in the UI
        createdAt:
          type: string
          format: date-time
          description: The date and time the menu was created
        updatedAt:
          type: string
          format: date-time
          description: The date and time the menu was last updated
        __v:
          type: integer
          description: The versionKey associated with the menu
    Error:
      type: object
      description: The server error response object
      properties:
        code:
          type: string
          description: The code associated with the type of server error
        message:
          type: string
          description: The message associated with the server error
      required:
        - code
        - message

````