Issue with pagination for comments and replies using Confluence REST API

Using the following API, we are able to fetch comments and replies for a content item:

GET https://api.atlassian.com/ex/confluence/{cloudId}/wiki/rest/api/content/search
?cql=type={content-type} AND id={content-id}
&expand=children.comment.body.storage,children.comment.children.comment.body.storage
&cursor={nextPage-cursor}
&limit={limit}

Observed behavior:

  • The API returns only 25 comments for the content item.

  • For each comment, only 25 replies are returned.

  • If there are more comments or replies, the response contains a cursor for the next page of results.

However, the cursor returned points to endpoints like:

/content/{id}/child/comment

This endpoint appears to be deprecated.

Concern:

Although the API provides a cursor for pagination, the cursor refers to a deprecated endpoint (content/{id}/child/comment) for fetching additional comments or replies.

Questions:

  1. What is the recommended way to paginate all comments and replies for a content item using the current supported APIs?

  2. Is there an alternative API that should be used instead of the deprecated content/{id}/child/comment endpoint for retrieving additional comments or replies?

Any clarification on the recommended approach would be helpful.