---
title: "Publishes the staged body."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.sherpo.io/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Sherpo merchant API › file

`POST /v1/stores/{store}/{kind}/{id}/body/publish`

## Authentication

- `bearer`, http, header `Authorization`, scopes: `file:write`

## Path parameters

- `store` (`publishBody.path.store`; string, required) — The store's id.
- `kind` (`publishBody.path.kind`; string, required) — The target's kind, in the plural.
  - minLength 1
- `id` (`publishBody.path.id`; string, required)
  - minLength 1

## Header parameters

- `Idempotency-Key` (`publishBody.header.Idempotency-Key`; string, optional) — Repeats within 24 hours answer the first result; the same key with other arguments is a conflict.
  - minLength 1; maxLength 255; pattern `^[\x21-\x7E]+$`

## Request body

_Required._

- `from` (`publishBody.from`; object, required) — The staged body's `asset.id` the caller saw, never its `attachment.id`.
  - `id` (`publishBody.from.id`; string, required)
    - minLength 1; maxLength 512
- `full` (`publishBody.full`; boolean, optional) — Answers the texts, attachments and file lists the short answer leaves out.
- `live` (`publishBody.live`; any of, optional) — The live body's `asset.id` the caller loaded, never its `attachment.id`; null when there was none. A publish over one replaced since is refused.
  - any of: `object`, `null`

## Example request

