How to automate your blog publishing on Lykhari
Most of the work on this app has gone into a plain, distraction free editor. But a few of you have asked for a way to publish without opening the dashboard at all, from a script, a cron job, or an AI you're already using to draft. That's live now: a proper API.
This post covers what it does, how to set it up, and the ways people are actually using it.
What the API lets you do
Once you have a token, you can do everything you'd normally do from the dashboard, from outside it:
- Create a post —
POST /api/posts, send a title, a type (post, page, or category), a status (draft, published, unpublished, or scheduled), and markdown for the body. - Read a post —
GET /api/posts/{id}, with an optional?format=markdownif you want plain text back instead of the structured JSON. - List posts —
GET /api/posts, filterable by type, status, whether it's pinned, or category. - Update a post —
PUT /api/posts/{id}, send only the fields you want to change. Everything else stays as is.
Posts are stored internally as structured content, but the API accepts markdown in and can hand markdown back out, so you never have to think about the internal format.
Deleting a post still requires the dashboard. That's deliberate, a script with a bad loop shouldn't be able to wipe your blog.
Getting a token
It's a pro feature. In settings, generate a personal access token. It's shown once, so copy it somewhere safe right away, you can't view it again after. Requests authenticate with a standard header:
Authorization: Bearer lykh_your_token_here
One active token per account at a time.
A basic example
curl -X POST https://yourblog.lykhari.com/api/posts \
-H "Authorization: Bearer lykh_your_token_here" \
-H "Content-Type: application/json" \
-d '{
"title": "Notes from a slow Tuesday",
"type": "POST",
"status": "DRAFT",
"markdown": "# Notes from a slow Tuesday\n\nSome thoughts on..."
}'
That creates a draft. Flip status to PUBLISHED when you're ready, either in that same call or with a follow up PUT.
Publishing with AI
This is the use case that pushed me to build it. A lot of people draft posts in Claude or ChatGPT, then copy the result out of the chat window and paste it into an editor by hand. If you're using a tool that can actually make an HTTP request on your behalf, an AI coding agent, a custom GPT action, a small script an assistant writes and runs for you, you can skip that step entirely. Hand it your token, describe what you want written, and ask it to publish straight to your blog.
Concretely, that might look like asking an agent: "write a short post about the book I just finished and publish it as a draft on my Lykhari blog." It writes the markdown, sends the POST /api/posts request, and the draft is waiting for you when you open the dashboard to read it over before publishing.
It's worth being precise here: this works with tools that can execute code or call external APIs, not a plain chat box with no tool access. If your AI setup can run a script or hit a URL, it can publish to Lykhari.
Other ways to use it
A few use cases beyond the AI angle:
- Weekly roundups. A cron job that pulls together links or notes from the week and posts a draft every Sunday night, so it's ready for you to review Monday morning.
- Writing from your own tools. If you write in Obsidian, a plain text file, or anywhere else, a small script can push the current file to Lykhari as a draft whenever you save it.
- Scheduled publishing. Write a batch of posts ahead of time and set them to publish on a schedule instead of manually hitting publish on each one.
- Migrating from another platform. If you're moving from Substack, Ghost, or Medium, a script can loop through your export and create the posts on Lykhari in one pass instead of pasting each one by hand.
- Read-only pulls. The list and read endpoints work fine for something like a personal dashboard that shows your recent posts, without needing write access at all.
Some limits, on purpose
New posts are capped at 10 per day per token. That's high enough for any real workflow and low enough to catch a runaway script before it does damage. Reads and updates are unlimited. Deletion stays dashboard-only, as mentioned above.
Try it
Full docs, including all the fields and filters, are here: https://blog.lykhari.com/api-docs
It's part of the pro plan, same tier as custom domains and reader emails. If you build something with it, I'd like to hear about it, and if you hit a rough edge, tell me, this is fresh enough that I expect a few.