docs · api
EN
API documentation · v1.0.0

The DraftIn public API

DraftIn is a headless CMS for people who write. You model the content, write in the editor and publish — and the public API delivers that already-published content to any front-end: an Astro or Next.js site, a native app, a newsletter or a revalidation webhook.

This is the official reference for the platform's public layer: the content-read interface that customer sites consume using an API key. All of the documentation that follows covers only the endpoints meant for consumption by third-party applications — nothing about the panel's internal administration.

In 30 seconds

Every request points to the production base URL and carries your key in the X-API-Key header. Here's how to list a blog's three most recent posts:

curl https://api.draftin.io/public/posts?limit=3 \
  -H "X-API-Key: $DRAFTIN_API_KEY"

The response is a JSON envelope { success, data }, with the array of Post objects in data. From there, render it however you like — DraftIn imposes no theme or presentation layer.

Where to start

If this is your first integration, follow this path:

API principles

  • REST over HTTPS. Predictable paths, standard HTTP verbs and JSON responses.
  • Scoped per blog. Each API key belongs to one blog and only sees that blog's content.
  • Published content only. Public endpoints return only items with status PUBLISHED — drafts and scheduled items never leak.
  • No session state. There's no login or cookies: authentication is by key on every request.
  • Enveloped responses. Successes come as { success, data, meta? } and errors as { success: false, error } with a stable code — see Response format.