How to get page content or child list via REST API

Platform Notice: Data Center Only - This article only applies to Atlassian apps on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Although the REST API for Confluence DC is provided, it is sometimes not easy for new users to identify which one to use and how to use it. They may wonder which endpoints and parameters are appropriate.

The examples of the two usages below are provided here for users who have similar needs.

  • Retrieving page content for a page

  • Fetching child list for a page

Environment

Confluence Data Center

Solution

Retrieving Page Content:

If requesting the REST API endpoint of “Get Content by id” (GET /rest/api/content/{id}) with the parameter “expand=body.storage”, the page content with some meta information can be retrieved.

Here is a sample request and sample response.

Sample Request URL

(Base URL)/rest/api/content/1769476?expand=body.storage

*The target page ID is 1769476

Sample Response

{"id":"1769476","type":"page","status":"current","title":"this is title","body":{"storage":{"value":"<p>this is page content</p>","representation":"storage","_expandable":{"content":"/rest/api/content/1769476"}},"_expandable":{"editor":"","view":"","export_view":"","styled_view":"","anonymous_export_view":""}},"extensions":{"position":"none"},"_links":{"webui":"/pages/viewpage.action?pageId=1769476","edit":"/pages/resumedraft.action?draftId=1769476&draftShareId=279eb6e9-7bcb-4ef7-9517-455f0cae80a5","tinyui":"/x/BAAb","collection":"/rest/api/content","base":"https://instenv-202992-g1kk.instenv.internal.atlassian.com","context":"","self":"(Base URL)/rest/api/content/1769476"},"_expandable":{"container":"/rest/api/space/AAA","metadata":"","operations":"","children":"/rest/api/content/1769476/child","restrictions":"/rest/api/content/1769476/restriction/byOperation","history":"/rest/api/content/1769476/history","ancestors":"","version":"","descendants":"/rest/api/content/1769476/descendant","space":"/rest/api/space/AAA"}}

Fetching Child Page List:

By requesting the REST API endpoint “Children” (GET /api/content/{id}/child) with the parameter “expand=page”, it is possible to retrieve the child list for a page with some meta information.

Here is a sample request and sample response.

Sample Request URL

(Base URL)/rest/api/content/98344/child?expand=page

* Fetch child page information for the parent page of 98344

Sample Response

{"page":{"results":[{"id":"1605633","type":"page","status":"current","title":"This is child page","extensions":{"position":"none"},"_links":{"webui":"/pages/viewpage.action?pageId=1605633","edit":"/pages/resumedraft.action?draftId=1605633&draftShareId=b55b79b2-e7da-42d1-8587-d58baae64aba","tinyui":"/x/AYAY","self":"(Base URL)/rest/api/content/1605633"},"_expandable":{"container":"/rest/api/space/TEST","metadata":"","operations":"","children":"/rest/api/content/1605633/child","restrictions":"/rest/api/content/1605633/restriction/byOperation","history":"/rest/api/content/1605633/history","ancestors":"","body":"","version":"","descendants":"/rest/api/content/1605633/descendant","space":"/rest/api/space/TEST"}}],"start":0,"limit":25,"size":1,"_links":{"self":"(Base URL)/rest/api/content/98344/child/page"}},"_links":{"base":"(Base URL)","context":"","self":"( Base URL)/rest/api/content/98344/child"},"_expandable":{"attachment":"/rest/api/content/98344/child/attachment","comment":"/rest/api/content/98344/child/comment"}}

Authentication — how to authorise the request:

The endpoints above require an authenticated user with read access to the target page. Use one of:

  • Personal Access Token (PAT) — recommended for DC 7.9+: add -H "Authorization: Bearer <your-PAT>" to your curl command.

  • Basic auth — works on all supported DC versions: add -u username:password to your curl command.

Common errors:

HTTP status

Likely cause

What to check

401 Unauthorized

Missing or invalid credentials

Confirm PAT or basic-auth credentials, and that the user has not been deactivated.

403 Forbidden

User lacks read permission on the page or space

Verify space permissions and any page restrictions allow the user to view the page.

404 Not Found

Wrong page ID or wrong base URL

Confirm the page exists and that the base URL includes the context path (e.g. /confluence).

This article was verified using Confluence Data Center v 7.19.16. Please note the request and response for other versions may vary.

Related articles:

Updated on May 28, 2026

Still need help?

The Atlassian Community is here for you.