Quickstart
Create a workspace, issue an API key, and fetch your first post.
This walks you from zero to a working request. By the end you'll have a Workspace with a published post and a snippet that fetches it through the external API.
1. Create a workspace
Sign in to the Clog dashboard and click Create workspace. Pick a name and a slug (lowercase, dashes, globally unique). You become the workspace owner automatically.
A workspace is one blog. If you run several blogs, create one workspace per blog.
2. Write your first post
From the workspace, open Posts → New post. Give it a title, write a paragraph or two in the block editor, and click Publish. Note the slug Clog assigned — you'll fetch the post by it.
A post needs at least a title to publish. You can add a featured image, category, tags, and a full SEO meta group later — none of them are required for a first fetch.
Posts use three statuses in v1: draft, published, archived. Only published posts are visible to external readers by default. (scheduled exists in the schema but is rejected on writes until the cron worker ships.)
3. Issue an API key
Open API keys → New key. Give it a name (e.g. marketing-site-prod). Clog generates a plaintext key that starts with clog_live_ and shows it exactly once:
clog_live_AbCdEfGhIjKlMnOpQrStUvWxYz...Copy it now into your secret store. The dashboard's Reveal action can re-show it later, but the value never appears in lists or read responses.
An API key inherits its creator's permissions on the workspace. If that user is removed from the workspace, the key stops working — even though the ApiKey row still exists. For machine integrations, create keys from a dedicated service user.
4. Fetch your first post
The base URL is https://api.clog.dev for every Clog consumer. Replace clog_live_xxx with the key you just issued and my-first-post with the slug of your post.
curl https://api.clog.dev/api/v1/external/posts/my-first-post \
-H "X-API-Key: clog_live_xxx"const res = await fetch(
'https://api.clog.dev/api/v1/external/posts/my-first-post',
{ headers: { 'X-API-Key': process.env.CLOG_API_KEY! } },
);
if (!res.ok) throw new Error(`Clog: ${res.status}`);
const post = await res.json();
console.log(post.title, post.bodyJson.length, 'blocks');The response is a full PostResponse: the block body, the embedded author / category / featuredMedia / tags, the SEO meta group, and a pre-assembled jsonLd. See Posts → Get post for the complete shape.
5. List published posts
To pull a page of posts (for an index page or RSS-like feed):
curl 'https://api.clog.dev/api/v1/external/posts?status=published&page=1&pageSize=10&order=desc&orderBy=publishedAt' \
-H "X-API-Key: clog_live_xxx"The response is a PaginatedResponse<PostResponse>:
{
"data": [ /* PostResponse[] */ ],
"page": 1,
"pageSize": 10,
"order": "desc",
"orderBy": "publishedAt",
"total": 42,
"totalPages": 5
}See API → Conventions for the full envelope, the supported sort keys, and the per-endpoint filter list.
What's next
- API → Authenticating requests — keep your key safe in production.
- API → Rendering content — turn a
bodyJsonarray into actual HTML/JSX. - API → SEO and JSON-LD — stamp the
jsonLdpayload into your<head>. - Examples → Next.js — a worked App Router integration.