Skip to main content
POST
/
api
/
v1
/
menus.json
Create Menu
curl --request POST \
  --url https://api.launchmystore.io/api/v1/menus.json \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "<string>",
  "handle": "<string>",
  "links": [
    {
      "title": "<string>",
      "url": "<string>",
      "type": "<string>",
      "resource_id": "<string>",
      "links": [
        {}
      ]
    }
  ]
}
'
{
  "success": true,
  "data": {}
}

Documentation Index

Fetch the complete documentation index at: https://docs.launchmystore.io/llms.txt

Use this file to discover all available pages before exploring further.

Create Menu

Creates a new navigation menu in the store.

Request

curl -X POST "https://api.launchmystore.io/api/v1/menus.json" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Footer Navigation",
    "handle": "footer",
    "links": [
      {
        "title": "About Us",
        "url": "/pages/about-us",
        "type": "page"
      },
      {
        "title": "Contact",
        "url": "/pages/contact",
        "type": "page"
      },
      {
        "title": "Privacy Policy",
        "url": "/policies/privacy-policy",
        "type": "policy"
      }
    ]
  }'

Body Parameters

title
string
required
The menu title
handle
string
URL-safe handle. Auto-generated from title if not provided. Common handles include main-menu, footer, header.
Array of menu links

Response

success
boolean
Whether the request succeeded
data
object
The created menu object with all links

Example Response

{
  "success": true,
  "data": {
    "id": "menu_new789",
    "title": "Footer Navigation",
    "handle": "footer",
    "links": [
      {
        "id": "link_new001",
        "title": "About Us",
        "url": "/pages/about-us",
        "type": "page",
        "resource_id": null,
        "position": 1,
        "links": []
      },
      {
        "id": "link_new002",
        "title": "Contact",
        "url": "/pages/contact",
        "type": "page",
        "resource_id": null,
        "position": 2,
        "links": []
      },
      {
        "id": "link_new003",
        "title": "Privacy Policy",
        "url": "/policies/privacy-policy",
        "type": "policy",
        "resource_id": null,
        "position": 3,
        "links": []
      }
    ],
    "created_at": "2024-03-20T10:00:00Z",
    "updated_at": "2024-03-20T10:00:00Z"
  }
}
Create a menu with dropdown items:
{
  "title": "Main Menu",
  "handle": "main-menu",
  "links": [
    {
      "title": "Shop",
      "url": "/collections/all",
      "type": "collection",
      "links": [
        {
          "title": "Men",
          "url": "/collections/men",
          "type": "collection"
        },
        {
          "title": "Women",
          "url": "/collections/women",
          "type": "collection"
        },
        {
          "title": "Sale",
          "url": "/collections/sale",
          "type": "collection"
        }
      ]
    }
  ]
}

Error Codes

CodeDescription
UNAUTHORIZEDInvalid or missing access token
FORBIDDENApp doesn’t have write_content scope
VALIDATION_ERRORInvalid request body (see error details)
DUPLICATE_HANDLEA menu with this handle already exists