# REST API body representations: storage, view and ADF

URL: https://goingstellar.ro/reference/confluence-storage-format/rest-api-representations/

The Confluence Cloud content API gives the body of a page in several representations. body.storage is the XHTML-based source, body.view is the rendered HTML and body.atlas_doc_format is the ADF JSON. A body can be saved as storage or as ADF and read back in any of them.

## Storage format

```xml
<ac:structured-macro ac:name="NAME" ac:schema-version="1" ac:macro-id="ID" />
```

## As ADF (Confluence Cloud)

The ADF that Confluence Cloud builds for:

```xml
ADF:{"content": [{"attrs": {"extensionKey": "toc", "extensionType": "com.atlassian.confluence.macro.core", "parameters": {"macroParams": {}}}, "type": "extension"}], "type": "doc", "version": 1}
```

```json
{
 "type": "doc",
 "content": [
  {
   "type": "extension",
   "attrs": {
    "extensionType": "com.atlassian.confluence.macro.core",
    "extensionKey": "toc",
    "parameters": {
     "macroParams": {
      "_parentId": {
       "value": "<page id>"
      }
     },
     "macroMetadata": {
      "macroId": {
       "value": "<id>"
      },
      "schemaVersion": {
       "value": "1"
      },
      "title": "Table of Contents"
     }
    }
   }
  }
 ],
 "version": 1
}
```

## Examples

Storage format sent:

```xml
<ac:structured-macro ac:name="noformat"><ac:plain-text-body><![CDATA[preformatted *no* formatting]]></ac:plain-text-body></ac:structured-macro>
```

A noformat macro saved as storage. body.storage returns the macro and body.view returns the rendered panel, while the ADF round trip rewrites it as a code macro.

Rendered view (HTML):

```html
<div class="preformatted panel conf-macro output-block" data-hasbody="true" data-macro-id="<id>" data-macro-name="noformat" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>preformatted *no* formatting</pre>
</div></div>
```

Storage format after the round trip through ADF:

```xml
<ac:structured-macro ac:name="code" ac:schema-version="1" ac:macro-id="<id>"><ac:plain-text-body><![CDATA[preformatted *no* formatting]]></ac:plain-text-body></ac:structured-macro>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
<ac:structured-macro ac:name="info"></ac:structured-macro>
```

An empty info macro. body.storage returns the macro, body.view returns an empty info box, and the ADF round trip drops it.

Rendered view (HTML):

```html
<div class="confluence-information-macro confluence-information-macro-information conf-macro output-block" data-hasbody="false" data-macro-id="<id>" data-macro-name="info"><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"> </span><div class="confluence-information-macro-body"> </div></div>
```

Storage format after the round trip through ADF:

```xml
<p />
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
<ac:structured-macro ac:name="recently-updated"></ac:structured-macro>
```

A macro that lists site content. body.storage holds only the macro element, and body.view was replaced with a marker text before publication.

Rendered view (HTML):

```html
<macro output not published: it lists pages, tasks or people from the site>
```

Storage format after the round trip through ADF:

```xml
<ac:structured-macro ac:name="recently-updated" ac:schema-version="1" ac:macro-id="<id>" />
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
ADF:{"content": [{"attrs": {"extensionKey": "toc", "extensionType": "com.atlassian.confluence.macro.core", "parameters": {"macroParams": {}}}, "type": "extension"}], "type": "doc", "version": 1}
```

A body saved as ADF, with a toc extension and no ids. body.storage returns an ac:structured-macro with a generated macro-id.

Rendered view (HTML):

```html
<div class="toc-macro client-side-toc-macro  conf-macro output-block" data-hasbody="false" data-headerelements="H1,H2,H3,H4,H5,H6,H7" data-macro-id="<id>" data-macro-name="toc"> </div>
```

Storage format after the round trip through ADF:

```xml
<ac:structured-macro ac:name="toc" ac:schema-version="1" ac:macro-id="<id>" />
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
ADF:{"content": [{"content": [{"attrs": {"width": 33.33}, "content": [{"content": [{"text": "a", "type": "text"}], "type": "paragraph"}], "type": "layoutColumn"}, {"attrs": {"width": 66.66}, "content": [{"content": [{"text": "b", "type": "text"}], "type": "paragraph"}], "type": "layoutColumn"}], "type": "layoutSection"}], "type": "doc", "version": 1}
```

A body saved as ADF with two layout columns of 33.33 and 66.66. body.storage returns a two_left_sidebar layout section.

Rendered view (HTML):

```html
<div class="contentLayout2">
<div class="columnLayout two-left-sidebar" data-layout="two-left-sidebar">
<div class="cell aside" data-type="aside">
<div class="innerCell">
<p>a</p></div>
</div>
<div class="cell normal" data-type="normal">
<div class="innerCell">
<p>b</p></div>
</div>
</div>
</div>
```