```json
{
  "from": {
    "id": "string"
  },
  "full": true,
  "live": {
    "id": "string"
  }
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.sherpo.io/merchant/v1/stores/<store>/<kind>/<id>/body/publish' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "from": {
    "id": "string"
  },
  "full": true,
  "live": {
    "id": "string"
  }
}
'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/merchant/v1/stores/<store>/<kind>/<id>/body/publish';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({from: {id: 'string'}, full: true, live: {id: 'string'}})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sherpo.io/merchant/v1/stores/<store>/<kind>/<id>/body/publish"

payload = {
    "from": { "id": "string" },
    "full": True,
    "live": { "id": "string" }
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Publishes the staged body.

#### Example

```json
{
  "attachment": {
    "id": "string"
  },
  "asset": {
    "id": "string"
  },
  "created": [
    {
      "id": "string",
      "role": "string",
      "asset": {
        "id": "string"
      }
    }
  ],
  "attachments": [
    {
      "id": "string",
      "target": {
        "kind": "string",
        "id": "string"
      },
      "role": "string",
      "delivery": "string",
      "preview_only": true,
      "from_body": true,
      "release_file": true,
      "position": 0,
      "asset": {
        "id": "string",
        "locator": "string",
        "origin": "string",
        "custodian": "string",
        "enforcement": "string",
        "mime": "string",
        "bytes": 0,
        "quota_bytes": 0,
        "name": "string",
        "title": "string",
        "ext": "string",
        "status": "string",
        "optimized": true,
        "parent_id": "string",
        "redacted": true,
        "security": "string",
        "description": "string",
        "processed_at": "string",
        "metadata": {
          "width": 0,
          "height": 0,
          "duration": 0,
          "pages": 0,
          "waveform": "string",
          "transcript": {
            "language": "string",
            "confidence": 0
          },
          "arguments": [
            {
              "name": "string",
              "description": "string",
              "required": true,
              "default": "string",
              "match": "string",
              "flags": "string",
              "message": "string",
              "lenient": true
            }
          ],
          "property1": true,
          "property2": true
        },
        "created_at": "string"
      }
    }
  ]
}
```

- `attachment` (`publishBody.response.200.attachment`; object, required)
  - `id` (`publishBody.response.200.attachment.id`; string, required)
- `asset` (`publishBody.response.200.asset`; object, required) — The asset the body holds now: the next write's `from` (or a staged write's `live`).
  - `id` (`publishBody.response.200.asset.id`; string, required)
- `created` (`publishBody.response.200.created`; array<object>, required) — The attachments the write bound: the embeds a live write or a publish derived.
  - `id` (`publishBody.response.200.created.id`; string, required)
  - `role` (`publishBody.response.200.created.role`; string, required)
  - `asset` (`publishBody.response.200.created.asset`; object, required)
    - `id` (`publishBody.response.200.created.asset.id`; string, required)
- `attachments` (`publishBody.response.200.attachments`; array<object>, optional) — Every attachment on the target with its asset whole; answered only with `full`.
  - `id` (`publishBody.response.200.attachments.id`; string, required)
  - `target` (`publishBody.response.200.attachments.target`; object, required)
    - `kind` (`publishBody.response.200.attachments.target.kind`; string, required)
    - `id` (`publishBody.response.200.attachments.target.id`; string, required)
  - `role` (`publishBody.response.200.attachments.role`; string, required)
  - `delivery` (`publishBody.response.200.attachments.delivery`; string, required)
  - `preview_only` (`publishBody.response.200.attachments.preview_only`; boolean, required)
  - `from_body` (`publishBody.response.200.attachments.from_body`; boolean, required)
  - `release_file` (`publishBody.response.200.attachments.release_file`; boolean, required) — A file a software release ships, which its release edits and the product's own list leaves out.
  - `position` (`publishBody.response.200.attachments.position`; number, required)
  - `asset` (`publishBody.response.200.attachments.asset`; object, required)
    - `id` (`publishBody.response.200.attachments.asset.id`; string, required)
    - `locator` (`publishBody.response.200.attachments.asset.locator`; any of, required)
      - any of: `string`, `null`
    - `origin` (`publishBody.response.200.attachments.asset.origin`; string, required)
    - `custodian` (`publishBody.response.200.attachments.asset.custodian`; string, required)
    - `enforcement` (`publishBody.response.200.attachments.asset.enforcement`; string, required)
    - `mime` (`publishBody.response.200.attachments.asset.mime`; any of, required)
      - any of: `string`, `null`
    - `bytes` (`publishBody.response.200.attachments.asset.bytes`; any of, required) — The file's size in bytes; null when it is charged nothing.
      - any of: `number`, `null`
    - `quota_bytes` (`publishBody.response.200.attachments.asset.quota_bytes`; number, required) — The file's size in bytes; zero when it is charged nothing.
    - `name` (`publishBody.response.200.attachments.asset.name`; string, required)
    - `title` (`publishBody.response.200.attachments.asset.title`; any of, required)
      - any of: `string`, `null`
    - `ext` (`publishBody.response.200.attachments.asset.ext`; any of, required)
      - any of: `string`, `null`
    - `status` (`publishBody.response.200.attachments.asset.status`; string, required)
    - `optimized` (`publishBody.response.200.attachments.asset.optimized`; boolean, required)
    - `parent_id` (`publishBody.response.200.attachments.asset.parent_id`; any of, required)
      - any of: `string`, `null`
    - `redacted` (`publishBody.response.200.attachments.asset.redacted`; boolean, required)
    - `security` (`publishBody.response.200.attachments.asset.security`; any of, required)
      - any of: `string`, `null`
    - `description` (`publishBody.response.200.attachments.asset.description`; any of, required)
      - any of: `string`, `null`
    - `processed_at` (`publishBody.response.200.attachments.asset.processed_at`; any of, required)
      - any of: `string`, `null`
    - `metadata` (`publishBody.response.200.attachments.asset.metadata`; object, required)
      - `width` (`publishBody.response.200.attachments.asset.metadata.width`; integer, optional)
        - min 0
      - `height` (`publishBody.response.200.attachments.asset.metadata.height`; integer, optional)
        - min 0
      - `duration` (`publishBody.response.200.attachments.asset.metadata.duration`; number, optional) — Seconds, measured, so rarely whole.
      - `pages` (`publishBody.response.200.attachments.asset.metadata.pages`; integer, optional)
        - min 0
      - `waveform` (`publishBody.response.200.attachments.asset.metadata.waveform`; any of, optional) — An audio file's waveform: 256 levels from 0 to 255, base64; null when it can't be drawn.
        - any of: `string`, `null`
      - `transcript` (`publishBody.response.200.attachments.asset.metadata.transcript`; object, optional)
        - `language` (`publishBody.response.200.attachments.asset.metadata.transcript.language`; string, optional)
        - `confidence` (`publishBody.response.200.attachments.asset.metadata.transcript.confidence`; number, optional)
      - `arguments` (`publishBody.response.200.attachments.asset.metadata.arguments`; array<object>, optional) — What an MCP prompt asks for; only an authored prompt carries it.
        - `name` (`publishBody.response.200.attachments.asset.metadata.arguments.name`; string, required)
        - `description` (`publishBody.response.200.attachments.asset.metadata.arguments.description`; any of, required)
          - any of: `string`, `null`
        - `required` (`publishBody.response.200.attachments.asset.metadata.arguments.required`; boolean, required)
        - `default` (`publishBody.response.200.attachments.asset.metadata.arguments.default`; any of, required)
          - any of: `string`, `null`
        - `match` (`publishBody.response.200.attachments.asset.metadata.arguments.match`; any of, required) — Pattern the whole value must match, diacritic-insensitive.
          - any of: `string`, `null`
        - `flags` (`publishBody.response.200.attachments.asset.metadata.arguments.flags`; any of, required) — Flags among `i`, `s` and `u` the pattern runs with; null for `i` alone.
          - any of: `string`, `null`
        - `message` (`publishBody.response.200.attachments.asset.metadata.arguments.message`; any of, required) — What a refused value is told instead of the default reason.
          - any of: `string`, `null`
        - `lenient` (`publishBody.response.200.attachments.asset.metadata.arguments.lenient`; boolean, required)
    - `created_at` (`publishBody.response.200.attachments.asset.created_at`; any of, required)
      - any of: `string`, `null`

### default

A problem; see https://api.sherpo.io/merchant/docs/errors.

#### Example

```json
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "context": {},
  "reached_core": true,
  "core_answer": "string"
}
```

- `type` (`publishBody.response.default.type`; string, required)
  - format `uri`
- `title` (`publishBody.response.default.title`; string, required)
- `status` (`publishBody.response.default.status`; integer, required)
- `detail` (`publishBody.response.default.detail`; string, required)
- `code` (`publishBody.response.default.code`; string, optional)
- `context` (`publishBody.response.default.context`; object, optional)
- `reached_core` (`publishBody.response.default.reached_core`; boolean, optional)
- `core_answer` (`publishBody.response.default.core_answer`; string, optional)


Source: https://docs.sherpo.io/merchant-api/reference/publish-body/index.md
