Search documentation

Find pages, sections, and snippets across the Clog docs.

API integration

Pull a workspace's content into your own frontend through the external JSON API.

The external API is the surface your application integrates against. It mirrors Clog's content modules — posts, pages, categories, tags, authors, media — plus the operational helpers for redirects, broken-link reporting, the workspace brand profile, and sitemap data.

Every request is authenticated with a workspace-bound API key in the X-API-Key header. The workspace is implicit from the key, so routes are flat: /api/v1/external/posts, not /api/v1/external/workspaces/:id/posts.

Read this section in order

  1. Authenticating requests — the X-API-Key header, how keys map to permissions, error semantics.
  2. Conventions — base URL, pagination envelope, ordering, filtering, error envelope, idOrSlug.
  3. Rendering content — turn a post's block array into rendered output, handle inline Markdown, resolve images.
  4. SEO and JSON-LD — the seo meta group, the structuredData / structuredBlocks / jsonLd trifecta, stamping <script type="application/ld+json">.
  5. Redirects and link health — sync the redirect table to your edge, POST 404s back.
  6. Endpoint reference — every endpoint, parameter, and response schema, generated from the OpenAPI spec.

Worked examples live under Examples — start with the Next.js App Router walkthrough, then the framework-agnostic fetch / curl recipes.

On this page