Confluence REST API and html text in color

Hello.

I’m using Cloud Confluence REST API to publish pages.
The page content is created fully in HTML.

It works well and we are using it often. Today I wanted to put some color in some case (errors in red for example) but I was unable to do it. Error 400 “Bad Request”
I read that usual html format is not recognized by Confluence API.

Can you explain me how to do it please ?

Hello @Calimero

The format for marking up XHTML text with a color is described in the Text Effects section of the Confluence Storage Format documentation.

For example:

POST /wiki/api/v2/pages

{
    "spaceId": "123456",
    "title": "Page created using XHTML content",
    "body": {
        "representation": "storage",
        "value": "A sentence with <span style=\"color: rgb(255,0,0);\">red text</span>"
    }
}

Many thanks. I didn’t see it on the documentation, probably look at the wrong place.