Passing AUI tags in Confluence REST API for content body.storage.value

I am trying to update my confluence page’s content via the endpoint:

PUT /rest/api/content/{contentId}

I noticed the following things when trying to update the page’s content:

  • data-attributes get stripped out
  • AUI tags get stripped out
  • AUI class names do not get stripped out

Here is an example of the body for my PUT request:

{
    "version": {
        "number": 2
    },
    "type": "page",
    "title": "Hello World",
    "body": {
        "storage": {
            "value": "<div data-hello='world'><aui-badge>19</aui-badge></div>",
            "representation": "storage"
        }
    }
}

Questions:

  1. How can I pass data-attributes so that they render in the final HTML?
  2. How can I pass AUI tags in my HTML string so that it it renders properly on the page?

I tried searching for answers to these questions but didn’t find anything that helped. If these questions have already been answered, I apologize for the repeat question.

Hello @BenM
When you submit raw HTML as content to Confluence, it’s parsed and sanitised, and any content that is not part of Atlassian’s XHTML standard is removed.

Hi @sunnyape , thanks for the response. Do you know where I can find the Atlassian’s XHTML standard?