---
title: "Get all ancestors of folder"
method: GET
path: "/folders/{id}/ancestors"
tags: ["Ancestors"]
---

# Get all ancestors of folder

`GET /folders/{id}/ancestors`

Returns all ancestors for a given folder by ID in top-to-bottom order (that is, the highest ancestor is
the first item in the response payload). The number of results is limited by the `limit` parameter and additional results 
(if available) will be available by calling this endpoint with the ID of first ancestor in the response payload.

This endpoint returns minimal information about each ancestor. To fetch more details, use a related endpoint, such
as [Get folder by id](https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-smart-link/#api-folders-id-get).

**[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
Permission to access the Confluence site ('Can use' global permission).
Permission to view the folder and its corresponding space

## Path parameters

- `id` integer, required

## Query parameters

- `limit` integer

## Response `200`

Returned if the requested ancestors are returned.

- object
  - `results` Ancestor[]
    - `id` string — ID of the ancestor
    - `type` 'page' | 'whiteboard' | 'database' | 'embed' | 'folder' — The type of ancestor.

## Other responses

- `400` — Returned if an invalid request is provided.
- `401` — Returned if the authentication credentials are incorrect or missing from the request.
- `404` — Returned if the calling user does not have permission to view the specified folder or the folder was not found.

---

[API](https://skmtc.net/atlassian/apis/the-confluence-cloud-rest-api-v2.md) · [All operations](https://skmtc.net/atlassian/apis/the-confluence-cloud-rest-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/atlassian/the-confluence-cloud-rest-api-v2/revisions/c4bd1ed570f2/schema)
