---
search:
  tags:
    - Content
    - POST
seo:
  description: >-
    Creates a post in the shop's default blog, or in the blog given by blog_id
    (see… Reference for the POST /shops/{shop_id}/posts endpoint in the Bolder
    API v2.
sidebar:
  label: Create a post
  badge: POST
title: Create a post
type: openapi-operation
---
Creates a post in the shop's default blog, or in the blog given by `blog_id` (see
[List shop blogs](/api/v2/content/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`.

`POST /shops/{shop_id}/posts`

**cURL**

```bash
curl -s -X POST \
  -H "Authorization: Bearer $BOLDER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"title":"Winter Sale","body":"<p>Save big!</p>","published":true}' \
  "https://api.onbolder.com/v2/shops/1/posts"
```

**Request body** (`application/json`, required)

- `title` (string, required)
- `body` (string, required)
- `slug` (string) — Auto-generated from title if blank
- `description` (string)
- `short_description` (string)
- `published` (boolean)
- `published_on` (string<date-time>)
- `format` (string) — \`markdown\` is stored as is and rendered by the storefront.
- `blog_id` (integer) — Blog to publish in. Defaults to the shop's default blog. Must belong to this shop.
- `translation_of` (integer) — ID 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.

Request body example, A post:

```json
{
  "title": "Winter Sale",
  "body": "<p>Save big!</p>",
  "published": true
}
```

Request body example, A draft translation, in blocks format, in a Spanish blog:

```json
{
  "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
}
```

**Responses**

- `201` — Post created
- `422` — Validation error

Response example, 201:

```json
{
  "_links": {
    "property1": {
      "href": "string",
      "templated": true,
      "method": "get",
      "title": "string",
      "type": "string"
    },
    "property2": {
      "href": "string",
      "templated": true,
      "method": "get",
      "title": "string",
      "type": "string"
    }
  },
  "id": 0,
  "shop_id": 0,
  "title": "string",
  "slug": "string",
  "body": "string",
  "description": "string",
  "short_description": "string",
  "published": true,
  "published_on": "2019-08-24T14:15:22Z",
  "format": "html",
  "blog_id": 0,
  "translation_of": 0,
  "translation_lang": "string",
  "user_id": 0,
  "created_on": "2019-08-24T14:15:22Z",
  "updated_on": "2019-08-24T14:15:22Z",
  "path": "string",
  "url": "string"
}
```
