Navigation API Reference
Endpoint reference for the admin and storefront navigation menu — contracts, error codes, and integration rules.
Navigation Module — API Reference
Audience: Admin and storefront engineers integrating with the navigation menu.
All endpoints are prefixed with /api. Admin endpoints need a JWT and the listed permission. The storefront endpoint is public and IP-throttled.
Route Surfaces
| Surface | Base Path | Auth |
|---|---|---|
| Admin | /api/admin/navigation | JWT + Navigation_READ / Navigation_UPDATE |
| Storefront (mobile prefix) | /api/mobile/navigation | None (@Public()), RATE_LIMITS.PUBLIC_HIGH_FREQUENCY (300 per 60 s per IP) |
Endpoint Reference
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /api/admin/navigation | Navigation_READ | The stored menu with live targetStatus per row |
| PUT | /api/admin/navigation | Navigation_UPDATE | Replace the whole menu; requires the last-read version |
| GET | /api/mobile/navigation | None | The served menu: filtered, with slugs and expanded auto children |
Wire Enums
| Name | Values |
|---|---|
NavTargetKind | system, category, brand, series, url |
NavSystemKey | all_products, brands, sale |
NavChildrenMode | none, auto, manual |
NavTargetStatus (admin response only) | ok, hidden, deleted, invalid |
System default labels: all_products is "All Products", brands is "Brands", sale is "On Sale".
Key Contracts
GET /api/admin/navigation
{
"message": "Navigation fetched successfully",
"errorCode": null,
"data": {
"version": 1,
"updatedAt": "2026-10-12T10:00:00.000Z",
"items": [
{
"publicId": "01a12f89-4b69-7bba-b90b-de9c359ee97c",
"label": null,
"displayLabel": "All Products",
"isEnabled": true,
"targetKind": "system",
"systemKey": "all_products",
"categoryPublicId": null,
"brandPublicId": null,
"seriesPublicId": null,
"url": null,
"childrenMode": "none",
"children": [],
"targetName": null,
"targetStatus": "ok",
"targetStatusReason": null
}
]
}
}labelis the stored value;displayLabelislabel, else the live target name, else the system default.targetNameis "Root › Child" for depth-1 categories and "Brand › Series" for series.targetStatusReasonis non-null exactly whentargetStatusis notok.childrenholds stored manual children only. Auto children are not materialised here (everyautorow returnschildren: []).- Child rows always have
childrenMode: "none". - Ids are UUIDv7. Without a token the endpoint answers
401 AUTH_UNAUTHENTICATED.
PUT /api/admin/navigation
Request:
{
"version": 1,
"items": [
{
"label": null,
"isEnabled": true,
"targetKind": "system",
"systemKey": "all_products",
"categoryPublicId": null,
"brandPublicId": null,
"seriesPublicId": null,
"url": null,
"childrenMode": "none",
"children": []
},
{
"label": "Deals",
"isEnabled": true,
"targetKind": "url",
"systemKey": null,
"categoryPublicId": null,
"brandPublicId": null,
"seriesPublicId": null,
"url": "/sale",
"childrenMode": "manual",
"children": [
{
"label": "Clearance",
"isEnabled": true,
"targetKind": "url",
"systemKey": null,
"categoryPublicId": null,
"brandPublicId": null,
"seriesPublicId": null,
"url": "https://example.com/clearance"
}
]
}
]
}(The menu must also contain the brands and sale system items; this example is shortened.)
Request rules:
version: integer, at least 1.items: 1 to 16 entries. Each item haschildrenof at most 30 entries.- Every key is required on every item; use explicit
nullfor unused target fields. A child has nochildrenModeand nochildrenkey; sending one is rejected. label:nullor a string of 1 to 40 characters (after trim and NFC), with no control or format characters. Required forurltargets.url: a site-relative path starting with a single/, or an absolutehttps:URL with no credentials, at most 2048 characters. Absolute URLs are stored in normalised form.childrenMode: "auto"is valid only onbrandtargets and depth-0categorytargets.childrenmust be[]unlesschildrenModeismanual.- Manual children may be
category,brand,seriesorurltargets (notsystem). The globalValidationPiperuns withwhitelist: trueandforbidNonWhitelisted: true, so any key not declared on the DTO, including the brand and series keys older admin builds sent on category rows, is rejected with a 400. - The whole menu has at most 200 rows.
Success: 200 with the same envelope as GET, message "Navigation updated successfully", and the new version (previous plus 1). Item publicIds are new.
409 response (stale version, confirmed live):
{
"message": "The navigation was saved elsewhere since you loaded it. Reload to see the latest.",
"errorCode": "NAVIGATION_VERSION_CONFLICT"
}400 response with rule violations (shape):
{
"message": "The navigation has 2 problems.",
"errorCode": "NAVIGATION_TARGET_NOT_FOUND",
"details": {
"violations": [
{
"path": "items[3]",
"code": "NAVIGATION_TARGET_NOT_FOUND",
"message": "..."
},
{
"path": "items[4].children[0]",
"code": "NAVIGATION_TARGET_INVALID",
"message": "..."
}
]
}
}errorCode is the code of the first violation. path is items[i], items[i].children[j], or items for menu-level rules (missing or duplicate system keys, row limit). A body that fails DTO validation returns the standard validation 400 with no NAVIGATION_* code and no details.violations.
GET /api/mobile/navigation
{
"message": "Navigation fetched successfully",
"errorCode": null,
"data": {
"items": [
{
"id": "01a12f89-4b69-7bba-b90b-de9c359ee97c",
"label": "All Products",
"target": {
"kind": "system",
"systemKey": "all_products",
"categorySlug": null,
"parentCategorySlug": null,
"brandSlug": null,
"seriesSlug": null,
"url": null
},
"children": []
}
]
}
}labelis always resolved and never empty.parentCategorySlugis non-null only for depth-1 categories.- For a
seriestarget,brandSlugis the owning brand. - Auto children are materialised, with the target entity's
publicIdasid. Children havechildren: []. data.itemsmay be[]if everything is disabled.
Error Reference
| Code | HTTP | Meaning |
|---|---|---|
NAVIGATION_VERSION_CONFLICT | 409 | Saved elsewhere since load; reload and reapply |
NAVIGATION_TARGET_INVALID | 400 | A shape, label, URL, depth or consistency rule failed |
NAVIGATION_TARGET_NOT_FOUND | 400 | Referenced category, brand or series is missing, soft-deleted or has no current slug |
NAVIGATION_SYSTEM_ITEMS_INVALID | 400 | System items missing, duplicated or nested |
NAVIGATION_LIMIT_EXCEEDED | 400 | More than 200 rows |
NAVIGATION_MENU_MISSING | 500 | The header menu row is absent (integrity fault; accepted per the frozen contract) |
AUTH_UNAUTHENTICATED | 401 | Missing or invalid token on an admin route |
NAVIGATION_MENU_OVERFLOW | 500 | Admin GET, or the PUT's before or after snapshot, found more than 200 rows (integrity fault; message "The menu has more items than the editor can safely load. Contact an engineer.") |
SYS_TRANSACTION_CONFLICT | 409 | PUT kept hitting serialization failures or deadlocks and the retries were exhausted; retry and keep your edits (the message is "The change conflicted with another update. Please retry.") |
Integration Notes
- Hrefs are the storefront's job. The API returns slugs; the storefront builds
/categories/<slug>,/categories/<parent>/<child>,/brands/<brand>, and/brands/<brand>?series=<series>. Category links carry no query string. - The storefront groups a dropdown's children by target kind: category children under "Shop by category", brand and series under "Shop by brand", url under "More", in that order, with no headings when only one group is non-empty. The response shape is unchanged.
- The storefront fetch is cached for 3600 s under the tag
navigationonly. Menu saves and category, brand and series writes purge it. - On any failed read the storefront renders a three-link fallback (All Products, Brands, On Sale).
- The admin invalidates the storefront after a save with the
navigation.changedevent;category.changed,brand.changedandbrand-series.changedalso carry thenavigationtag. - A role given
Navigation_UPDATEalso needsCategories_READ,Brands_READandBrandSeries_READfor the pickers.
Guardrail Summary
- Always send the
versionyou last read, and adopt the returnedversionand ids after a save. - Never cache the admin read; the
targetStatusvalues are live. - Never build a storefront link from a name; use the served slugs.
- Never nest below two levels or put a system item anywhere but the top level.
- Treat a validation 400 without a
NAVIGATION_*code as a client defect.
See Also
- Feature doc: /docs/developer/navigation/feature
- Backend doc: /docs/developer/navigation/backend
Navigation Backend Architecture
Internal architecture of the navigation module — composition, data model, invariants, configuration, and deploy order.
Home Bento Dynamic Feature Guide
The seven-card homepage hero bento driven by placements home_bento_1..7, with the operator runbook, deploy steps, safety guards, and known follow-ups.