Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Developer CommunityDocumentation How to programmatically create a “code snippet” in a confluence clo

Erick Machuca
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 15, 2025

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.

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events