Create a post
Creates a post in the shop’s default blog, or in the blog given by blog_id (see
List shop blogs).
To publish a translation, create it in a blog of another language and set translation_of to the
original post’s ID: its translation_lang is taken from that blog. An original post can have only one
translation per language, and a translation can’t itself be translated.
format: blocks takes an EditorJS JSON document, serialized as a string, in body.
/shops/{shop_id}/postsAuthorizationBearer token (JWT) · headerrequiredshop_idintegerrequiredapplication/jsontitlestringrequiredbodystringrequiredslugstringAuto-generated from title if blank
descriptionstringshort_descriptionstringpublishedbooleanpublished_onstring<date-time>formatstringmarkdown is stored as is and rendered by the storefront.
htmlblocksmarkdownblog_idintegerBlog to publish in. Defaults to the shop's default blog. Must belong to this shop.
translation_ofintegerID of the post this one translates. The post must belong to this shop, not be a translation itself, and the blog must have a language different from the original's.
{
"title": "Winter Sale",
"body": "<p>Save big!</p>",
"published": true
}{
"title": "Venta de invierno",
"format": "blocks",
"body": "{\"time\":1767225600000,\"blocks\":[{\"type\":\"paragraph\",\"data\":{\"text\":\"¡Ahorra en grande!\"}}]}",
"blog_id": 2,
"translation_of": 41,
"published": false
}Post created
_linksHalLinksidintegershop_idintegertitlestringslugstringbodystringdescriptionstringshort_descriptionstringpublishedbooleanThere is no status field — this is a boolean.
published_onstring<date-time>formatstringblocks means body is an EditorJS JSON document (as a string).
htmlblocksblog_idintegerThe blog this post lives in. A shop can have several blogs, each with its own language; new posts go to the shop's default blog unless blog_id is given.
translation_ofinteger | nullID of the original post when this post is a translation of it; null for an original post.
translation_langstring | nullLanguage of this translation (the language of its blog, e.g. es); null for an original post.
user_idintegercreated_onstring<date-time>updated_onstring<date-time>pathstringPath of the post on the storefront, e.g. /blog/2024/3/15/hello (/es/blog/... for a blog in another language than the shop's).
urlstring | nullFull storefront URL of the post. Unpublished posts end in ?preview=1.
Validation error