Storage format after the round trip through ADF:

```xml
<ac:layout><ac:layout-section ac:type="two_left_sidebar" ac:breakout-mode="default"><ac:layout-cell><p>a</p></ac:layout-cell><ac:layout-cell><p>b</p></ac:layout-cell></ac:layout-section></ac:layout>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
ADF:{"content": [{"attrs": {"isNumberColumnEnabled": true, "layout": "wide"}, "content": [{"content": [{"content": [{"content": [{"text": "H1", "type": "text"}], "type": "paragraph"}], "type": "tableHeader"}, {"content": [{"content": [{"text": "H2", "type": "text"}], "type": "paragraph"}], "type": "tableHeader"}], "type": "tableRow"}, {"content": [{"attrs": {"colspan": 2}, "content": [{"content": [{"text": "merged", "type": "text"}], "type": "paragraph"}], "type": "tableCell"}], "type": "tableRow"}, {"content": [{"attrs": {"background": "#deebff"}, "content": [{"content": [{"text": "bg", "type": "text"}], "type": "paragraph"}], "type": "tableCell"}, {"content": [{"content": [{"text": "x", "type": "text"}], "type": "paragraph"}], "type": "tableCell"}], "type": "tableRow"}], "type": "table"}], "type": "doc", "version": 1}
```

A body saved as ADF with a numbered table, a merged cell and a cell background. body.storage returns numberingColumn cells with generated numbers and a colgroup.

Rendered view (HTML):

```html
<div class="table-wrap"><table data-layout="wide" class="confluenceTable"><colgroup><col/></colgroup><tbody><tr><th class="numberingColumn confluenceTh" /><th class="confluenceTh"><p>H1</p></th><th class="confluenceTh"><p>H2</p></th></tr><tr><td class="numberingColumn confluenceTd">1</td><td colspan="2" class="confluenceTd"><p>merged</p></td></tr><tr><td class="numberingColumn confluenceTd">2</td><td data-highlight-colour="#deebff" class="confluenceTd"><p>bg</p></td><td class="confluenceTd"><p>x</p></td></tr></tbody></table></div>
```

Storage format after the round trip through ADF:

```xml
<table data-layout="wide"><colgroup><col /></colgroup><tbody><tr><th class="numberingColumn" /><th><p>H1</p></th><th><p>H2</p></th></tr><tr><td class="numberingColumn">1</td><td colspan="2"><p>merged</p></td></tr><tr><td class="numberingColumn">2</td><td data-highlight-colour="#deebff"><p>bg</p></td><td><p>x</p></td></tr></tbody></table>
```

Sent to Confluence Cloud on 29 Nov 2026.

## What changes in conversion

- body.storage is what was saved and normalised by Confluence. Macros gain ac:schema-version and a generated ac:macro-id, and empty macros are written as self-closing elements.
- body.view is output only. It holds the rendered HTML, such as a code panel for noformat, a placeholder image for unknown macros, or an error message for a macro with bad parameters. It cannot be saved back.
- body.atlas_doc_format is built from the stored page. A body saved as ADF is rewritten as storage on write, and the storage that results is the one that later reads return.
- A save can fail. The probes with an iframe macro and a widget macro returned HTTP 500 with a MacroTypedParameterValueException in the message, and no representation of those bodies exists.

## Pitfalls

- Reading back the same representation you wrote is not proof of lossless storage. Read body.storage after an ADF write to see what the conversion produced.
- body.view for macros that list site content depends on the content of the site, so it cannot serve as a stable test fixture.
- Generated values (macro ids, localIds, _parentId) differ between saves. Strip them before comparing.

## Questions and answers

### Which representation should I edit?

The probes use body.storage for XHTML pages and body.atlas_doc_format for Cloud editor pages. Mixing them in one workflow rewrites the page through the conversion.

## Related

- [Storage format vs ADF](https://goingstellar.ro/reference/confluence-storage-format/storage-vs-adf/)
- [Reporting macros (content by label, recently updated, attachments...)](https://goingstellar.ro/reference/confluence-storage-format/report-macros/)
- [html, iframe and widget macros](https://goingstellar.ro/reference/confluence-storage-format/html-iframe-widget/)
- [Unknown and empty macros](https://goingstellar.ro/reference/confluence-storage-format/unknown-macros/)
- [Macros removed from the Cloud editor](https://goingstellar.ro/reference/confluence-storage-format/legacy-macros/)

## Sources

- [Confluence Cloud REST API v1: content (Atlassian Developer)](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content/)
- [Confluence storage format (Atlassian Documentation)](https://confluence.atlassian.com/doc/confluence-storage-format-790796544.html)
- [Atlassian Document Format: document structure (Atlassian Developer)](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/)

