Skip to content

Content API

A REST API for everything Postpiece publishes.

The Postpiece REST API is a Cloudflare Workers service for reading and managing content: sites, posts, pages, media, redirects, menus, and webhooks. Authenticate with a bearer API key and integrate from any language.

Call it from anything

The Postpiece API speaks plain HTTP + JSON, so any language works. Authenticate with a bearer key, hit api.postpiece.com/api/v1, and read or write content programmatically.

curl

# List published posts for a site
curl -H "Authorization: Bearer $POSTPIECE_KEY" \
  https://api.postpiece.com/api/v1/sites/myblog/posts

# Create a draft
curl -X POST https://api.postpiece.com/api/v1/sites/myblog/posts \
  -H "Authorization: Bearer $POSTPIECE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "title": "Hello", "contentMarkdown": "# Hi there" }'

Read content with the typed SDK

The official postpiece npm package is a typed delivery client for reading your content — posts, pages, media, and taxonomy — in TypeScript apps and frontends.

postpiece (npm)

import { createClient } from "postpiece"

const client = createClient({
  apiKey: process.env.POSTPIECE_KEY,
  siteId: "myblog",
})

// Typed content delivery
const posts = await client.posts.list({ limit: 10 })
const post = await client.posts.get("launch-day")

What the API covers

Complete content surface

Every content type is a REST resource: sites, posts, pages, media, authors, categories, tags, redirects, menus, and webhooks. Predictable URLs, JSON in and out.

Bearer-key auth

Authenticate with a per-site bearer API key from the dashboard. Scope keys per site, rotate them anytime, and audit usage.

Markdown or structured

Write posts as Markdown and Postpiece converts to structured Portable Text — or send Portable Text directly for full control over blocks.

Edge-native

Runs on Cloudflare Workers at the edge, close to your agents and readers. No servers to run, no cold starts to manage.

Typed SDK

The official postpiece npm package is a typed delivery client, so TypeScript frontends and apps read content with autocomplete and compile-time safety.

Webhooks

Register webhooks to react to publishes, updates, and deletions — wire Postpiece into your CI, cache, or notification flows.

Explore the platform

Build on the Postpiece API.

Free to start · No credit card required · Deploy on Cloudflare