The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

REST API V2: How to make a page child of a database (or folder, or...)?

Heinrich Ulbricht (WikiTraccs)
Contributor
September 24, 2024

The Confluence Cloud v2 REST API endpoint to create a page takes a parentId parameter to specify a parent content ID. The docs don't narrow down the parent content type, but setting a database as parent seems to fail.

How to specify a non-page content type as parent of a page, like a parent database, or a parent whiteboard, or a parent folder?

Users can manually make pages children of those non-page content types.

The API returns a 500 server error when trying to use a database as parentId of a page:

{"errors":[{"status":500,"code":"INTERNAL_SERVER_ERROR","title":"Internal Server Error","detail":null}]}

(I also checked if there is a general issue with databases as parent, but setting the parentId of a database to another database succeeds. Also, setting a page as parent of a database succeeds. But database as parent of a page? Nope. Folder as the parent of a page? Nope again.)

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

2 votes
Answer accepted
Deleted user
September 24, 2024

Hello @Heinrich Ulbricht (WikiTraccs) 

Good news, you can do it... but it's a two step process.

After you have created the page, you then use the v1 Move a page to a new location endpoint and append that page to the other content type (database, folder, whiteboard etc) that you want as the parent.

Even though the endpoint refers to pages, it works on all content types, so you can use it to move any content (and its descendents) to any specific location anywhere in the content tree.

 

Heinrich Ulbricht (WikiTraccs)
Contributor
September 24, 2024

Tested and it works. Perfect workaround, thank you.

I'm using this for now, but still hope for the parentId to start working at some point...

TAGS
AUG Leaders

Atlassian Community Events