Forums

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

Alternative to <ac:image> for adding expandable images via Confluence Cloud API

Florent Lambrette August 22, 2025

Hi,
I'm trying to use the Confluence Cloud API to update a page using the endpoint with an HTML body:

/wiki/api/v2/pages/{page_id} 

So when I inject an image, I do it using the macro like this:

<ac:image ac:align="center" ac:thumbnail="true">
<ri:attachment ri:filename="my-picture.png"></ri:attachment>
</ac:image>

The picture has been uploaded previously with the endpoint : 

/wiki/rest/api/content/{page_id}/child/attachment


It works fine, but the problem is that the image is not in "thumbnail" mode, is too big or can't be expanded if i use the width property to reduce the size :


Screenshot 2025-08-22 at 21.58.25.png

If I try to edit it directly in the page, I get this message:

"This macro can’t be edited.
This macro was added to a page that was converted from the legacy editor.
It can’t be edited because it is now incompatible with the current editor."

Is there anything I can use instead of <ac:image>?
I just want to insert an image that can be expanded; otherwise, I’ll have to hardcode a width/height for each image in my code.







2 answers

1 accepted

0 votes
Answer accepted
marc -Collabello--Phase Locked-
Community Champion
August 24, 2025

Can you try to convert the image to the new editor a second time?  This is just a guess.

Florent Lambrette August 25, 2025

It seems i can't, this is what i see when i try to edit the page (even in "live doc" mode) : 

Screenshot 2025-08-25 at 09.33.05.png

And this is the error I see when I click the edit Image button.

Screenshot 2025-08-25 at 09.33.14.png

marc -Collabello--Phase Locked-
Community Champion
August 25, 2025

You can try to reverse engineer the new macro format:

  • make a new page
  • insert an image
  • view the page storage format
  • use this as a prototype for the macro source code
Florent Lambrette August 25, 2025

Okay, good idea — it worked! Here is the solution (width/height are optional):

<p />
<ac:image ac:align="center" ac:layout="center" ac:original-height="502" ac:original-width="917" ac:custom-width="true" ac:alt="sc.png" ac:width="768">
<ri:attachment ri:filename="sc.png" ri:version-at-save="2" />
</ac:image>
<p />
 

And this is the solution to use the inline mode

<p>
<ac:image ac:original-height="502" ac:original-width="917" ac:inline="true" ac:alt="sc.png">
<ri:attachment ri:filename="sc.png" ri:version-at-save="2" />
</ac:image>
</p>

Thank you Very much @marc -Collabello--Phase Locked-  ! 

0 votes
Vishalakshi Narayana Swamy
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 25, 2025

Hi @Florent Lambrette

Welcome to Atlassian community!

I have created this support ticket https://getsupport.atlassian.com/browse/JST-1174476 to address this issue further, one of ur support agents will reach out to you shortly.

Best Regards,

Vishalakshi Narayanaswamy

Suggest an answer

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

Atlassian Community Events