Skip to main content
POST
cURL

Authorizations

Authorization
string
header
required

Paste your API key as the CMS showed it: fsk_<site>_<key id>_<secret> (issued under API Keys). ApiKey in front of it works too. Leave it empty to read as the public.

Scopes

content:blog:write

Query Parameters

format
enum<string>

Read a raw or JSON body as mdx.

Available options:
md,
mdx
publish
boolean

The same as the body’s publish.

generateImages
boolean

The same as the body’s generateImages.

_ai
boolean

The same as the body’s _ai.

Body

markdown
string
required

The whole document: YAML front matter between --- lines, then the Markdown body. title is the one required front matter key; slug, publishedAt, authorName (or authorEmail), category, excerpt, featuredImage (+ featuredImageAlt), seoTitle, seoDescription and splitDepth are optional (the Markdown template, getBlogMarkdownTemplate, names every key). Body headings start at ##: the title is the post’s only <h1>.

Example:

"---\ntitle: \"Our spring update\"\nexcerpt: \"What changed this season.\"\n---\n\n## What’s new\n\nThe body, in Markdown.\n"

format
enum<string>
default:md

How to read markdown: plain Markdown (md) or MDX (mdx).

Available options:
md,
mdx
publish
boolean
default:false

Publish the post when the caller may; otherwise (and by default) it is saved as a draft.

generateImages
boolean
default:false

Allow generate: image references (needs content:blog:generate-image on an API key). An import that generates images must finish them within 600 seconds, or it stops and leaves nothing behind (422 deadline).

_ai
boolean
default:false

Mark the post (and its generated images) as AI-written in its version history.

Response

The new post.

_id
string
required
type
string
required
Example:

"@apostrophecms/blog"

title
string
required
slug
string
required
published
boolean
required

False when it was saved as a draft.

_url
string

The post’s page.