Import a post from Markdown or MDX
Creates a blog post from a Markdown or MDX document with front matter. Send JSON, the raw document (text/markdown, at most 5 MB by default), or a multipart upload with the file and its images.
Images: featuredImage in the front matter and every image in the body may be an https:// URL (fetched, at most 15 MB by default), a library image’s slug, a filename posted with the file (image, up to 10), or generate: <description> with generateImages (at most 4 per import).
Media on an API key: a new image (a URL, a posted file or generate:) needs content:images:write, a new video content:videos:write and content:videos:publish; a library slug needs content:images:read / content:videos:read. The blog scopes don’t cover media, and the refusal names the missing scope.
Publishing: publish=true publishes only when the caller may (a key needs content:blog:publish); otherwise the post is saved as a draft. An MDX import is always a draft.
Removing an import: delete the post by the draft _id the import answered. On an API key that needs content:blog:delete.
Access: an API key with content:blog:write, or content:blog:all, or content:all, or admin:all, or a signed-in user holding the blog:import-markdown permission. Other callers get 403.
Rate limit: the key’s own writes-per-minute limit, set when the key is created (default 120), and 30 imports and validations a minute per caller: whichever runs out first answers 429 with Retry-After.
Authorizations
Query Parameters
Body
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>.
"---\ntitle: \"Our spring update\"\nexcerpt: \"What changed this season.\"\n---\n\n## What’s new\n\nThe body, in Markdown.\n"