# List child pages with the Confluence REST API

URL: https://goingstellar.ro/reference/atlassian-rest-api/page-children/

GET /wiki/api/v2/pages/{id}/children returns the direct child pages with id, status, title, spaceId and childPosition. A child is created by giving parentId in v2 or ancestors in v1; both end up in the same list.

## Endpoints

| Method | Path | What it does |
|---|---|---|
| GET | `/wiki/api/v2/pages/{id}/children` | Lists direct child pages, with limit, cursor and sort. |
| POST | `/wiki/api/v2/pages` | Creates a page; parentId puts it under a parent. |

## Examples

### POST /wiki/api/v2/pages

Creates a child page by giving parentId.

```bash
curl -X POST \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "spaceId": "{spaceId}",
  "status": "current",
  "title": "Example child page",
  "parentId": "{pageId}",
  "body": {
    "representation": "storage",
    "value": "<p>Child.</p>"
  }
}' \
  'https://your-domain.atlassian.net/wiki/api/v2/pages'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.post(
    'https://your-domain.atlassian.net/wiki/api/v2/pages',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'spaceId': '{spaceId}',
          'status': 'current',
          'title': 'Example child page',
          'parentId': '{pageId}',
          'body': {'representation': 'storage', 'value': '<p>Child.</p>'}},
)
print(r.status_code, r.text)
```

Response: HTTP 200

```
{
 "spaceId": "655364",
 "parentId": "33653083",
 "id": "33620331",
 "title": "Example child page"
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

### POST /wiki/rest/api/content

Creates a second child with the v1 call and an ancestor.

```bash
curl -X POST \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "type": "page",
  "title": "Example page created with v1",
  "space": {
    "key": "SD"
  },
  "ancestors": [
    {
      "id": "{pageId}"
    }
  ],
  "body": {
    "storage": {
      "value": "<p>v1</p>",
      "representation": "storage"
    }
  }
}' \
  'https://your-domain.atlassian.net/wiki/rest/api/content'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.post(
    'https://your-domain.atlassian.net/wiki/rest/api/content',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'type': 'page',
          'title': 'Example page created with v1',
          'space': {'key': 'SD'},
          'ancestors': [{'id': '{pageId}'}],
          'body': {'storage': {'value': '<p>v1</p>', 'representation': 'storage'}}},
)
print(r.status_code, r.text)
```

Response: HTTP 200

```
{
 "id": "33784019",
 "title": "Example page created with v1",
 "ancestors": [
  {
   "id": "655541",
   "title": "Software Development"
  }
 ]
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

### GET /wiki/api/v2/pages/{pageId}/children

Lists the children of the parent page.

```bash
curl \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  'https://your-domain.atlassian.net/wiki/api/v2/pages/{pageId}/children'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.get(
    'https://your-domain.atlassian.net/wiki/api/v2/pages/{pageId}/children',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
)
print(r.status_code, r.text)
```

Response: HTTP 200

```
{
 "results": [
  {
   "id": "33620331",
   "status": "current",
   "title": "Example child page",
   "spaceId": "655364",
   "childPosition": 639
  },
  {
   "id": "33784019",
   "status": "current",
   "title": "Example page created with v1",
   "spaceId": "655364",
   "childPosition": 1247
  }
 ],
 "_links": {
  "base": "https://your-domain.atlassian.net/wiki"
 }
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

## How it behaves

- The list holds the v2 child and the v1 child, in creation order, each with childPosition (conf-page-children).
- Each entry has only id, status, title, spaceId and childPosition. No body and no version are included.
- The v1 call takes the parent as ancestors[0].id; the v2 call takes it as parentId (conf-page-create-v1, conf-page-create-child).

## Pitfalls

- The list is for direct children only. The spec has separate descendants and direct-children paths for deeper trees.
- Large trees need pagination. Follow the Link header or _links.next instead of building the cursor yourself.
- The listing carries no body and no version, so a second call is needed to read a child page.

## Questions and answers

### How do I list all descendants?

The v2 spec has a descendants path. It was not run.

## Related

- [Create a page](https://goingstellar.ro/reference/atlassian-rest-api/create-page/)
- [Get a page](https://goingstellar.ro/reference/atlassian-rest-api/get-page/)
- [Delete, trash and purge](https://goingstellar.ro/reference/atlassian-rest-api/delete-trash-purge/)
- [Spaces](https://goingstellar.ro/reference/atlassian-rest-api/spaces/)
- [Find a page by title](https://goingstellar.ro/reference/atlassian-rest-api/find-page-by-title/)

## Sources

- [Get child pages (Confluence REST API v2)](https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-children/#api-pages-id-children-get)
- [The Confluence Cloud REST API v2 (Atlassian Developer)](https://developer.atlassian.com/cloud/confluence/rest/v2/intro/)

