It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Need to know how to insert attachments in Page body under Space using Api

I have added the attachment in the page but they are not being displayed in page body .

Kindly help me in solving this using api.

1 answer

1 accepted

1 vote
Answer accepted

Hello Nisha,

Happy to help you with this. 

When you're adding an attachment to a page via REST API, you are only adding it to the list of attachments. If you want to put the attachment in the body content, then you need to modify the body content. 

I was able to find a thread on this that can help you:

For more details, you can refer to our Confluence Cloud REST API Documentation.



Hi Shannon,

Thanks for the update .I have tried to post the content as specified in the thread you shared.But i couldn't find anything posted in the page .Please find the query i am using,


curl -u username:token -X PUT -H 'Content-Type: application/json' -d'{
}' "{content id}?status=current"


The instructions I provided are for Confluence Server. If you are on Confluence Cloud, you can check the following article for advice on how to do that:

Your example still has the test domain URL in it as well as the contentID placeholder. I am assuming that here you have included your Cloud instance URL and the contentID you obtained from the GET command that you ran prior to the PUT command?



Hi Shannon,


I am able to update the contents of the Page with text now .Thanks for the help.


I am using the following command:

curl -u username:password -X PUT -H 'Content-Type: application/json' -d'{"id":"927662202","type":"page","title":"Requirement","space":{"key":"~621441701"},"body":{"storage":{"value":"<p>This is the updated text for the new page</p>","representation":"storage"}},"version":{"number":17}}' | python -mjson.tool

But  my actual aim is to update the csv sheet to th page or embedd the contents of the csv into page

Hi Nisha,

I just want to make sure I understand correctly what you need to do.

Are you trying to replace the CSV which is currently attached to the page with an updated version, or simply embed the contents of new CSVs on the page each time? I am assuming the CSV is the attachment you are uploading via REST-API.



Hi, Shannon, I want to upload new CSV to page each time but I did not know how to attach CSV to rest API call.

Suggest an answer

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

What project did you transition or start on Confluence with the shift to remote work?

It’s been great to hear from fellow users over the last few weeks about the best tips and fun moments you’ve had working on Confluence since the transition to working remote. I’d love to keep the c...

109 views 3 7
Join discussion

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