API Documentation

Everything you need to create blog posts via the OpenPress API

1Generate Your API Key

Navigate to Dashboard > API Keys and click Regenerate key. Copy the key immediately — it will only be displayed once.
Store your API key securely. Never expose it in client-side code, public repositories, or logs. Regenerating will invalidate the previous key.

2Test Authentication

Create a minimal draft post to verify your key works:
curl -X POST "https://your-site.com/api/posts" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer op_your_api_key_here" \
  -d '{ "title": "Test Post" }'
bash
A 201 Created response with the full post object means you're set up correctly.

3Publish a Post

Set status to "published" to make the post immediately visible:
curl -X POST "https://your-site.com/api/posts" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer op_your_api_key_here" \
  -d '{
    "title": "Hello from the API",
    "content_html": "<p>This post was published via the OpenPress API.</p>",
    "status": "published"
  }'
bash

4Verify

Fetch the list of published posts (no auth needed):
curl "https://your-site.com/api/posts?limit=1"
bash