I Built a Headless Blog System — and an AI Agent Wrote This Post

Technology March 14, 2026 4 min read 52 views

This post was written and published by an AI agent. Not copy-pasted into a form. Not manually uploaded. An AI agent hit an API endpoint, sent a JSON payload, and this post appeared on my blog. That's the whole point of what I just built.

The Problem with Traditional Blogging

I've always found the standard blogging workflow annoying. Log into WordPress, navigate the admin panel, paste content into a WYSIWYG editor, fiddle with categories and tags, hit publish. It's fine if you're writing once a week, but I wanted something different — I wanted to be able to tell an AI to post something and have it just happen.

So I built a headless blog system into my Laravel 12 portfolio site. No admin editor. No rich text fields. Just a clean REST API that accepts a JSON payload with a title, HTML content, tags, and a status flag. Authenticate with a bearer token, POST to the endpoint, and you're live.

How It Works

The architecture is straightforward:

  • Token-authenticated REST API — a single bearer token in the Authorization header. No OAuth complexity, no user accounts for posting. Just a shared secret between me and whatever agent I'm using.
  • Categories and tags — posts can be assigned to categories (Technology, AI, Finance, etc.) and tagged with any number of labels. Tags are created automatically if they don't exist yet.
  • Draft/Published/Scheduled statuses — posts land as drafts by default. Set the status to "published" with a timestamp and they go live instantly.
  • CMS management page — I can log into my CMS, see all posts, proofread them with full rendered HTML preview, and change the status, publish date, or category without touching the API.
  • Search with snippet highlighting — the public blog has a fast search that highlights matching sentences and surfaces related projects from my portfolio.

Why Headless?

Because the future of content creation isn't sitting in a browser tab typing into a form. It's having a conversation with an AI, refining an idea, and then telling the agent: "Post that to my blog." The agent formats the HTML, picks the right tags, sets the publish date, and fires off the API call. I just review and approve.

This approach also means I can post from anywhere — a GPT custom action, a Claude tool, a simple curl command, a custom form, or even a scheduled task. The blog doesn't care where the content comes from. It just needs valid JSON and a token.

The Meta Moment

Here's where it gets fun: this very post was written and published by the same AI agent that helped me build the system. Claude wrote the code, reviewed it for N+1 queries and route mismatches, committed it to git, and then used the API it just built to publish this article. Inception-level stuff.

If you're building a personal site or portfolio and you want the flexibility to post from AI agents, automated workflows, or just a quick curl command — consider going headless. The traditional CMS admin panel had its moment. The API-first approach is just more fun.