Brandfine Docs
REST API

GET /external/navigations/:key

Workspace navigation by key, with POST items pre-resolved per locale.

GET /external/navigations/header
X-Api-Key: bk_live_xxx

Returns the navigation identified by :key (e.g. 'header', 'footer-services'). Items are nested via parentId — top-level items have parentId: null.

Item types

TypeRenders asRequired fields
CUSTOM_URL<a href="...">customUrl, labels
POST<a href="<computed>">post, optional labels
HEADINGnon-link label (dropdown title, footer column header)labels, may have children

POST items are pre-resolved — the post.locales array contains the per-locale slug+title for every published translation.

Every item (any type) may also carry:

  • imageUrl — optional image URL (icon, thumbnail, mega-menu art). Not per-locale. null when unset.
  • customConfig — free-form JSON the consumer interprets (badges, layout hints, flags). Round-tripped untouched, same contract as a post's customConfig. null when unset.

Response

{
  "key": "header",
  "name": "Main Header",
  "items": [
    {
      "id": "i_1",
      "parentId": null,
      "position": 0,
      "type": "HEADING",
      "customUrl": null,
      "imageUrl": null,
      "customConfig": null,
      "labels": { "en": "Get My Visa", "pt": "Obter o meu visto" },
      "hiddenLocales": [],
      "post": null
    },
    {
      "id": "i_2",
      "parentId": "i_1",
      "position": 0,
      "type": "POST",
      "customUrl": null,
      "imageUrl": "https://cdn.brandfine.co/assets/.../flag-eu.svg",
      "customConfig": { "badge": "popular" },
      "labels": null,
      "hiddenLocales": [],
      "post": {
        "id": "p_2N4r",
        "canonicalSlug": "schengen-visa",
        "postTypeId": "pt_services",
        "postTypeSlug": "services",
        "locales": [
          { "locale": "en", "slug": "schengen-visa", "title": "Schengen Visa" },
          { "locale": "pt", "slug": "visto-schengen", "title": "Visto Schengen" }
        ]
      }
    }
  ]
}

404 when no navigation with that key exists.

SDK

const nav = await bf.navigations.get('header')
// → BrandfineNavigation | null (null on 404)

// Optionally type each item's customConfig:
type NavConfig = { badge?: string }
const nav2 = await bf.navigations.get<NavConfig>('header')
// nav2.items[n].customConfig is NavConfig | null

For rendering, pass through the SDK's resolver to get a ready-to-render tree:

import { resolveNavigation } from '@brandfine/client/resolvers'

const hydrated = resolveNavigation(nav!, 'pt', { defaultLocale: 'en' })
// hydrated.items: [{ href, label, type, imageUrl, customConfig, children }, ...]

See SDK → Resolvers.

On this page