Skip to main content
Question

Format comments messages using the Figma REST API

  • May 22, 2025
  • 1 reply
  • 17 views

Gaston Real

I would like to format the message text when I create comments using the REST API (POST/v1/files/:file_key/comments)

Something like this:

curl -X POST 
  -H 'X-FIGMA-TOKEN: figd_xyz' 
  -H "Content-Type: application/json" 
  'https://api.figma.com/v1/files/ZXY/comments' 
  -d '{"message":"This s a **bold** comment","client_meta":{"node_id":"1:360","node_offset":{"x":700,"y":10}}}'

However, this creates the comment with the literal string in the Figma file and without applying any formatting, the comment will show up in Figma like this:

“This s a **bold** comment”

How can I create formatted comments using the REST API?

I can see that the GET comment endpoint has an as_md parameter to get the comment with the markdown formatting, so I was expecting this to work the other way around too.

Is this possible?

1 reply

Gaston Real
  • Author
  • New Member
  • 1 reply
  • May 22, 2025

By inspecting what the Figma web client does, I can see it sends the formatted text like this:

message_meta: [{t: "Testing a "}, {t: "bold comment", styles: ["b"]}]

It uses message_meta instead of message 

I tested it and works correctly using this with the REST API as well, even it’s not documented. Can I trust this will work in the future?


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings