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

2 votes
Answer accepted
Sunny Ape
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
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...

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events