How to specify parent page of new/updated page in Confluence REST API?

I'm able to create/modify pages via the Confluence REST API, but they all appear at the space root. If I move a page manually, and then I update its content via the API, it is moved back to the space root. How do I create a page which has another page as its parent?

1 answer

1 accepted

2 votes
Accepted answer

One of the comments in this stack overflow question details how to create the new page as a child of an existing page using the 'ancestors' property:

http://stackoverflow.com/questions/23523705/how-to-create-new-page-in-confluence-using-their-rest-api

But it does warn that this is an undocumented feature.

Yes, great, that comment did the trick.

"ancestors":[{"type":"page","id":12345}]

How do you get the ancestor ID of an existing page? It's always empty (either an empty array or an empty string) when I fetch the page.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Friday in Off-topic

Friday Fun: Dry T-Shirt Competition - What's your BEST (Atlassian) T-Shirt!?

[Note: So it was my turn for Friday Fun and sadly I was sick thanks to rubbish sinus infection... so apologies to most of Europe and Asia for the delayed post. However, I finally got out of bed for t...

153 views 9 3
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you