Create a blog post
Authorizations
A secret API key. Publishable keys cannot reach this API. A key may carry an expiry, and an expired key is refused exactly like an unknown one, with a 401 that names no reason; check the key's expires_at in the dashboard rather than inferring it from a response. When a merchant rolls a key's secret they choose a grace window of up to 3 days, and for its duration BOTH the new secret and the one it replaced authenticate, so an integration moves over on its own deploy schedule instead of at the instant the button is pressed. Move before the window closes: after it, the old secret is refused. Nothing else about this contract moves with a roll. The key keeps its id and its scopes, so the only thing an integration updates is the credential itself.
Headers
A unique key per logical write. Replaying a request with the same key returns the first response byte for byte instead of applying the write twice.
Body
EVERY post created here lands as a DRAFT, and status is not settable: publishing puts an article on the storefront and into the feed of every key holding read_blogs immediately, with no review step, so it is a second deliberate act at POST /blog-posts/{postId}/publish. A body carrying "status" is refused rather than ignored, because a 201 that quietly dropped it would leave the client believing an article is live that no reader can reach. The slug must be unique in the store; a taken slug is 409, which is what makes a create replayed outside the idempotency window safe. scheduled_publish_at is refused: the column exists and NOTHING reads it, so a value there would be a countdown that never fires.
The storefront path segment. Unique per store.
A ProseMirror JSON document, NOT html and not a string. It is stored byte for byte after a size check: there is no node allowlist, no mark allowlist and no URL scheme check inside it, so anything rendering it must apply its own.
An absolute http(s) url under 2048 characters.
Merchant-supplied. Nothing computes it.
A blog category in this store. An id from another store is a 400 rather than a filed post.
Response
Created
