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
- Authenticating requests — the
X-API-Keyheader, how keys map to permissions, error semantics. - Conventions — base URL, pagination envelope, ordering, filtering, error envelope,
idOrSlug. - Rendering content — turn a post's block array into rendered output, handle inline Markdown, resolve images.
- SEO and JSON-LD — the
seometa group, thestructuredData/structuredBlocks/jsonLdtrifecta, stamping<script type="application/ld+json">. - Redirects and link health — sync the redirect table to your edge, POST 404s back.
- 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.