---
ai:
  exclude: true
search:
  tags:
    - Content Body
    - POST
seo:
  description: >-
    Converts between content body representations. Not all… Reference for the
    POST /rest/api/contentbody/convert/{to} endpoint in the Confluence Data
    Center API.
sidebar:
  label: Convert body representation
  badge: POST
title: Convert body representation
type: openapi-operation
---
Converts between content body representations. Not all representations can be converted to/from other formats. Supported conversions: 

- `storage -> view,export_view,styled_view,editor`
- `editor -> storage`
- `view -> None`
- `export_view -> None`
- `styled_view -> None`

Example request URI(s):

- `http://example.com/confluence/rest/api/contentbody/convert/view`

`POST /rest/api/contentbody/convert/{to}`

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

the body to convert from

- `representation` (string)
- `value` (string)
- `webresource` (WebResourceDependencies)
- `content` (ReferenceContent)
- `contentRef` (ReferenceContent)

Request body example:

```json
{
  "representation": "string",
  "value": "This is a body",
  "webresource": {
    "keys": [
      "key1",
      "key2",
      "key3"
    ],
    "contexts": [
      "context1",
      "context2",
      "context3"
    ],
    "uris": {},
    "tags": {},
    "superbatch": {
      "uris": {},
      "tags": {},
      "metatags": "string"
    }
  },
  "content": {
    "expanded": true,
    "idProperties": {}
  },
  "contentRef": {
    "expanded": true,
    "idProperties": {}
  }
}
```

**Responses**

- `200` — returns the converted body

Response example, 200:

```json
{
  "representation": "string",
  "value": "This is a body",
  "webresource": {
    "keys": [
      "key1",
      "key2",
      "key3"
    ],
    "contexts": [
      "context1",
      "context2",
      "context3"
    ],
    "uris": {},
    "tags": {},
    "superbatch": {
      "uris": {},
      "tags": {},
      "metatags": "string"
    }
  },
  "content": {
    "expanded": true,
    "idProperties": {}
  },
  "contentRef": {
    "expanded": true,
    "idProperties": {}
  }
}
```
