Introducing the Pagecord API π
The Pagecord API is now live! If you're a Pagecord Premium customer (or on a free trial), you can now manage your posts and pages programmatically. Or just have your AI agents do it for you! π€
Why might I need this?
The primary use case for the API is writing of posts in another system and syncing them to Pagecord. For example:
- Write in Obsidian and publish with a single command using the Pagecord Obsidian plugin
- Upload posts from your existing blog when migrating to Pagecord
What can the API do?
The API allows you to:
- Create, read, update and delete posts and pages β including setting titles, slugs, tags, status, visibility and publication dates
- Manage your home page β create, update or unlink it
- Upload images, video and audio β and embed them in your posts
The API accepts both HTML and Markdown. If you write in Markdown (e.g. in Obsidian), you can include YAML frontmatter for metadata like tags, slug and status.
How do I try it?
Head to Settings β API in your dashboard to generate an API key which enables the API on your blog. You can then make requests to the Pagecord API endpoint with your key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Here's a quick example using curl to create a post with Markdown:
curl -X POST https://api.pagecord.com/posts \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Hello from the API",
"content": "This post was created via the **Pagecord API**.",
"content_format": "markdown",
"status": "published"
}'
Images, video and audio work too β upload files via the attachments endpoint and embed them in your content. The API docs have the full details.
Rate limits and details
The API allows 60 requests per minute per blog, which should be plenty for most use cases. Deleting a post sends it to the trash rather than removing it permanently β same as in the UI.
Full documentation with all endpoints, parameters and examples is in the new API help guide.
The API is available to all Pagecord Premium subscribers. If you're not on Premium yet, now is a great time to upgrade! πβοΈ