Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Confluence - Images not rendered through content REST API.


This is my curl call:
curl D -X GET -H 'Authorization: Basic *********' -H 'Content-Type: application/json' '$pageId?,bb,body.view,version,container'


I get all the text and html in response. But images are not displayed. When the session is going on to Confluence, images are displayed, otherwise not!

Please help!

2 answers

Hello Stephen, Stephen Sifers

I see the below curl cmd working as expected... 

when i post below request - i could the image rendered on the confluence page.

But when i try to render another image - it is overwriting the existing/first image on the confluence page.


My question is how do we append the images in the confluence page instead of overwriting... Please suggest. thanks


curl --insecure -k --request PUT \
--url '' \
--user '1628738:<pwd>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"value":"<p>Adding image to page</p><ac:image><ri:attachment ri:filename=\"values.png\" /></ac:image>",

Hello Tanushree and welcome to the Community!

The info you provided paints a clear picture of what you’re wanting and are accessing. The first thing I see which might explain why your images are not showing is that you’re not viewing the storage format of the Confluence page.

To explain a bit more detail into this, I’ll explain how images are displayed within Confluence. When you have a page within Confluence, you have 2 options to display an image within a page. The two options are a linked image (which exists somewhere else and is referenced as an image) and attached images (which are attached to a page within Confluence and displayed within a Confluence page). Both of these are viewed differently when viewing the Confluence page via the REST API. You are going back to why you’re not able to see the image within your REST API call. From your API call, the endpoint you’re accessing is correct. 

Let's go back to why you’re not able to see the image within your REST API call. From your API call, the endpoint you’re accessing is correct. However, if you want to see an image which is attached to a Confluence page, you will need to view the child/attachment to gain access to the images. The endpoint to access attachments is GET /rest/api/content/{id}/child/attachment. With this endpoint, you would make a call to request any attachments for the parent page which may have an image attached.

I hope this explains why images are not directly displayed via the endpoint you’re requesting along with how images may be stored and displayed within Confluence.

Stephen Sifers

I have used this API already. It gives a json response with a _links attribute which has download and webui attributes in it.

I merged the atlassian base url and the download link from response and hit the merged link in browser, it took me to the login page of atlassian.

Which link am I supposed to provide to the image source to display the image or make it downloadable?

Also how we should add images to confluence page? Right now we are just copy pasting the image in the editor. We can change the way so as to get the response in REST API.

Hello Tanushree,

Thank you for replying and providing additional clarification.

If you want to access page attachments externally then, you will have to authenticate to get to the files attached. You would either need to pass through authentication when attempting access or enable anonymous access to the site.

For setting up Confluence anonymous access, please review Setting Up Public Access. This would allow you to make content available without having to authenticate to Confluence. However, this does not apply to all applications as this would let all content to be publically available.

I hope this helps clarify how to access your attachments within Confluence.

Stephen Sifers

hello @Stephen Sifers can u show example for    to authenticate to get to the files attached.

i am been trying to authenticate image from page not able to do it. using token to authenticate.

What I dont understand is why attachements need Anonymous access? What is the security concern? Some user can very well expose sensitive data in text as well, which is freely avaialble via APIs, but for some wierd reason attachments are not.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence

An update on Confluence Cloud customer feedback – June 2022

Hi everyone, We’re always looking at how to improve Confluence and customer feedback plays an important role in making sure we're investing in the areas that will bring the most value to the most c...

159 views 1 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you