Hello,
I have successfully created a Confluence page that includes a “code block” macro via REST API. In the body of the API call I use “representation” = “wiki”, then, the code block starts with “{code:linenumbers=true|firstline=0001|collapse=true}”.
I read that the “code block” macro (and others) will be DA on Feb 2026. Recommendation is to use the “code snippet” element.
This document shows how to use the new “code snippet” from GUI. I am unable to find information about doing this programmatically via REST API… Any leads/ideas?
Thank you in advance.
Hi @Erick Machuca ,
I haven't been playing with this, but as far as I know, there's no official docs or REST API support for inserting the new "code snippet" macro. Here's a somewhat relevant article: Insert the code block macro
Now, what I would suggest (and you've mentioned this in the title), is to check Developer Community, where you might find or get some better assistance on the matter (or at least suggestions for potential workarounds).
Cheers,
Tobi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.