Rich Text Fields
Write formatted content to fields that use Clarify's BlockNote format
Some fields hold formatted content rather than plain strings. They use
BlockNote JSON: the same structured block format Clarify's UI editor
produces. Passing a plain string to one of these fields returns a 422.
| Object | Field | Shape |
|---|---|---|
comment | message | Block array |
task | description | { "text": [ ...blocks ] } |
The wrapper differs by field. A comment's message is the block array
directly; a task's description wraps the same block array in an object under
a text key. Match the shape for the field you're writing.
Block structure
Each block has a type and an array of inline text runs in content. A run is
{ "type": "text", "text": "...", "styles": { ... } }.
Block types: paragraph, heading (with props.level: 1–6),
bulletListItem, numberedListItem, checkListItem, codeBlock. The
styles object accepts the booleans bold, italic, underline, strike,
and code, plus textColor and backgroundColor, which each take a
color-name string:
{
"type": "text",
"text": "Hot lead",
"styles": { "bold": true, "textColor": "red" }
}Comments
A comment's message is the block array:
{
"message": [
{
"type": "paragraph",
"content": [
{ "type": "text", "text": "Follow up after the meeting on " },
{ "type": "text", "text": "Tuesday", "styles": { "bold": true } },
{ "type": "text", "text": " with the proposal." }
]
}
],
"owner_id": "872aced7-8f28-4bc8-9c2b-2602cb943c0d",
"entity": "person"
}The simplest valid payload is one paragraph with a single text run:
{
"message": [
{
"type": "paragraph",
"content": [{ "type": "text", "text": "Plain text body." }]
}
]
}Tasks
A task's description wraps the block array in an object under text:
{
"data": {
"type": "task",
"attributes": {
"title": "Send proposal to Acme Corp",
"description": {
"text": [
{
"type": "paragraph",
"content": [{ "type": "text", "text": "Follow up after the call." }]
}
]
}
}
}
}Round-tripping
The same shape is returned on GET, so you can read, modify, and write a field
back. To render plain text from content you fetched, walk the blocks and
concatenate the inline text values.