REST API V2: How to get children of databases, whiteboards, etc. with v2 API, now that v1 is deprecated?

With the Confluence v1 REST API it was possible to get child contents via the content/<ID>/child/<TYPE> endpoints, where TYPE can be page, whiteboard, database, etc. The ID also can refer to any content type, e.g. a Confluence database, to get its children.

To summarize, the v1 endpoint allows to get children of any content type from parents of any content type.

Now that the content/<ID>/child endpoint is deprecated, how to achieve the same using the v2 REST API?

There is a v2 endpoint to get child pages of pages: pages/<ID>/children. But what about the other content types? There is no databases/<ID>/children or whiteboards/<ID>/children, although those can have children as well.

Furthermore, it seems that pages/<ID>/children really just returns child pages, but not other child content types.

Is this how it’s supposed to work? How to get the children (of any type) of a content ID (of any type that can have children)?

1 Like

There’s no v2 API that returns all children, but you can use the Get content descendants by type endpoint with the depth=root parameter instead. It’s from the v1 API, but not deprecated (yet).

If you would like to have a v2 endpoint that returns all children, you can upvote and comment on this feature request: https://jira.atlassian.com/browse/CONFCLOUD-79631.

1 Like

Nice, a v1 endpoint that is not deprecated and works. I was not aware of this one. This will do for my use case.

The issue you linked has a slightly different focus in that it wants the result to be in a specific order. Nevertheless, it also wants the API to return all content types without having to issue n calls. I support that :smiley:

Thank you.

1 Like