Fetching the KB structure

The knowledge base structure endpoint gives you a complete overview of your help center in a single call. It returns all articles and collections, along with metadata and a base URL you can use to build canonical links. This is the starting point if you want to render navigation, display content, or sync your KB into another system.

Endpoint

GET /knowledge/structure

Authentication

You must include your API key in the X-Api-Key header. Without it, the request will fail with a 401 Unauthorized error.

curl -H "X-Api-Key: sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ https://api.getfernand.com/knowledge/structure

Response

The response includes three top-level keys:

  • articles
    an object where each key is an article ID and the value is the article metadata

  • collections
    an object where each key is a collection ID and the value is the collection metadata

  • base_url
    the canonical base URL for linking to your knowledge base

Article fields

Each article entry contains:

  • id: numeric identifier

  • uuid: globally unique identifier

  • title: article title

  • seo_title: SEO-friendly title

  • slug: URL slug

  • description: optional description

  • created and last_updated: ISO 8601 timestamps

  • published: boolean indicating visibility

Collection fields

Each collection entry contains:

  • id: numeric identifier

  • title: collection name

  • slug: URL slug

  • description: optional description

  • parent_id: ID of the parent collection if nested

  • articles: array of article IDs belonging to the collection

  • sort: integer used for ordering

Example

Here’s a trimmed-down example of the structure response (with placeholder values for clarity):

{ "articles":
    { "101":
        { "id": 101,
          "uuid": "123e4567-e89b-12d3-a456-426614174000",
          "title": "Sample article",
          "slug": "sample-article",
          "seo_title": "Sample article",
          "description": "A sample article",
          "created": "2023-01-01T10:00:00Z",
          "last_updated": "2023-01-10T12:00:00Z",
          "published": true }
        },
 "collections": {
    "10":
      { "id": 10,
        "title": "Getting started",
        "slug": "getting-started",
        "description": "Introductory guides",
        "parent_id": null,
        "articles": [101],
        "sort": 1 }
      },
 "base_url": "https://help.yourdomain.com"}

Next steps

After fetching the structure, you can load individual articles with GET /knowledge/articles/{id} or update them with OPTIONS /knowledge/articles/{id}.

Was this helpful?