Entering Timeline notes with HTML markup via API - it displays HTML markup instead of styling the text



Is there a trick to entering simple HTML/style CSS that the Hubspot CRM notes manual entry support? When I enter it in the API, it does not escape characters and the raw HTML is visible. Help?


Hi @thecoolcoder,

Just to make sure that we're on the same page, are you trying to create NOTE-type engagements via the API with custom coloring/styling? Can you send me a link to an example object with a note that demonstrates what you're trying to do?


Hi Derek,

You are exactly correct. I was trying to submit a Note via Engagements API that had syntax and text that was identical to the body of a Note as if you applied the Note text formatting options. I was trying to highlight certain words using background color span tag. I had the html markup showing

<span style=background-color:#F2f2f2;”>highlighted words</span>

...all “<“ and “>” and just all of it was visible. My partner I think figured it out, but the client ultimately decided that they did not want the text highlighting.

But I now assume that I have to use a certain Note template to make the HTML display properly? Such as visual highlighting text with background-color?



Hi @thecoolcoder,

I understand; thanks for the clarification. I'm not 100% sure why your notes weren't functioning correctly; the following metadata successfully created a note with a color background:

"metadata": {
    "body": "<p>Test note #2 with <span style=\"background-color: #f5c26b;\">color highlighting!</span></p>"

For the record, that hex code is the exact color used in-app, so it's entirely possible we do some sort of validation to only allow the same options we allow in-app? Can you try again using that example metadata?